[Ace] Checking multiple values from one in a variable.

CrawlinUK

Villager
Member
Joined
Feb 24, 2014
Messages
9
Reaction score
1
First Language
English
Primarily Uses
Hi

I am trying to check for the values 2, 3 or 4 in Variable3.

I am using a conditional branch for Variable3 and was attempting to use the script.

I tried:

$game_variables[3] = 2 || 3 || 4and

$game_variables[3] = 2..4I thought it might be something like this, but not fully sure how it handles (these don't work).

I though it might also be == but realised that this is only if is equal to all 3 values.

Any help is great.
 

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
469
First Language
Lithuanian
Primarily Uses
You mean,

$game_variables[3] == 2 || $game_variables[3] == 3 || $game_variables[3] == 4?

Or you can use:

Code:
[2,3,4].include?($game_variables[3])
 
Last edited by a moderator:

CrawlinUK

Villager
Member
Joined
Feb 24, 2014
Messages
9
Reaction score
1
First Language
English
Primarily Uses
You mean,

$game_variables[3] == 2 || $game_variables[3] == 3 || $game_variables[3] == 4?

Or you can use:

[2,3,4].include?($game_variables[3])
Thanks, both work well.

I will use the second as I can add to it later on.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top