mcnools 62 Posted March 2, 2007 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
plasman 0 Posted March 2, 2007 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
mcnools 62 Posted March 2, 2007 Thanks 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
charonos 0 Posted March 2, 2007 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
mcnools 62 Posted March 2, 2007 This is a bit embarrasing, but how do I define a groupname? Share this post Link to post Share on other sites
HulkingUnicorn 0 Posted March 3, 2007 <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
mcnools 62 Posted March 3, 2007 It worked! thank you. Share this post Link to post Share on other sites