Jump to content
Sign in to follow this  
russin

Crouch script

Recommended Posts

how to make a Soldier kneel and stay there ?

ive searched and searched and found 1 but it don't work once i kill the guy his dead body keeps gettin back up and down after he dies....

i no ive seen it done before in a mission but im stumped to find it with the mass of missions in my folder crazy_o.gif

thanks...

Share this post


Link to post
Share on other sites

groupname = group this; BEHAVE="COMBAT"; STATUS="UP"; STANCE="crouch"; "_x setbehaviour BEHAVE" foreach units groupname; "_x setunitpos STATUS" foreach units groupname; "_x switchmove STANCE" foreach units groupname;

Share this post


Link to post
Share on other sites

They will stand up once they engage, only way ti stop it is with disable AI move but then they won't move or shoot.

Share this post


Link to post
Share on other sites

Tried this yet?

soldierOne setUnitPos "Down"

EDIT: Ahh never mind, I thought you meant Prone.

Share this post


Link to post
Share on other sites

ive asked this question before but the way it is it's not working good there must be a way crazy_o.gif

Share this post


Link to post
Share on other sites

I don't know, but maybe with

_soldier addEventHandler ["killed",{_this disableAI "MOVE"}] ?

Share this post


Link to post
Share on other sites

ok i got it to work not any of the ways listed above they stay on one knee now and will engage if any need a example mission to see how ive done it id be glad to send them the mission as i suck too explain how it works smile_o.gifcrazy_o.gif

ahhhhhhh im so happy now yippie !!!!

Share this post


Link to post
Share on other sites

You used the "How to" (in the page 5 or 6) i wrote in the Mission Editing FAQ up there.

nice to see that someone made an example mission of it , as it can be easier to understand when seeing it rather than reading it in the FAQ ;)

Share this post


Link to post
Share on other sites
You used the "How to" (in the page 5 or 6) i wrote in the Mission Editing FAQ up there.

nice to see that someone made an example mission of it , as it can be easier to understand when seeing it rather than reading it in the FAQ ;)

well i never did but mabe somehow i got it inavertly haha all i no is that i can finally have guys kneel biggrin_o.gif

Share this post


Link to post
Share on other sites

Yeah but they won't shoot at anyone while crouched. If you script it and add the parameters of dowatch, dotarget and dofire this will fix your problem.

Share this post


Link to post
Share on other sites

Hmm no good so far but heres your crouch script (they still won't shoot)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_grp = _this select 0

({_x setbehaviour "COMBAT"} forEach units _grp);

({_x setcombatmode "RED"} forEach units _grp);

?!(alive _grp):exit

#loop

({_x setunitpos "up"} forEach units _grp);

({_x switchmove "crouch"} forEach units _grp);

({_x dowatch player} forEach units _grp);

({_x dotarget player} forEach units _grp);

~0.15

goto"loop"

Share this post


Link to post
Share on other sites

dammit your right sad_o.gif they won't fire could you edit the mission i made above to work PLEase crazy_o.gif im not that good at it so im not sure how to add what ya wrote sad_o.gif

Share this post


Link to post
Share on other sites

Use this - Execute with [this] Exec "croucher.sqs"

btw if used for an entire group simply put it in the officers initfield.

_grp = _this select 0

({_x setbehaviour "COMBAT"} forEach units _grp);

({_x setcombatmode "RED"} forEach units _grp);

({_x setunitpos "up"} forEach units _grp);

({_x switchmove "crouch"} forEach units _grp);

#start

?!(alive _grp):exit

?(_grp knowsabout player <= 0.49):goto"start"

?(_grp knowsabout player >= 0.5):goto"Fire"

#fire

?!(alive _grp):exit

({_x setbehaviour "COMBAT"} forEach units _grp);

({_x setcombatmode "RED"} forEach units _grp);

({_x setunitpos "up"} forEach units _grp);

({_x switchmove "crouch"} forEach units _grp);

({_x dotarget player} forEach units _grp);

({_x dofire player} forEach units _grp);

~0.2

?!(alive player) || (_grp knowsabout player <=0.49):goto"start"

goto"fire"

Share this post


Link to post
Share on other sites

I think i found the problem in your example mission that prevented the resistance soldier to open fire.

Near them i created a 3 men russian patrol , and the crouched AI just looked at them behind his barrier cover, aiming at them but without firing.

I tried several things , always aiming without firing.

As i wrote that "how to" have the AI to crouch in the mission editing faq, i knew that it worked for me before, so something was wrong but what ?.

Then i removed the barrier.

And the crouched resistance soldier opened fire on sight , crouched.

I added again the barrier to check, and he didnt fired again.

Tada ! that was the problem.

A crouched AI , with this method doesnt seem to be able to open fire (you can notice that he try to aim up sometime) if he is behind some objects used as cover.

I didnt tried all the objects of the editor , maybe there are some that doesnt prevent the crouched guy to fire.

Share this post


Link to post
Share on other sites
I think i found the problem in your example mission that prevented the resistance soldier to open fire.

Near them i created a 3 men russian patrol , and the crouched AI just looked at them behind his barrier cover, aiming at them but without firing.

I tried several things , always aiming without firing.

As i wrote that "how to" have the AI to crouch in the mission editing faq, i knew that it worked for me before, so something was wrong but what ?.

Then i removed the barrier.

And the crouched resistance soldier opened fire on sight , crouched.

I added again the barrier to check, and he didnt fired again.

Tada ! that was the problem.

A crouched AI , with this method doesnt seem to be able to open fire (you can notice that he try to aim up sometime) if he is behind some objects used as cover.

I didnt tried all the objects of the editor , maybe there are some that doesnt prevent the crouched guy to fire.

I do believe that if you set the sandbag's damage to 1 (dead) they will fire over the top of it. I think. wow_o.gif

Gameer

Share this post


Link to post
Share on other sites

you can use the setpos command and bury the sandbags or wall a little bit into the ground, i have done this and it works fine

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  

×