Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
mcnools

Gettingtroops of a certain team engage a target

Recommended Posts

well, I'm thinking about doing a little mission where your'e stuck behind enemy lines, and I would like to do it so that when your'e discovered, lots of enemy units move to your position and engage you. Is there any way to do this? It would be best if notall of the enemies engage you, just those within a 1000 metres or something, is this possible?

Share this post


Link to post
Share on other sites

Well try a small script like this one (which might work) :

Quote[/b] ]

_patr=_this select 0

#patrol

? (put a condition here): goto "spotted"

~5

goto "patrol"

; In the above loop the soldier just wait until the “spotted player†condition goes true.

#spotted

_patr setbehaviour "DANGER"

_patr commandmove getpos (player)

?(_patr distance player<50) : _patr DoFire player

? (not alive (_patr)): exit

~2

goto "spotted"

; In the above loop the soldier will go into combat mode and move where the player is and will continue to follow him, until the distance between he and the player is below 50 meters. Once he’s below 50 he will fire at the player.

In the init field of the soldier type [name of the soldier] exec name of the script.sqs

Share this post


Link to post
Share on other sites

Thanks smile_o.gif I'll try that later.

is it possible to just type something in a trigger to get a certain group to move to a specific unit?

Share this post


Link to post
Share on other sites

Yes,

you can put something like in the condition of the trigger:

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

{_x knowsabout player > 2} count ENEMYGROUP !=0

with ENEMYGROUP being the group to potentially be able to detect the player,

the action upon true condition could be either a real waypoint

given to that group or the command

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

ENEMYGROUP move getpos player

Concerning Plasman's code : There is no behaviour of the type "DANGER", you probably meant "COMBAT". A single patrol would probably rather call for backup than go after a spotted enemy, the script should check a whole enemygroup like McNools was having in mind.

Share this post


Link to post
Share on other sites

This is a bit embarrasing, but how do I define a groupname?

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupname = group this in leaders initfield should do the trick.

Share this post


Link to post
Share on other sites

It worked! thank you.

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  

×