PDA

View Full Version : Help with disengage script


SquidB
01-29-06, 03:15 PM
Hi,

hope someone can help here.

Is there any way to create a script to change a ai units actions from track to avoid.

Idealy triggered by active sonar detection.

What im trying to create is a sub that leaves the area after receiving a sonar lashing.

thnx

OKO
01-29-06, 03:33 PM
you can force the course/speed/depth of the sub once he have received a ping.but you need to chose a specific direction, you can't change the doctrine to "avoid" during the game.

=>

trigger : subavoidping

event/automatic

use doctrine langage :
detect platform1 by sub with active intercept
detect platform2 by sub with active intercept
....
(all the platforms that could afraid the sub during the scenario)

action : run script subdetectactive

script : subdetectactive

set course of sub to 270 for 8000 seconds
set depth of sub to 850f for 8000 seconds
set speed of sub to 12 for 8000 seconds


but for this example, you have to know were your sub could escape.

SquidB
01-29-06, 04:09 PM
Thanks for the tip oko, its difficult to determine the excact location of the sub when it gets the ping, but with your advice i think i can come up with something useful.

thanks again :up:

Fish
01-29-06, 04:45 PM
you can force the course/speed/depth of the sub once he have received a ping.but you need to chose a specific direction, you can't change the doctrine to "avoid" during the game.

=>

trigger : subavoidping

event/automatic

use doctrine langage :
detect platform1 by sub with active intercept
detect platform2 by sub with active intercept
....
(all the platforms that could afraid the sub during the scenario)

action : run script subdetectactive

script : subdetectactive

set course of sub to 270 for 8000 seconds
set depth of sub to 850f for 8000 seconds
set speed of sub to 12 for 8000 seconds


but for this example, you have to know were your sub could escape.

I think the sub must avoid after receiving a active ping, not giving a active ping.

OKO
01-29-06, 06:04 PM
I think the sub must avoid after receiving a active ping, not giving a active ping.

that's exactly the purpose, Fish :P

on this example, the sub flee on ping reception
Anyway I don't know how to force a sub to ping :shifty:

for your problem, SquidB, if only one platform is supposed to be avoided, using target mode "avoid" on a WPs work nicely.

SquidB
01-29-06, 06:14 PM
Ok heres excatly what im trying to do.

I have a 688 on a track tactic, once he is detected by the sub he is tracking, it sends an active ping to scare him off.

so i want the 688 to change from tracking to getting out of the area.

I think that your first suggestion was nearest the mark...athough i cant get it to work with the active intercept command.

Am now trying with the detected by the tracking sub on active.

OKO
01-29-06, 06:18 PM
objection : it's impossible to force a sub to ping :cry:
so you couldn't do this

OKO
01-29-06, 06:22 PM
but for the your scenario, without active ping emitted from 688i =>

remember before the 688i will try to avoid the other sub ... he have to detect him
so there is no problem at all to use "avoid" target mode
as soon as he will detect him he will avoid, exactly what you want.

except the emission of the active ping
just impossible ... for AI platform of course

SquidB
01-29-06, 06:41 PM
Lol this is getting complicated.

ok the 688 is tracking an akula. on track tactic. once the akula pings the 688 i want it to disengage. If i chose advoid tactic the 688 wont track the akula (ps the akula is a player sub)

For some reason the 688 wont disengage at all regardless pings...im confused :doh:

LuftWolf
01-30-06, 03:33 PM
Can't you just put a trigger in that says "If Sub 1 detects Sub 2 then [either] Sub 2 SetTactic Avoid Sub 1 [or] Sub 2 Set Course ### Set Speed ## Duration xHrs" ?

Although all my missions are test scenarios, my impression is that you can usually get the platforms to act the way you want without the exact events happening, if you know exactly what you want to occur. :|\

OKO
01-30-06, 03:55 PM
once the akula pings the 688

remember you CAN'T manage to make a sub pinging.
so you description is still not clear : who is the human sub, who is the AI sub ?

If you want a solution, you must give us more details.

OKO
01-30-06, 03:58 PM
Sub 2 SetTactic Avoid Sub 1

unfortunatly, this is not possible on a trigger or a script :shifty:
only with target mode on a WP.

Fish
02-01-06, 08:24 AM
Hi,

