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!
EDIT: Problem solved, stupid mistake of mine.
EDIT: No I cant use '=' knowing it's a boolean, otherwise I get an error, saying "you idiot, change it to ==."
Can you please put example of what do I do, and what would you change it to?
Because on my script I used boolean variables with arrays, by what you are saying, I could just say... Ex.
If udg_Up[i] then
Don't think that would work.
Here is what I would do.
If udg_Up[i] == true then
Goahead and throw yours in to show me how I could optimize my script more.
Yeah, it's quite easy to understand actually. Whatever you write between the "if" and the "then" will always be boolean; it's either true or it is false (or it's wrong and will cause an error =p). If it's true, it will go into the "then" part of the structure, and if it's false it will go into the "else" part.
To clarify:
JASS:
function Decisional takes nothing returns nothing
local integer a = GetRandomInt(1, 10)
if a > 5 then
call WhateverTheHell(i, want)
else
call SomethingElse(i, "might", want)
endif
endfunction
Let's say it will random 7 for our integer a, so it will make:
JASS:
if 7>5 then
Obviously, 7 is greater then 5, which makes this statement true and thus will go on to the "then" part of the structure.
Now if you would compare this to what you said you would do, you'd basicly write this:
JASS:
if (7>5)==true then
That might look weird, because you don't use the ==true with integers probably, but it's just to give you an idea. It already checks if the statement is true or false, you don't have to check that yourself with the ==true.
There, trashbite gave a great example of what I'm talking about (note: if 7>5 then is equal to if true then for practical purposes, you just don't read it the same)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.