SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-29-07, 06:27 AM   #1
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Okay, I've changed my mind and started work on an application to make this slightly easier. The idea is to avoid the need for Java knowledge and development tools (except for the Java Virtual Machine, of course), while keeping all the power of the current API.

I can do that by integrating a different programming language (python, which is famously easy to use) into the application, so you can write your instructions in a text box, press a button, and have it run. Right now it works, although the interface is very rough. All of my Java work has been server-side and I'm still learning how to make pretty windows with it (If anyone has that knowledge, help would be appreciated).

For simple changes, what I have now is not more complex to use than editing the files by hand. As an example, if you want to change all the groups speed to 5 knots (as Jace11 mentioned), you would just write into the textbox:

Code:
group.speed = 5
group.updateWaypointSpeed ()
Right now I'm adding some small details (such as being able to choose the file to edit ), and some convenience calls to create new ships without having to fill every field. I will have that, as well as some basic documentation, either later today or tomorrow.

Is anyone interested in testing the program when it reaches that stage? I could do with a few more eyes looking at it. If so, let me know and I'll send it over. Once it's a bit more mature than that, and I have arranged for hosting somewhere, I will do a public release with full source.
mcoca is offline   Reply With Quote
Old 04-29-07, 07:27 AM   #2
Jace11
Seasoned Skipper
 
Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
Default

Good stuff.

Will this program be able to change some variables and not others...

Just one example:

"Spawnprobabilty=" can refer to a group like a convoy but also all the ships in that convoy have there own spawnprobabilty too..

Could you associate the search with another line or the group name or something so that one can easily replace the values for convoys and not ships..

Find/Replace cannot distinguish these apart, and my editing is taking forever...

A complete rehash of the campaign is daunting and ive only completed 1941 so far..
Jace11 is offline   Reply With Quote
Old 04-29-07, 08:15 AM   #3
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Jace11, all that is possible right now. The program has four entry fields:

- Condition for changing a group, for example:

Code:
group.groupName.contains("Jap_Convoy")
- Changes to apply to a group:

Code:
group.spawnProbability = group.spawnProbability/2
- A condition for changing each unit in the group:

Code:
unit.unitType == UnitType.DESTROYER
- Changes for units that fulfill that condition:

Code:
unit.shipClass = None
(that last one is untested, but it should remove the specific class, and thus make the destroyers a "GENERIC Destroyer")

Press the "change" button, and all japanese convoys will have half the spawn probability, and generic escorts.

I'll send you a PM once I have it ready.
mcoca is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.