Jump to content
Sign in to follow this  
Blitzen

Waypoint & Trigger questions

Recommended Posts

Got a few questions for you guys...:yay:

#1

If I put something along the lines of this:

[Enemy,1] setWPpos getpos Player

In the activation field of a waypoint, it only seems to work for move waypoints. How can you get this to work for a guard waypoint? I essentially want a unit to wait until a certain condition is met and once it is, use a line of code like this to make a squad move to a location and then guard it.

#2

Is there any sort of command that can be used along the lines of: IF Squad1 is IN this trigger THEN blah blah. I know that the IF and THEN commands exist but does an IN command exist? Could you use the distance command to tell if a unit is in a trigger area?

#3

Similar to the one above, can you move a trigger through a command? Such as moving a guarded by trigger through a command while in game....?

Thank you very much for all of your help! Hopefully one day I will repay you guys with some decent missions! :bounce3:

Share this post


Link to post
Share on other sites

Seems complicated to me, if all you want to do is if a squad is in the trigger, then so and so moves to guard.

I essentially want a unit to wait until a certain condition is met and once it is, use a line of code like this to make

a squad move to a location and then guard it.

setup an area trigger for the condition, if whomever you wish enters it sync that to the squad's

waypoint that is supposed to come and guard.

What is the condition that you had in mind, someone present in the area?

or something else?

Could you use the distance command to tell if a unit is in a trigger area?

I dont know about any distance command, but if you setup an area trigger you can create a

hint in the trigger that would pop up and tell you that a squad be it the enemy or whomever is in the trigger.

hint goes in the activation line, all you do is:

hint "" put whatever you want to say between the quotes and a message will appear.

Share this post


Link to post
Share on other sites
it only seems to work for move waypoints. How can you get this to work for a guard waypoint?

not true. setWPpos works for all kinds of waypoints, including Guard waypoints. take note that while the waypoints begin numbering from 0 in the editor, they are recognized as +1 by the code. example:

#0 in editor -> [group,1] in code

#1 in editor -> [group,2] in code

#2 in editor -> [group,3] in code

...

Could you use the distance command to tell if a unit is in a trigger area?

Walter_E_Kurtz's method is a reliable way to get what you need, however another way to do it is check for the group's leader instead of the entire group. something like

leader myGroup in thislist or (leader myGroup distance myObject) <= 1000 

for more accurate results though, use Walter's way

Share this post


Link to post
Share on other sites
not true. setWPpos works for all kinds of waypoints, including Guard waypoints. take note that while the waypoints begin numbering from 0 in the editor, they are recognized as +1 by the code. example:

#0 in editor -> [group,1] in code

#1 in editor -> [group,2] in code

#2 in editor -> [group,3] in code

I set up a test mission using the commands I mentioned. I put the commands on a guard waypoint where once the unit got to the waypoint, the waypoint's location should've been moved to the location of a nearby tank. Playing as the commander, upon reaching the waypoint it merely stayed at its location and didnt transfer to the location of the tank.

It did seem to work for a seek and deystroy waypoint though.

Share this post


Link to post
Share on other sites

ok, your problem is that the GUARD waypoint doesn't activate like the MOVE waypoint as soon as you get on top of it!

try using the setWPpos command on a trigger to test it and NOT on the waypoint itself!

if you need to make the waypoint relocate based on a waypoint activation, use MOVE+CYCLE waypoints and relocate them both from the activation field of the MOVE waypoint...

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  

×