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 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-01-10, 05:42 AM   #1
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default [TEC] Mod Tools, HowTo

FIRST STEPS IN MODDING:

Quote:
Originally Posted by maerean_m View Post
Here are some basic steps to start with the modding (tools):

* do a back-up copy of the data folder. you'll thank me later for this (you'll have a backup to help you undo changes and be able to create a installation kit for your mod using a comparing tool (Beyond Compare etc)).

* configure the game to run in window mode in a resolution smaller than your Windows desktop

* change the main.cfg file in MyDocuments\SH5\data\cfg:


* there are several types of editors for SH5:
** standalone (Mission Editor and GoblinEditor, the descendant of Kashmir) are executables placed in the same folder as sh5.exe. You use the editor to edit data, close it and then start the game to test the changes. Closing the editor is very important because it frees important system resources that will, otherwise, be locked and the game may crash because there's not enough memory (RAM or video).
** used while the game is running so you can see the changes in real-time (terrain editors, python scripts manager, menu style sheets)
** using the game engine but not the game itself (the Menu Editor). This is the way it has been done for SH3 and while it has its advantages, it also has its drawbacks (but there's never enough time to fix this).

* with the game running (but NOT while there's a loading screen), right click on the window's title bar to show this menu:

With the Windows versions that have the standard task bar, this menu also appears if you right-click the application's button in the task-bar. That's not true for Windows 7 since it has a new API for the task-bar buttons.

* although it doesn't say in the menu, the terrain editors also require the game to be "in patrol mode". As a basic rule, you can't edit something that has not yet been instantiated. So this is also true, you can start the script manager to edit the python scripts while you're in main menu but you can't change the script for the default HUD (since, duh, it's not yet instantiated). You have to be in patrol and the HUD to be running to be able to apply changes you do it (yes, it's something like Edit & Continue).

* the GoblinEditor is used to attach and edit behaviors (controllers) to the structure of every 3D object in the game. This is the way the GDS engine works (the one in the kernel.dll). There are literally hundreds of controller types in the game and can be edited visually using a property grid.

* [very important]setting up the GoblinEditor means typing the folder where the sh5.exe is located in the ActorsDirectory property in the Tools\Options window (e.g. K:\Games\Silent Hunter 5). The actors are the .act files in the SilentHunter5 folder and are the ones holding the code for all the controllers.

* This is a use case for the GoblinEditor:
** Open a GR2 file (the one with the 3D geometry, G stands for the Granny engine). You'll see the object being rendered and its structure in the GDS Scene Tree panel.
** Merge the files containing the controllers (.sim, .dat, .chr, .cam, .val, .zon). The sim file contains the controllers for the simulation (see, SH5 is a simulation after all ) and the cam file contains the controllers for the camera parameters.
** let's try it. open data\Objects\Guns\Deck_Gun_GE88mm.GR2 and merge the Deck_Gun_GE88mm.sim and Deck_Gun_GE88mm.cam files. Open the Controller Editor (Ctrl+E) in the Tools menu. A window is displayed (you may have to resize it the first time) and click on the StationController to see the properties for the controller handling the situation when the player uses the deck gun as a station. The actual gameplay associated with the gun is handled by the wpn_Cannon controller.

* Now, a little about the folder structure. You can find GR2 files in many folders (Library, Objects, Submarine, Sea etc). The Library folder is special (hard-coded) and contains the objects that are always needed (e.g. torpedoes_g7a-e.gr2). All the other folders contain files loaded on-demand (e.g. there's a text configuration file indicating that the file is to be loaded).


Consider this the first episode of the series. There will be others following this one.


It strikes me that this info could be also stored in a SH5 wiki.



This is a generic thread, so post your questions here so all the modders can read the answer. I think this is much better than answering on every mod's forum thread.

Mihai
Quote:
Originally Posted by maerean_m View Post
This is from a technical PM. I encourage you ask your questions on the forum, rather than on PMs because
1. the others will also see the answer and may benefit from it
2. it's a better use of my time, because people have similar questions so I don't have to write the same answer multiple times. Plus I may forget some details on the 3rd time I answer the same question. And I can answer more distinct questions in the same time rather than answering the same questions over and over.
3. I have subscribed to this thread so I receive emails when you ask something. So it's just like a PM, only better

Hello

* Please stop changing the ini files by hand. That was the only way to create UI mods for SH4. Now we have given you the Menu Editor. Use it.
* the colors use the RGBA format
* matflags: 1 for transparency and 8 for bilinear filtering
* MatFlags=0x29 is 0x20 + 0x08 + 0x01. I don't know by heart what 0x20 means, i'll have to look into the DirectX headers. But it's not a value you normally encounter.
* menus use a system that resembles the CSS used in web development, e.g. you create a set of appearance properties (specific for texts, buttons, listboxes) and apply that style for any number of menu items. So StatesColors should usualy be set by means of style sheets (from the Menu Editor). As a bonus, style sheets can be changes while the game is running (very useful for list-boxes that only get filled with content at run-time, e.g. the Combat Log in the bottom right corner of the HUD). The style sheets themselves are stored in the Silent Hunter 5\data\Menu\StyleSheets\German.shss file.
* the FocusableMenuItem (button, check box, radio button) has 4 states: Disabled, Normal, Mouse Over, Pressed. So those are the colors for the 4 states.
* Drag, BmpState, NeedFocus, SelOne - were used in SH3 and are now obsolete (and hard-coded). The SH5 way is to use python scripting to implement your design (good examples can be found in scripts we wrote for the HUD, Navigation map and the Character dialog (the big .py files in data\Scripts\Menu)).

* While on patrol, open the script manager and click on a script from the tree on the left. Do your changes to the script code you see on the right and press the ApplyChanges button. That's it.
* There's a button called ViewGlobals to let you see the variables that the script is working with and see the exposed properties for those variables.
* The script manager has some useful features like text-auto-complete, jump-to-function-definition, find-text and go-to-line-number.
* Also, there's a tab called Class Definitions to see all the classes exported to the python scripts containing the inheritance tree, description, nested types, properties, methods and events.

Mihai



GENERAL OVERVIEW:



as elanaiba wrote in another thread, take a look on these screens:

Quote:


Will game play be controlled by the same type of layers as in SH3? Will there be a mission editor included in the SH5 package?

The mission editor for Silent Hunter 5 was totally redone. It has many new features including layers, projects support, much better ship group customization, etc. Here are some screenshots from the editor:

















#


---

LINKS TO HOWTOS:

TERRAIN EDITOR:
http://www.subsim.com/radioroom/showthread.php?t=162810

ENVIROMENT:
http://www.subsim.com/radioroom/showthread.php?t=163370

ANIMATIONS:
http://www.subsim.com/radioroom/showthread.php?t=163299

INTERFACE DESIGN
http://www.subsim.com/radioroom/showthread.php?t=163118
http://www.subsim.com/radioroom/showthread.php?t=163268

MISSION EDITOR:
http://www.subsim.com/radioroom/showthread.php?t=163364

---

thread is generic...please check back...
__________________



Last edited by urfisch; 03-09-10 at 03:48 AM. Reason: thread title prefix correction
urfisch is offline   Reply With Quote
Old 03-01-10, 09:55 AM   #2
Drifter
Frogman
 
Join Date: Mar 2010
Posts: 308
Downloads: 75
Uploads: 0
Default

Why is this thread so dead? I mean, does no one here realize the potential for the ability to now script in SH5?!

This is BIG news. Wake up people!
Drifter is offline   Reply With Quote
Old 03-01-10, 10:45 AM   #3
Kretschmer the IV
Navy Dude
 
Join Date: Oct 2008
Location: Croatia
Posts: 173
Downloads: 72
Uploads: 0
Default

I see ultragiantenormous genial mods comming
Kretschmer the IV is offline   Reply With Quote
Old 03-01-10, 10:48 AM   #4
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

I found everything but the script manager. where is it?

Last edited by gutted; 03-01-10 at 03:35 PM.
gutted is offline   Reply With Quote
Old 03-01-10, 10:53 AM   #5
Drifter
Frogman
 
Join Date: Mar 2010
Posts: 308
Downloads: 75
Uploads: 0
Default

Quote:
Originally Posted by gutted View Post
I found everything but the script manager. where is it?
I wish I knew. But I don't even have the game yet. Maybe someone else can answer.
Drifter is offline   Reply With Quote
Old 03-01-10, 01:12 PM   #6
Safe-Keeper
Ocean Warrior
 
Join Date: Dec 2005
Location: Norway
Posts: 3,234
Downloads: 11
Uploads: 0
Default

I'm just about speechless. This is incredible. Terrain editing, script editing, menu editing, campaign editing... there's no end to the things you can do with this.

If only the GWX team had this many tools when they made their supermod. Maybe some or all of it can be ported?

Quote:
Originally Posted by Mission Editor 2 - Total_Germany
http://img696.imageshack.us/img696/9678/missioneditor.png
What do these "nodes" do? Do they have to do with traffic or someething?
Safe-Keeper is offline   Reply With Quote
Old 03-01-10, 03:16 PM   #7
Hartmann
Sea Lord
 
Join Date: Mar 2005
Location: Grid CH 26, Spain ,Barcelona
Posts: 1,857
Downloads: 204
Uploads: 0
Default

Well , seems that despite the drawbacks , limitations , and half finished game it´s like a blank board where modders can do everything they want.
__________________
But this ship can't sink!...

She is made of iron, sir. I assure you, she can. and she will. It is a mathematical certainty.

Strength and honor
Hartmann is offline   Reply With Quote
Old 03-01-10, 03:22 PM   #8
CCIP
Navy Seal
 
Join Date: Apr 2005
Location: Waterloo, Canada
Posts: 8,700
Downloads: 29
Uploads: 2


Default

Quote:
Originally Posted by Safe-Keeper View Post
What do these "nodes" do? Do they have to do with traffic or someething?
My first hunch is that these are traffic lanes where ships/convoys may choose alternate routes. I.e. shipping routes are possibly less scripted than they were before. I did notice that traffic shows up in a lot more places than I would've expected; I also noticed traffic actually avoiding coasts (not always successfully). I suspect that the traffic scripting has undergone a pretty big overhaul towards the dynamic.
__________________

There are only forty people in the world and five of them are hamburgers.
-Don Van Vliet
(aka Captain Beefheart)
CCIP is offline   Reply With Quote
Old 03-01-10, 03:36 PM   #9
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

Quote:
Originally Posted by gutted View Post
I found everything but the script manager. where is it?


found it!

with the modding controls enabled, you have to right click the Slient Hunter 5 Taskbar icon and select it from the menu... as was shown in the screenshots further up.

Took me abit to realize that's what it was showing.
gutted is offline   Reply With Quote
Old 03-01-10, 05:02 PM   #10
jmr
Commander
 
Join Date: Sep 2004
Posts: 462
Downloads: 62
Uploads: 0
Default

I wonder how many of our talented modders will buy SHV though. How many of them are refusing to buy the game solely because of the DRM?
jmr is offline   Reply With Quote
Old 03-01-10, 05:10 PM   #11
Safe-Keeper
Ocean Warrior
 
Join Date: Dec 2005
Location: Norway
Posts: 3,234
Downloads: 11
Uploads: 0
Default

Quote:
My first hunch is that these are traffic lanes where ships/convoys may choose alternate routes. I.e. shipping routes are possibly less scripted than they were before. I did notice that traffic shows up in a lot more places than I would've expected; I also noticed traffic actually avoiding coasts (not always successfully). I suspect that the traffic scripting has undergone a pretty big overhaul towards the dynamic.
I'm guessing traffic routes, too, they definitely seem to go in and out of ports and follow shipping lanes.

My hypothesis is that it's a way to increase performance by not making all ships plot their own routes. Instead of the game tracking I don't know how many different routes, now all you have to do is tell a ship to, for example, patrol between nodes X, Y and Z, and it will stick in that area. Hopefully you can add some randomness into the game, too ("go within 30nm of Node 60, then transit to Node 100 or within 2nm of Node 62, then...").
S
I see there is a "StateAbandon" and "StateSurrender" in the Script editor, too. So do crews actually abandon ship or surrender now?
Safe-Keeper is offline   Reply With Quote
Old 03-01-10, 05:16 PM   #12
karamazovnew
The Old Man
 
Join Date: Mar 2009
Location: Bucharest, Romania
Posts: 1,403
Downloads: 151
Uploads: 0


Default

Quote:
Originally Posted by Hartmann View Post
Well , seems that despite the drawbacks , limitations , and half finished game it´s like a blank board where modders can do everything they want.
That HAS to be the worst thing a dev would like to hear. Let's not go overboard just yet. There are a few things missing but I wouldn't call the game a "blank board".
karamazovnew is offline   Reply With Quote
Old 03-01-10, 05:40 PM   #13
etheberge
Watch Officer
 
Join Date: Nov 2007
Location: Montreal, QC
Posts: 345
Downloads: 604
Uploads: 10
Default

Wow these tools are very promising!

Now if only I could figure out how to access them :-)

I did the changes in main.cfg but when I right click on the SHV taskbar when it's running I only see the standard window controls (restore, maximize, that sort of thing). Running Windows7 here.
__________________

11 War Patrols / 56 ships sunk or damaged for 212,022 tons
Zero casualties throughout the war
Scuttled on 8 May, 1945 in Sonderburg Bay, after German surrender
etheberge is offline   Reply With Quote
Old 03-01-10, 05:54 PM   #14
R-T-B
Sparky
 
Join Date: Aug 2008
Posts: 150
Downloads: 324
Uploads: 5


Default

Quote:
Originally Posted by karamazovnew View Post
That HAS to be the worst thing a dev would like to hear. Let's not go overboard just yet. There are a few things missing but I wouldn't call the game a "blank board".
True that. I'm a very talented programme/scripter, but suck and at artwork and models. Guess which part Ubisoft probably did ok at?
R-T-B is offline   Reply With Quote
Old 03-01-10, 06:11 PM   #15
Sailor Steve
Eternal Patrol
 
Sailor Steve's Avatar
 
Join Date: Nov 2002
Location: High in the mountains of Utah
Posts: 50,369
Downloads: 745
Uploads: 249


Default

Quote:
Originally Posted by Drifter View Post
Why is this thread so dead? I mean, does no one here realize the potential for the ability to now script in SH5?!

This is BIG news. Wake up people!
The first post was made at 0342 hours, my time, which is central US. That would be 2242 in London, where people are going to bed.

Your post was made at 0755 my time, so people here were just getting up. The reason this thread was so dead was because everyone was asleep.
__________________
“Never do anything you can't take back.”
—Rocky Russo
Sailor Steve is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 05:38 PM.


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