SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [REL] Patrol Routine Scripts (https://www.subsim.com/radioroom/showthread.php?t=174382)

Trevally. 01-23-11 06:04 AM

Quote:

Originally Posted by dcb (Post 1580242)
As I don't know very well how scripts are working, I'm not sure if what I have in mind is possible, but I'll ask anyway:

I'm thinking about an automated behavior that will initiate emergency dive and evasive maneuvers as soon as a plane is spotted. IRL, this was the job of the watch crew, and not that of the captain (he might have been asleep, or eating, or whatever). Relaying the 'plane spotted' message to the skipper and waiting for him to order the emergency dive would have wasted valuable seconds, so it was up to the watch crew to ring the alarm.

Can scripts replicate this behavior, so that the AI takes evasive maneuvers on its own?

See this thread here http://www.subsim.com/radioroom/showthread.php?t=174400

For now it can't run when a plane is spotted. You still need to run the script.

TDW has however posted notes in the automation txt that commands we have in the tutorial files will be added to automation.
When this happen - the script you discribe will then be possible:up:

Akula4745 01-23-11 08:27 AM

Quote:

Originally Posted by Trevally. (Post 1580296)
For now it can't run when a plane is spotted. You still need to run the script.

TDW has however posted notes in the automation txt that commands we have in the tutorial files will be added to automation.
When this happen - the script you discribe will then be possible:up:

Now that sounds promising!!

Trevally. 01-23-11 08:37 AM

This is the sweep cammand from automation:-

Quote:

; Sweep_Scope,x,y,a,b,c,0,t - sweep the scope from a start of y degrees to an end of a degrees. Time to sweep from y to a determined by b. Next command will be issued after time t (time t doesn't start until sweeping complete). x = the scope station number (0=attack, 1=obs, 2=UZO). c is a decimal number representing the bits set for the following options (use windows calc to input binary number then convert to decimal):
; this function will wait for scope station to be visible (will wait for 15 seconds and if not visible then a skip command will be issued)
; bit 0 = lock the contact on contact spotted (if bit 2,3,4, or 5 isn't set then contact will be immediately unlocked)
; bit 1 = set current heading for contact on contact spotted
; bit 2 = stop sweep on contact spotted
; bit 3 = stop sweep and follow target on contact spotted
; bit 4 = pause sweep on contact spotted
; bit 5 = pause sweep and follow target on contact spotted
; bit 6 = pause game (and either also pause sweep) on contact spotted
; bit 7 = abort script on contact spotted
; bit 8 = inform user that contact was detected
If this could be used without having to be at the station - it could be used to continuously to fix the "my watch crew are blind" problem.

Also if this could be added :-

Quote:

;Operation|a|b|c|d|e|f - performs operation, a, on b and c. d, if used, is a valid Label command or variable/pointer to a label command. a can be a variable or pointer (needs to be enclosed in <>). b, c and d, if used, can be variables or pointers and needs to be enclosed in <<>> or specify None.
; if b is None then operand 1 is the value retrieved from g_TR1 else operand 1 is the value retrieved for b (if value retrieved is a pointer it will be dereferenced)
; if c is a literal value (i.e. 5 or 7.9) then it must have a type declarer following it. Specify u for unsigned integer, i for integer, f for float, and nothing for strings
; if a is + or - then e defines the dial type: 0 = not a dial, 1 = a dial whose values are -180 to 180, 2 = a dial whose values are 0 to 360
Then all sorts of things could be done.:up:

dcb 01-23-11 01:21 PM

Quote:

Originally Posted by Trevally. (Post 1580296)
See this thread here http://www.subsim.com/radioroom/showthread.php?t=174400

For now it can't run when a plane is spotted. You still need to run the script.

TDW has however posted notes in the automation txt that commands we have in the tutorial files will be added to automation.
When this happen - the script you discribe will then be possible:up:


Thank you for your answer. I took the time and read the thread you mentioned, and found an idea that looks promising, at least to me. This is one of the posts by TDW in the thread:

Yes the script can either pause or pause the game on contact detected.

If a script can do something like this on contact detected, then imagine a plane evasion script activated at the beginning of the patrol, which stays "silent" until the plane is detected, then runs the series of commands. It's like some sort of "sleeping script" that only activates itself when a certain condition (plane detected) is met. After the evasion maneuvers are completed, the script ends and it is up to the player to reactivate it again when he resurfaces.Is something like this possible? Unfortunately, I know nothing about Python and working with scripts, so here I am bothering you and other people who know.:D

Trevally. 01-23-11 01:37 PM

For this to work the sweep scope (uzo) would need to work when not at station. I don't know if this is possible.

When TDW added the message feature he scanned a radius around the boat for contacts and send a message etc.
If this same command could be introduced into automation, it could then be used to set conditions.

It would need to be able to detect height so as to determine ship or aeroplane. I know detecting speed is not possible - so height:06:

If all this could be done it would go a long way to getting better info from your crew. Some scripts could be set to take action and others could just flash up a message for you to take action.

Paco 09-10-12 02:24 PM

Hello,

are these scripts usable with New UI 7.x.x? Or are they outdated, I'm not shure.:hmmm:

Paco.

TheDarkWraith 09-10-12 10:45 PM

Quote:

Originally Posted by Paco (Post 1932517)
Hello,

are these scripts usable with New UI 7.x.x? Or are they outdated, I'm not shure.:hmmm:

Paco.

Yes they are usable. My Automation class hasn't changed for many, many versions now :up:

Paco 09-11-12 01:08 AM

Quote:

Originally Posted by TheDarkWraith (Post 1932647)
Yes they are usable. My Automation class hasn't changed for many, many versions now :up:

Thanks! :up:

Shmal_ 02-25-16 03:06 PM

Who ever tryed to remake it for Magui interface mod?


All times are GMT -5. The time now is 11:53 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.