Jump to content
Sign in to follow this  
SWIFT88

Prevent Missiles from Firing (Striker CVRT)

Recommended Posts

Sorry for the Brief Discussion name....

im basically compiling together a Vehicle which has a missile launcher on the rear. However it has two fixed positions (Up or Down).

Up, the missiles can be fired, and down it would blow the vehicle up! So you see why i want a disable script to prevent users from Destroying their own vehicle, or for AI to do it! However i considered that the AI would find it hard to work with, so maybe having the flap up already and an option for players to lower it.

Striker Info

Share this post


Link to post
Share on other sites

Think your answer is "B-52 Bombbay doors"

With my B-52 it detects the AI's combat status and if they become "alert" then the Bombbay doors are opens and the weapons are "loaded". Once no enmy are spoted and their alert status drops, the weapons are unloaded and and doors closed.

Sorry, cant post the script / config snippets cuz im at work. Either De-Pbo the B-52 or wait til I return home tomorrow.

Share this post


Link to post
Share on other sites

Have a look at the Bradleys made by COMBAT!, they have a script that prevents you from firing the TOWs when the launcher's folded (when the vehicle is moving or the player closes it manually). Seems the ideal one to base a script for the Striker on.

Share this post


Link to post
Share on other sites

Swiftly my old chinar .

Use some hardcoded anims rather than scripts .

Setup the launcher as either gunner or com hatch to get the up and down action , just reversing the values so when its up its action time .

So the effect you would get if you set the vehicle to safe , the commander pops up out of his hatch and the launchers retract .

set to danger and launcher pops up .

Share this post


Link to post
Share on other sites

intresting wink_o.gif but ive got a Gunner, Commander, Driver... unless i create my own turnout class (How could i do that)

Share this post


Link to post
Share on other sites

As mentioned.

CONFIG BITS

Quote[/b] ] class Animations

{

class LeftBombbay

{

type="rotation";

animPeriod=2;

selection="right bombbay";

axis="axis right bbay";

angle0=0

angle1=1.3;

};

class RightBombbay

{

type="rotation";

animPeriod=2;

selection="left bombbay";

axis="axis left bbay";

angle0=0

angle1=-1.3;

};

};

class UserActions

{

class luki1

{

displayName="Open Bomb Bay";

position="gunnerview";

radius=5;

condition="(this animationPhase ""LeftBombbay"" == 0)";

statement="this animate [""LeftBombbay"",1];this animate [""RightBombbay"",1];this addweapon ""B52BombRail""";

};

class luki2

{

displayName="Close Bomb Bay";

position="gunnerview";

radius=5;

condition="(this animationPhase ""LeftBombbay"" == 1)";

statement="this animate [""LeftBombbay"",0];this animate [""RightBombbay"",0];this removeweapon ""B52BombRail""";

};

}

class EventHandlers

{

init = "[_this select 0] exec ""\GNT_B52\autobomb.sqs""";

.............

............

};

SCRIPT CALLED AS "INIT" EVENT

Quote[/b] ]; autobomb.sqs

_plane = _this select 0

; We start with the bay closed

_bayclosed = 1

#MainLoop

; If the plane's dead, we can leave

?(not alive _plane): goto "Exit"

; If the player is in the plane, we don't need to do this

?(player in _plane): goto "Exit"

; Check the behaviour

_behstr = behaviour _plane

; If we're in combat, and the bay is closed, then open it

?(_behstr == "COMBAT" and _bayclosed == 1 ): goto "OpenBombBay"

; If we are not in combat, and the bay is open, close it

?(_behstr != "COMBAT" and _bayclosed == 0 ): goto "CloseBombBay"

; Add a delay, cause this isn't a critical loop

~(1 + random 2)

goto "MainLoop"

#OpenBombBay

_plane animate ["LeftBombbay",1]

_plane animate ["RightBombbay",1]

_plane addweapon "B52BombRail"

_bayclosed = 0

~1

goto "MainLoop"

#CloseBombBay

_plane animate ["LeftBombbay",0]

_plane animate ["RightBombbay",0]

_plane removeweapon "B52BombRail"

_bayclosed = 1

~1

goto "MainLoop"

#Exit

exit

Easy enough to customise to your need, Im guessing you only need 1 animation.

Share this post


Link to post
Share on other sites
Quote[/b] ]; Check the behaviour

_behstr = behaviour _plane

; If we're in combat, and the bay is closed, then open it

?(_behstr == "COMBAT" and _bayclosed == 1 ): goto "OpenBombBay"

; If we are not in combat, and the bay is open, close it

?(_behstr != "COMBAT" and _bayclosed == 0 ): goto "CloseBombBay

i thought to close the bay door it would be

?(_behstr != "SAFE" and _bayclosed == 0 ):

Share this post


Link to post
Share on other sites
Quote[/b] ]; Check the behaviour

_behstr = behaviour _plane

; If we're in combat, and the bay is closed, then open it

?(_behstr == "COMBAT" and _bayclosed == 1 ): goto "OpenBombBay"

; If we are not in combat, and the bay is open, close it

?(_behstr != "COMBAT" and _bayclosed == 0 ): goto "CloseBombBay

i thought to close the bay door it would be

?(_behstr != "SAFE" and _bayclosed == 0 ):

crazy_o.gif ..... You might be reading it wrong

Quote[/b] ]_behstr != "COMBAT"

That is the same as saying;

Quote[/b] ]]_behstr DOES NOT EQUAL "COMBAT"

Share this post


Link to post
Share on other sites

Swift -

The NOT Safe condition is due to the way the AI works: when it's finished in combat, it goes from 'combat' to 'aware' to 'safe'. This can take a long time, especially if there are still enemies on the unit's radar screen.

The only slight problem is that the launcher weapon _cannot_ be re-loaded when it's been stowed, because the weapon has been removed. This is a bit of a bummer, but could be scripted away if you wanted to.

Share this post


Link to post
Share on other sites

i've used similiar scripts for the snatches swift - prevent the driver from using the 'manual fire' option when there's no gunner and firing from an apparently invisible weapon whistle.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×