• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] IF-statement with custom script

Status
Not open for further replies.
Thx, very useful. It is strange that none of "Custom script" tutorials explain IF-THEN_ELSE use...
 
If statements are available in GUI without custom scripts.
Custom functions, Common.j functions, easier string concatenation and number calculations, etc are not. That is what you will see in those custom script tutorials. (Ofcourse next to JASS syntax, global variable usage and all the other stuff you need to know.)
 
If statements are available in GUI without custom scripts.
Custom functions, Common.j functions, easier string concatenation and number calculations, etc are not. That is what you will see in those custom script tutorials. (Ofcourse next to JASS syntax, global variable usage and all the other stuff you need to know.)

There are, indeed, GUI-based IF-statements. The problem is, they cannot directly access local variables. There is a workaround, but it's bulky (reassigning local variable value to global). I just needed to quickly compare two locals I and J, if equal, set K to 1. Not enough to warrant rewriting trigger in jass, one line of custom code IF should be enough.
 
Hm, I still get "End of line expected" whenever I try to use IF-statement in custom script. Example:

Custom script: If i==j then set k=1 endif

Results in an "Expected end of line" error
 
Last edited:
Status
Not open for further replies.
Back
Top