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

Get ready for a whole new level of realism!
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-23-10, 04:42 PM   #1
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 257
Uploads: 30
Default [TEC] Adding Items in the Menu Editor Tutorial

Hi I have been trying for the last few weeks to get my head around using the Editor and scripting to create useable object ingame for Modding.
I was getting nowhere fast till ThedarkWraith stepped in and offered me his help. I have used his expertise advice to create a Tutorial on getting started with Modding for Silent Hunter 5 via the use of The Built in Menu Editor, editing of cfg files and the generation of script files.

Most of the work here is from TheDarkWraith checking and correcting the work I was doing to learn these steps.
I have decided to do up what I've learned so far in the hope it well help others that were in the same situation as me (Banging there heads and getting nowhere fast).

First This is available to download in PDF format here: The PDF version includes some notes on top of Pics to show whats going on.
(Not in the online version)
Also the files that were created in this tutorial are availabe here also:

Now then on to the Tutorial:

Adding Dial’s via the Menu Editor

Adding a single dial is a very simple evolution. If you want to teach yourself how do this:

using the Menu Editor: We want to add the heading/rudder dial to PageTDC.

In Page layout find the Heading group (it's under Group feedback)

Now copy its entire tree over to PageTDC. ( You can right click on Heading and select Copy then right click on Page TDC and select Paste.)
Now when I say the entire tree I'm talking about its anchor group. What denotes an anchor group? The big 'G' in the box. For heading it's 'Heading'. Now if you just copy over heading and think you got a dial you are wrong.
The 'whole' dial consists of 'Heading' - a Group, 'Rudder' - a Group, 'Toggle Rudder Heading Around' - a button, and 'Toggle Rudder Heading' - a button.
How do I know this? Two ways. One is that when I click on each one I get a yellow outline box on the editor that shows me graphically that it's part of the whole dial. Two, as I click on each one in the menu editor and I look in the zone section I see that the anchor refers to some part of the dial (it doesn't have to but doing so keeps the coherency of the object). You'll notice that the button 'Toggle Rudder Heading' anchor is 'Bkgr'.

You should end up with 2 Groups Rudder and Heading and 2 Buttons (Bt) Toggle Rudder Heading and Toggle Rudder Heading Around.
Now after you've copied all those items over to PageTDC you need to check their anchors. You'll notice that 'Toggle Rudder Heading' anchor is set to Null now. Why? Well before it referenced an item in Page layout but we're now in PageTDC so obviously that page doesn't exist here.

I would set the 'Toggle Rudder Heading' anchor to the object on PageTDC that you want this dial to be anchored to. Best thing to do is set the anchors of all the copied objects to reflect the values of the object you copied from in the other page. After setting all the anchors to the values they should be, moving the 'Toggle Rudder Heading' will cause the whole dial to move with it (if all the anchors are setup to reference one another in the object). If one of the anchors is set to reference some other object then that part won't move when you move 'Toggle Rudder Heading'.

Okay so now we have a new dial on PageTDC. But how do we get the game to update it? That's the easy part. Go back to the page you copied this new dial from. I'll use the Heading/Rudder here as an example. For the game to update a dial it needs 3 pieces of information: the dial, the current value, and the new value. Open up the file \data\Menu\cfg\Dials.cfg.

This is where we define the dials. Do a search for 'CompassFdbk'. This dial, [Dial22] is responsible for updating the 'Heading' dial in Page layout. How do I know this? Easy. Look at the values for CrtVal (current value), NewVal (new value), and Dial.
They start with 3F (0x just means this is a hex value). If we go back to the menu editor and go to Page layout we see that its ID is 3F000000.
If we find the values for CrtVal, NewVal, and Dial on Page layout we see that they reference objects of the dial in question (parts of the Heading dial).

Now if you correlate the CrtVal, NewVal, and Dial to the objects on the screen you can see what is controlling what. After you denote the correlation then add another entry to Dials.cfg at the bottom. Copy the whole entry for [Dial22] to the bottom and give it the next number in the chain (if you're using the stock file the next number will be 75. Now change the CrtVal, NewVal, and Dial IDs on this new entry to reflect the IDs of the dial on PageTDC.

But wait we're not done yet !!!
This dial has two states - Heading and Rudder. We have to create another entry in Dials.cfg. But what is this entry? Well I know that rudder needs to look like the entry [Dial21] (RudderFdbk). So copy the whole entry for [Dial21] to the bottom of Dials.cfg and give it the next number in the chain (would be 76 with stock file).
Now these names - RudderFdbk, SpeedFdbk, etc. can be anything you want to call them for your new dials. Change the IDs of the new dial entry to reflect the object in PageTDC (parts of the Rudder dial).

Don't forget to change the Dials.cfg's top number 'DialsNo=' to one plus the last entry in the chain of dials (its zero based). For our example that line should read 'DialsNo=77'. Save the file.

So far we have only edited 2 files:
Page TDC.ini - (\data\Menu\PagesPage TDC.ini) and Dials.cfg - (\data\Menu\cfg\Dials.cfg).
You can back these up into another folder for use in your own Mod.

Now before we can see our newly placed dial on screen we need a way for the page to tell the TDC to load up. To do that were going to need the help of Scripting.

End of Part 1

Last edited by reaper7; 03-23-10 at 06:00 PM. Reason: Changed Font Colour
reaper7 is offline   Reply With Quote

dials, editor, scripting, tutorial

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 01:44 PM.

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