The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: IAMFORTE on June 23, 2009, 08:17:44 PM

Title: Help with conditional branches
Post by: IAMFORTE on June 23, 2009, 08:17:44 PM
Is it possible for me to make a conditional branch that checks the users level, and if it is a certain level do a certain action.

example
if level = 30 then text"your strong"
else "Train some more"

Im sorry this is in Visual basic format, but this is the only way I can explain it

Thanks
Title: Re: Help with conditional branches
Post by: Grafikal on June 23, 2009, 08:32:17 PM
I'm pretty sure XP conditionals already support that. Just look at the tabs for yourself. It's extremely self explanatory.
Title: Re: Help with conditional branches
Post by: IAMFORTE on June 23, 2009, 09:35:09 PM
Ahh but i did that already. :)
unless its a different version i get this

first page: switch, variable, selfswitch, timer
second page: actor is: in the party, equipment, name, skill, weapons, armor, state,
third page: enemy, player facing
fourth page: gold, item, weapon, armor, button, script

the only ideas i might have had were variables
Title: Re: Help with conditional branches
Post by: Kokowam on June 24, 2009, 12:16:59 AM
Control Variables: Set variable to Actor's Level.
Conditional branch manipulating the variable.
Title: Re: Help with conditional branches
Post by: Grafikal on June 24, 2009, 01:49:37 AM
If you wanted the player's level to be checked contstantly, you would have to put the variable inside a common event on a parallel process. It's constantly being updated so you can call the value of the variable at anytime in real time and it'll equal your player's level. Or if you want to check the player's level when you check their level, then you can set the value of the variable at the very beginning of the event commands including the conditional branches that check that value.

I would assume you're trying to check the level as soon as it happens to have the text occur. If so, you'll NEED to set up the events like this::
Common Event, Parallel, Switch 00Z: ON

>Variable00X == Actor01 LvL
>If: Variable 00X == 30
>Then: Your Text Event Commands
>         Switch00Z = OFF
>Else: (nothing here)

If you just need to check the player's level whenever you speak to an NPC or something similar then you don't need to use a common event and instead can just do what I explained just above minus the common event mumbojumbo.
Title: Re: Help with conditional branches
Post by: IAMFORTE on June 24, 2009, 01:10:20 PM
Thanks for the info i knew it had something to do with the variables