Obtain Level of ActorID

Okay, so in my game I have eight potential players in the party. This is a work in progress, but I basically plan on disabling the auto-level function in order to replicate the Ultima style of leveling up, where players could accumulate XP and then meditate at one of the eight shrines of virtue to level up, what stats are raised depends entirely on which shrine the party meditates at.


So this is what happens:


If the party is larger than one ( detected through the usage of $gameVariables.setValue(12, $gameParty.members().length); when the encounter begins) the player is asked who will meditate.


Here is where I employ SRD's lovely Actor Select plugin, which stores the ActorID of the selected character in variable 13 (ActorID).


The next step is, of course, making sure that the character has enough XP and is of the correct level. So I first have the game store the current XP in variable 14 (  $gameVariables.setValue(14, ($gameActors.actor($gameVariables.value(13)).currentExp())) ) - and that works, verified. The next step is to check the level... and that's where I'm running into trouble.  I've tried both  
$gameVariables.setValue(15, $gameActors.actor($gameVariables.value(13)).currentlevel())) and 
$gameVariables.setValue(15, $gameActors.actor($gameVariables.value(13)).level())) but I run into errors on both. What would be the correct formula for this? After this, the rest of the steps are fairly simple (compare that both meet the conditions, raise the stats, bada-bum bada-bing,) but I've been stumped at this step. I tried to look into the script call list, but I didn't quite find what I needed there. I'm still fairly rough around the edges, so I would appreciate the help!


Also, if anyone knows how I would be able to get rid of the auto-leveling, that would also be swell!
$gameVariables.setValue(15, $gameActors.actor($gameVariables.value(13).level))
Try: $gameVariables.setValue(15, $gameActors.actor($gameVariables.value(13))._level)


Here are the things that were changed:

  • Removed the final () as this not a method call, but a property of Game_Actor
  • Changed level to _level because this is how they named this variable and some others
  • Removed one end-parenthesis from the end of your script call to balance out the parentheses (note that in your "14" example you have an opening-parenthesis before the word $gameActors whereas in your "15" examples you don't)
Thank you, it worked beautifully. You guys are the best!  🙂

Original thread: https://forums.rpgmakerweb.com/threads/obtain-level-of-actorid.64801/