View Single Post
Old 03-22-10, 10:19 AM   #152
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

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) and copy it's entire tree over to PageTDC. Now when I say the entire tree I'm talking about it's 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'.
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 it's 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 (it's zero based). For our example that line should read 'DialsNo=77'. Save the file.
Are we done yet? Nope. We have a new dial on PageTDC. The game will update it. But the game will not switch it between states - Heading/Rudder. Why? Because the original dial's 'Toggle Rudder Heading' ID is hard coded in the game. The game recognizes 'events' from that ID and responds to them. Your new 'Toggle Rudder Heading' ID means nothing to it. So you have to get creative and create some python code to make it switch states! Where do you place this python code? In PageTDC.py.
TheDarkWraith is offline   Reply With Quote