novertigo 1 Posted November 13, 2016 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
ProfTournesol 956 Posted November 13, 2016 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
target_practice 163 Posted November 13, 2016 Nevermind Share this post Link to post Share on other sites
novertigo 1 Posted November 13, 2016 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
ProfTournesol 956 Posted November 13, 2016 You don't need to write anything. Just synchronize the wp with the trigger : https://community.bistudio.com/wiki/2D_Editor:_Synchronization Share this post Link to post Share on other sites
novertigo 1 Posted November 13, 2016 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
novertigo 1 Posted November 13, 2016 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
ProfTournesol 956 Posted November 13, 2016 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
novertigo 1 Posted November 13, 2016 Yup, Completely forgot the basics on variable operators. Thanks again Share this post Link to post Share on other sites