The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Digi on December 22, 2008, 02:08:21 PM

Title: [Resolved]Condition Based on Level (sorry if there is I havent seen anything)
Post by: Digi on December 22, 2008, 02:08:21 PM
Hi there :)

OK I really need like a Guide on the Language RPGVX uses for its scripts or a Idiots guide or something.

Im looking for a Script Line that would alow me to make a conditional Branch based on Level of the Actor.

I have tried
@level >= "15" and '15' and 15.
@actor.level >= "15" and '15' and 15
Level >= "15" and '15' and 15
$Level >="15" and '15' and 15

Im so last I cant figure it out. please please please help. and like i say a Idiots guide to the scripting language or a Index of common commands would be Great please.

Thanks for any assist :)
Title: Re: Condition Based on Level (sorry if there is I havent seen anything)
Post by: r_y_u_u on December 22, 2008, 02:28:41 PM
i don't know mutch about scripting, but you are asking the script if the variable is both a string and a integer, try using or instead of and, because the variable can't be both a string and an interger at the same time.
when using and, all the options connected by and must be true, when using or, only one must be for it to return true, e.g.
if q == 10 and 11 #dosent work ever, will never be true
if q == 10 or 11 #will be true if value of q is 10 or 11
that's the basics as i know them, may be wrong, but i'm pretty sure that's your problem, if it dosen't work, someone else will have to help you.
Title: Re: Condition Based on Level (sorry if there is I havent seen anything)
Post by: modern algebra on December 23, 2008, 12:04:53 AM
Well, @actor.level would work if it were a Game_Actor object. My guess is it isn't.

To get a Game_Actor object, you can either create it or retrieve it. If this is a class where the actor is saved in some capacity (such as Game_Party), then you can use whatever variable that class uses to save the actor.  Otherwise, you can retrieve it through something like this:

$game_actors[actor_id]
$game_party.members[party_id] where party id is the actor's position in the party.

Then the condition would be:

if $game_actors[actor_id].level >= 15
# whatever is supposed to happen
end
Title: Re: Condition Based on Level (sorry if there is I havent seen anything)
Post by: Digi on December 23, 2008, 11:58:30 AM
Hey thanks
The Commonwealth of Modern Algebra

:)
$game_actors[actor_id].level >= 15 was exactly what I was looking for :)

worked perfectly :)
thanks a HUGE stack, i was going insain looking for it.

:)
Just hope it only pulls the Data though if that Actor is in the group and not just If the actors that level anywhere else :)
But Ill let you know :)

Thanks a HUGE HUGE HUGE Stack :) +Rep if i could figure out how lols.
Title: Re: [Resolved]Condition Based on Level (sorry if there is I havent seen anything)
Post by: modern algebra on December 23, 2008, 02:42:47 PM
If you need the actor to be in the group, then you can add the condition:

$game_party.members.include? ($game_actors[actor_id])
Title: Re: [Resolved]Condition Based on Level (sorry if there is I havent seen anything)
Post by: Digi on December 30, 2008, 07:14:35 AM
mmmmm

K so Id need to have for example then.

Conditional Branch Script: $game_party.members.include? ($game_actors[1])
  Conditional Branch Script: $game_actors[1].level >= 15
   Else
  Branch End
Else
  Conditional Branch Script: $game_actors[2].level >= 15
   Else
  Branch End
Branch End


And Id need more conditionals for my 4 Possible main characters where I have areas that could have any one of them.
Suppose woud be easier to have them each just turn on a self switch in Parallel process then activate the Page needed for the quests etc hey...
Title: Re: [Resolved]Condition Based on Level (sorry if there is I havent seen anything)
Post by: modern algebra on December 30, 2008, 02:53:39 PM
Or just:


$game_party.members[0].level -- would retrieve the level of the first person in the party
$game_party.members[1].level -- would retrieve the level of the second person in the party


and so on: