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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 04-27-07, 05:30 AM   #1
Engel
Watch
 
Join Date: Aug 2006
Location: Germany
Posts: 25
Downloads: 1
Uploads: 0
Default [REL] Tutorial: How to change buttons

Hi..my first Tutorial...be nice okay?
(Moderator: Please correct my bad english..thanks)


Basics:
I wanted to add some buttons to my Attack Periscope, so I took Ducimus´excellent documentation of FTT and fired up \Data\Menu\cfg\OrdersBar.cfg .




As you can see, [Station3] is the third Register with the small Pericsope Icon on it. So if you want to edit your attack Periscope Button line, you have to do it in [Station3].

The Buttons:

I added the "goto attack Map" Button as Button 1 next to my "goto attack Periscope", "Toggle Silent Running" as Button 11 and "Crash-dive" as Button 12.
In the \Data\Menu\cfg\OrdersBar.cfg are the all the buttons for every Station defined. Now scroll down to [Station3].
Code:
[Station3]
Name=5621
Tooltip=5621
CommandWhenActivated=Periscope_camera
IconIndex=3

Button1Type=Checkbox
Button1CommandWhenClicked=Attack_2D_map
Button1CommandToCheckIfIsChecked=Is_Attack_2D_map_station_Active
Button1IconRowColumn=2,1
Button1Tooltip=5613

Button2Type=Checkbox
Button2CommandWhenClicked=Periscope_camera
Button2CommandToCheckIfIsChecked=Is_AttackPeriscope_camera_station_Active
Button2IconRowColumn=3,1
Button2Tooltip=5622

Button3Type=Checkbox
Button3CommandWhenClicked=Toggle_RiseLower_whole_periscope
Button3CommandToCheckIfIsChecked=Is_AttackPeriscope_risen_at_all
Button3IconRowColumn=3,3
Button3Tooltip=5624

Button4Type=Checkbox
Button4CommandWhenClicked=Obs_periscope_camera
Button4CommandToCheckIfIsChecked=Is_ObservationPeriscope_camera_station_Active
Button4IconRowColumn=3,2
Button4Tooltip=5623

Button5Type=Checkbox
Button5CommandWhenClicked=Toggle_RiseLower_whole_obs_periscope
Button5CommandToCheckIfIsChecked=Is_ObservationPeriscope_risen_at_all
Button5IconRowColumn=3,7
Button5Tooltip=5626

Button6Command=Periscope_depth
Button6IconRowColumn=1,9
Button6Tooltip=5859

Button7Command=Recognition_manual
Button7CommandToCheckIfIsEnabled=Is_AnyPeriscope_camera_station_Active
Button7IconRowColumn=3,8
Button7Tooltip=5629

Button8Type=Checkbox
Button8CommandWhenClicked=Toggle_Activate_Clock
Button8CommandToCheckIfIsChecked=Is_Clock_Active
Button8IconRowColumn=3,9
Button8Tooltip=5630

Button9Command=WP_Take_photo
Button9CommandToCheckIfIsEnabled=Is_TakePhoto_Available;Is_AnyPeriscope_camera_station_Active
Button9IconRowColumn=3,10
Button9Tooltip=5631

Button10Command=WP_Identify_target
Button10IconRowColumn=3,11
Button10Tooltip=ID Target

Button11Type=Checkbox
Button11CommandWhenClicked=Toggle_silent_running
Button11CommandToCheckIfIsChecked=Is_Silent_mode_Active
Button11CommandToCheckIfIsEnabled=Is_Underwater
Button11IconRowColumn=1,9
Button11Tooltip=5610

Button12Command=Crash_dive
Button12IconRowColumn=1,2
Button12Tooltip=5602
The code consits of:
Button[number]: the number in the row. 1 for the first and so on
Type=Checkbox: Its a toggle. Like "goto attack-map". The Button is pressed and locked.
Button[number]Command= A Command from Data\cfg\Commands.cfg

Checks:
Commands that return a boolean value (enabled and checked) can be negated by adding a ! sign before the actual command. Like in:
Code:
 Button8CommandWhenClicked=Toggle_Propulsion_Recharging
Button8CommandToCheckIfIsChecked=Is_Propulsion_Recharging_Active
Button8CommandToCheckIfIsEnabled=!Is_Underwater
If you click the "Stop Recharging Batteries" Button it Checks if
a: Is it recharging at all?
b: is the Sub NOT under water. (see the "!")

Add a Button:

To add the "goto attack Map" in your Attack Periscope Button row, just add
Code:
Button1Type=Checkbox
Button1CommandWhenClicked=Attack_2D_map
Button1CommandToCheckIfIsChecked=Is_Attack_2D_map_station_Active
Button1IconRowColumn=2,1
Button1Tooltip=5613
to your [Station3]. To add a Icon, open \Data\Menu\Gui\Layout\HUD.tga. Here are all the Icons for the Buttons in the Top right Corner. The Button1IconRowColumn=2,1 refers to these Icons. First Number is the Row upper to lower (1 for the first and so on), the second number is the Icon left to right (1 for the first and so on). If you dont assign a Icon, a blank button will be displayed.
To add a Tooltip, just enter a text behind: Button[Your button number]Tooltip=YOUR TEXT HERE !!!!!

IMPORTANT:

You have to renumber your Button[number] (all of them) to reflect the position in your buttons Row. Button1...... for the first, Button2..... for the second and so on.

Disclaimer:
I run a 2048x1024 resolution ingame which means I have more space to add buttons. If you run a lower ingame resolution.....dunno what happens.

Good Luck.
Me, out

€redits: To Ducimus for his great Mod and very good Documentation !!

Last edited by Engel; 04-27-07 at 09:51 AM.
Engel is offline   Reply With Quote
 


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:02 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.