Jump to content
Sign in to follow this  
novertigo

Help with Waypoint Conditions

Recommended Posts

Hello everybody. 

 

I've been having some trouble with Waypoint condition blocks. I would rather actually say that im having trouble scripting to test if a variable is set to a certain integer. 

 

My problem lies as such:

 

Waypoint 1 Condition Block : See if _Variable = 1

 

If it is, Go to Waypoint 2. So pretty much I put a trigger to set _Variable = 1, and when the group reaches the waypoint with the condition they do not move at all to the next waypoint. How can I script a block to check if a variable is set to a certain integer.

 

 

Thank you in advanced.

Share this post


Link to post
Share on other sites

First, you need global variables, not private. Don't use underscore in front of it ('my_variable' but not '_variable').

Then, what have you written exactly in the wp condition line ?

Share this post


Link to post
Share on other sites

Thanks for the replies. Sorry, Im not actually putting underscores it was just an example. The variable im using in this example is: letsmove. Pretty much (in the 2d editor) I have a trigger that activates when west is present. In the 'activation' field i put letsmove = 1. The group moves to the first waypoint. In the condition block I have letsmove = 1. Im pretty much trying to say "move to the next waypoint if letsmove = 1". How ever the group is not moving. I know im using the incorrect syntax probably but i dosent tell me that.

 

I would also like to know if I could achieve this in the 2d editor without external scripts.

Share this post


Link to post
Share on other sites

Yes, I do understand the use of synchronization how ever, synchronizing achieves it on a more trivial basis, pretty much if all units arrive at the same time or something of that sort. But what im trying to achieve is a simple code block in the waypoint condition field to wait until a variable is set to a certain integer to move on instead of synchronizing a bunch of waypoints

Share this post


Link to post
Share on other sites

Ok I feel very oblivious. It seems I was simply missing the extra = operator after the variable sign. I was putting letsmove = 1 instead of letsmove == 1. It was pretty much just re-declaring the variable instead of checking if its equal to it. Thank you again for your time

Share this post


Link to post
Share on other sites

In the condition block I have letsmove = 1. 

 

This isn't a valid condition. To check a value, you have to use "==" instead of "=" ("=" is used to affect a value to a variable).

 

So :

letsmove==1

Is a valid condition.

Share this post


Link to post
Share on other sites

Yup, Completely forgot the basics on variable operators. Thanks again

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  

×