Jump to content
Sign in to follow this  
Meatball0311

if statement help

Recommended Posts

I am looking to add make an 'if' statement when my group spots enemy units.

if (??group spots enemy??) then {goto "contact"}

how would I script group spots enemy?

Share this post


Link to post
Share on other sites

For an individual target:

knowsAbout

(group player) knowsAbout enemyMan > 3

For any target:

An east spotted by west trigger (or whatever is relevant), the trigger can be moved with the group using a simple setPos loop. ie:

while {alive player} do {
   _trigger setPos (leader player);
   sleep 2;
};

Edited by bhaz

Share this post


Link to post
Share on other sites
For an individual target:

knowsAbout

(group player) knowsAbout enemyMan > 3

For any target:

An east spotted by west trigger (or whatever is relevant), the trigger can be moved with the group using a simple setPos loop. ie:

while {alive player} do {
   _trigger setPos (leader player);
   sleep 2;
};

I understand, but what if I do not have any specific unit that I am looking for? I am wanting it to trigger for any EAST unit?

Share this post


Link to post
Share on other sites
I understand, but what if I do not have any specific unit that I am looking for? I am wanting it to trigger for any EAST unit?
For any target:

An east spotted by west trigger (or whatever is relevant), the trigger can be moved with the group using a simple setPos loop. ie:

while {alive player} do {
   _trigger setPos (leader player);
   sleep 2;
};

If you don't want to place triggers via the editor there's always the createTrigger command and all the others that go with it.

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  

×