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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-14-10, 08:06 AM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Freelanca View Post
Just had to say that the automation feature that you added is great. I have started to play with making my own and find it very useful. Now all it needs is the addition of writing scripts in game
I documented the TDW_Automation.SHA file with the current functions available to Automation and the new functions I have created for it. I didn't document how to make your own scripts or own commands though. Making your own scripts is probably pretty obvious from viewing the automation files but making new commands is not. The real power of Automation is the ability to make new commands - these new commands are script code and thus ANYTHING that one can do in a script can be done in Automation.
I also didn't document that multiple scripts can be running in Automation at the same time.
An Automation command in a script is defined as so:

command,1,2,3,4,5,6,t

where:

command = name of command
1 = parameter 1 passed to the command (has to be able to convert to float value)
2 = parameter 2 passed to the command (has to be able to convert to float value)
3 = parameter 3 passed to the command
4 = parameter 4 passed to the command
5 = parameter 5 passed to the command
6 = number of times to execute. If set to 0 then there's no limit. I'll explain this one more.
t = time in seconds to wait after command is given before next command is given. If 0 then the wait time will be 0.1 second. If command is the last command in the script then the wait time is ignored (it's 0)

Automation contains a Loop command that does what it sounds like - loop through the section of code defined by it x times. The times to execute parameter can control how many times a certain command is executed in this looping cycle. Maybe you want a command only given once during the loop cycle. i.e.:

[AS]
Test_Loop
[CATEGORY]
Testing
[COMMANDS]
Set_Time_Compression,1,0,0,0,0,1,0 ; set time compression to 1 and wait 1 second before next command
Rise_whole_obs_periscope,0,0,0,0,0,0,6 ; fully raise the obs scope. Wait 6 seconds before issuing next command
Activate_Scope_Station,1,0,0,0,0,0,0 ; activate the obs scope
Sweep_Scope,1,0,360,120.0,0,0,1 ; sweep the scope from 0 to 360 in 120 seconds. Next command will be issued 1 second after sweep is finished
Lower_whole_obs_periscope,0,0,0,0,0,0,0 ; fully lower the obs scope
Leave_Scope_Station,1,0,0,0,0,0,0 ; leave the obs scope
Wait,0,0,0,0,0,0,600 ; wait 10 mins
Loop,5,0,0,0,0,0,0 ; loop through everything 5 times
[COMMANDS_END]

this entire script will loop 5 times BUT the command Set_Time_Compression will only be given the first time through the loop. You can also have a Loop inside a Loop for some interesting effects

Once you understand Automation and the power it brings to the game you'll see the uses for it. And Automation was needed to lay the foundation for my next big idea.....

Last edited by TheDarkWraith; 08-14-10 at 08:27 AM.
TheDarkWraith is offline   Reply With Quote
 

Tags
dbrn, favorite, new ui


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 12:54 AM.


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