hope someone can help here.

Is there any way to create a script to change a ai units actions from track to avoid.

Idealy triggered by active sonar detection.

What im trying to create is a sub that leaves the area after receiving a sonar lashing.

thnx
I found a workable solution, not precisely what you want, but you can go on from there.
One ship is pinging the other, the other ship (supposed to track the first), is reversing course at ones.
The ping is not a elegant one, and not visible on the TBI though. Maybe you could do a better ping. :)

OKO
02-01-06, 11:01 AM
... One ship is pinging the other

how do you do that with AI subs ??
that is the main problem in what SquidB want to do.

Fish
02-01-06, 11:03 AM
Ehhh... :cool:

Fish
02-01-06, 11:19 AM
Oh well, I gave the tracking ship a attached trigger (approach), radius 14 nm. That ship is going sa little faster then the other ship, so in time the trigger fired, and a added soundfile (ping) is sounding.
There is a script causing the first ship to reverse course (set course....).
Nothing special but ok to go on from there.

TLAM Strike
02-01-06, 12:31 PM
You could fake a sub ping. Get a .wav of a ping, and use the 'enter solution' script for both the pinger and the pingie (so they know where each other is) then you can run a trigger that will cause whatever you want after the script runs.

SquidB
02-01-06, 01:45 PM
Thanks guys for all the suggestions

I think that i havent been clear as to what i want to acheive so here goes.

The player controled sub pings the ai sub. the ai subs tactic was set to track, but what i want it to do is swicth to avoid/get the hell out of there.

I dont need the AI sub to ping at all, just turn around and run away from the pinging player sub.

Thanks for bearing with me.

Fish
02-01-06, 03:24 PM
I thought that must be a piece of cake. Made a auto trigger, own ship detect 688(I) (AI) with any, then run script, Set course (AI) to 300 (it comes from there in the map) for duration of .........
Now, what do you think?

Nothing happened, even with the AI sub set to avoid mine.

PS: I pinged the sub, and marked here on NB.

HydroShok
02-01-06, 05:14 PM
I know this happens with sonobuoys but i dont know about sub active sonar.

AI subs will do an about face if they get pinged by a Dicass. By default, with no extra work needed. Depends on tatic, i guess it works with everything except transit. They turn away them from way outside the 6nm range of a buoy. If it stops pinging they carry on with whatever they were doing before.

OKO
02-01-06, 08:51 PM
Thanks guys for all the suggestions

I think that i havent been clear as to what i want to acheive so here goes.

The player controled sub pings the ai sub. the ai subs tactic was set to track, but what i want it to do is swicth to avoid/get the hell out of there.

as I told you sooner in this thread => why going from track to avoid ? (track is to force an AI to follow an ALREADY DETECTED other platform)
There is no need at all to do that.

Why ?
simply because as long as your human sub is NOT detected, even if the AI sub is in avoid, he won't avoid it !

Just a logical process => put the AI in AVOID and NOT track from the mission start.
your sub will avoid ONLY, of course, WHEN he will detect the sub to avoid, and of course NOT before, simply because he doesn't know the other sub is around ... until he knows ... then, ONLY, start to avoid.
You get it ?

in this process, you don't need at all to change the target mode, it's the same from the mission start => avoid.
And this is the only thing to do to make it work.

This doesn't prevent you to use script to make the AI sub attacking other platforms, even if the AI sub is in avoid target mode on the 688i.

So all this thread to tell you : just do one thing => target mode " avoid" 688i
that's all, and it will works as you want.

MaHuJa
02-04-06, 06:43 AM
as I told you sooner in this thread => why going from track to avoid ? (track is to force an AI to follow an ALREADY DETECTED other platform)
There is no need at all to do that.


I thought the point was to have said AI platform detect and follow the human player first - THEN the ping and avoidance.

(What keeps a player from starting the mission with a ping, btw?)


I think however that this is one of the many limitations we do face in the mission editor. The best we can do is use a script to assign it a course which will, in theory, lead it away from the player sub.

I believe the only way to achieve this is to modify the doctrine files - but that's not something I recommend. (It would be anidea to allow us to include a custom doctrine file for some platforms in a mission, overriding the default doctrine. However, then improvements in the 'base' script would not apply to that platform in that mission.)