RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved]Condition Based on Level (sorry if there is I havent seen anything)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 85
IT IS ALIVE
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 :)
« Last Edit: December 23, 2008, 11:59:15 AM by Digi »
Saru mo kikara Ochiru
English:Even Monkeys will fall from Trees

**
Rep:
Level 86
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

**
Rep:
Level 85
IT IS ALIVE
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.
Saru mo kikara Ochiru
English:Even Monkeys will fall from Trees

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
If you need the actor to be in the group, then you can add the condition:

$game_party.members.include? ($game_actors[actor_id])

**
Rep:
Level 85
IT IS ALIVE
mmmmm

K so Id need to have for example then.

Code: [Select]
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...
Saru mo kikara Ochiru
English:Even Monkeys will fall from Trees

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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: