Using Scripts in IF statments (Conditional Branches).

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
How do i use a script in a Conditional Branch?

I tired a few different things but my JS is far to rusty.

The pictured section is in a yellow box is my latest attempt.


Thanks.

if script question.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Conditions retrieve values, they don't set them. At least in Ace, whenever you set a switch, the value returned was ALWAYS true, because setting the switch succeeded.

Code:
Conditional Branch: Script: $gameSwitches.value($gameVariables.value(10))
would be true if the switch was true, and false if the switch was false. The switch number is taken from variable 10.
 
Last edited by a moderator:

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
Is it possible to do  the following as a script inside the conditonal branch

If Switch (var10) is off
$gameSwitches.value($gameVariables.value(10), false)
 

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
actually I can make that work by reversing the then and else parts of the statement.
thanks for your help again Shaz.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You would not do that in a conditional branch. If you wanted to use a script to set a switch, you would use a Script event command (second last command on tab 3)
 

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

Latest Threads

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,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top