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 08-05-10, 11:40 AM   #1
Tectronus
Watch
 
Join Date: Mar 2006
Posts: 24
Downloads: 37
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Automation works This is going to open up a whole slew of possibilities.....I've made it so that you can define multiple scripts. All these scripts reside in a single file and are read in at game start. You will be able to select the script you want to use during the game. You'll have options to start, stop, and pause the script. You can even change scripts on the fly (say you have one running and you want to start another one now - done!).
I see the following possibilities for this:
- custom evasive maneuver scripts
- custom navigation scripts
- scripts to automate 'daily' tasks during long distance travels (run on surface 1 hr, dive, all stop, listen for sound contacts, ahead standard, surface, repeat)

There's really endless possibilities for this

I'm going to add the teleport commands as commands available to the scripts. This will allow you to dive when surfaced (teleport to radio or hydrophone).

The script currently running is stopped when you press any key. Once a script is stopped and you want to start it again it will start from the beginning. Pause can be used to stop a script midstream and then restart where it was.

This is awesome
This is beond awesome TDW.... Good news.. Great work!
Tectronus is offline   Reply With Quote
Old 08-05-10, 11:56 AM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Tectronus View Post
This is beond awesome TDW.... Good news.. Great work!
Automation just made a turn to being even more powerful. Anything you can do in a script, and I mean anything, you can do in a custom command. You define a custom command like so:

# a TC command
class AutomationTCCommand( TDWAutomation.AutomationScriptInFile.BaseAutomatio nCommandUndefined ):
def Initialize( self ):
self.complete = True
def Execute( self ):
Menu.TimeCompression = self.param1
return self.complete

then your custom command has to be added to the undefined commands so Automation will recognize it:

# these are commands either made by user or not defined in commands.cfg
# these commands will use the BaseAutomationCommandUndefined class
#
undefinedcommands = [
[ "Set_Time_Compression", AutomationTCCommand ]
#,[ "Loop", AutomationLoopCommand ]
]

Once defined and 'registered' with undefinedcommands you are free to use those commands in your automation script!

Now those that are unfamiliar with programming and classes will not see the great power I have given here. What I've done is allowed you all to extend the commands Automation 'knows' and the commands in the game by defining custom commands. These custom commands can only be used currently in Automation but there's no reason they couldn't be used outside of it also (with some supporting code).

Last edited by TheDarkWraith; 08-05-10 at 12:18 PM.
TheDarkWraith is offline   Reply With Quote
Reply

Tags
dbrn, favorite, new ui

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 09:27 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.