The RPG Maker Resource Kit
RMRK RPG Maker Creation => VX Ace => Topic started by: yuyu! on September 06, 2015, 03:55:32 PM
-
Hopefully this is a quick question. ;9
I know that || is "and/or", but is there a way to just say "and" in RGSS3?
I want to use script calls to combine and simplify the conditional branches for my time events, like so:
$game_variables[12] == 8 || $game_variables[11] >= 30 || $game_variables[11] <= 40
Variable 12 = Hour and Variable 11 = Minute. So, the condition is supposed to occur between 8:30 and 8:40. The only thing not working about that is the || means "and/or" and runs the events even when all three aren't met. ;9
-
&&
-
Ahhhh! That's perfect, thank you!! :gracie:
I tried "&" to no avail. Didn't think about "&&". ;o
-
Yeah it's doubled like == and || (though I never understood why > and < are single characters)
-
They're doubled because single equal signs are usually used to assign variables. The other singular signs most likely have different uses as well.
In C and C++, << and >> are used as bit shifts (https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts). I don't know if it's a common thing in other languages. It seems like bitwise operations are more on the extreme technical side of things.
-
Yeah it's doubled like == and || (though I never understood why > and < are single characters)
Ohhh, duh! I can't believe I missed that! :sadmoonfacefromthatthreadss:
In C and C++, << and >> are used as bit shifts (https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts). I don't know if it's a common thing in other languages. It seems like bitwise operations are more on the extreme technical side of things.
That's right, I did notice that from my C++ class. :D I didn't know exactly what it meant until now, though.
-
you could also write 'and' if you're feeling boring
-
you could also write 'and' if you're feeling boring
huh? That's a thing? o.o
Just curious, but...does this mean there is also a code for just plain "or"?
-
there are some very slight differences, but yes. several english syntax words spill in to ruby syntax - 'if,' 'then,' 'wait,' 'end,' for example. conjunctions like 'and' and 'or' do exactly what you'd think. in some senses writing some lines of code can be like writing a sentence. don't expect the interpreter to understand the socio-political implications of your prose though.
-
nerds
-
Oh, neat! I tried "or" and it works. :-) Pretty rad!