Set Variable to Actor Level Question

Teldil

Villager
Member
Joined
Dec 7, 2015
Messages
15
Reaction score
1
Primarily Uses
Hi,

My game lets you choose a character to play as, from about 20 characters. So my list of actors has about 20, and the player can choose one at the start of the game. You only play as 1 character.

I want to create a variable that will change to the player's level automatically each time he levels up.

The problem is, I don't know which character is gonna be the one selected by the player. So far all the examples of how to do this I found needed me to specify the exact actor I want to check for level and set the variable...

So...in other words...How do I make it set the variable to the level of the first character in the party? 

Thanks for any help!!!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
I would suggest a different approach:


1 actor only.


Use Change Actor Graphics, Change Actor Name, Change Actor Class, based on selections by the player.


Then you only have 1 actor whose level (or equipment, or skills, or anything else) that you need to check.
 

Teldil

Villager
Member
Joined
Dec 7, 2015
Messages
15
Reaction score
1
Primarily Uses
Thanks...but I don't think that idea would work for me...or it would be way too complicated.

I need each character to have very different and unique skills, stats, etc...so changing everything for each choice is gonna be a lot of work...

I thought there would be something very easy for this? :\ it only requires to check the lvl of the party leader...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
You set up the classes with all the equipment, skills, stats. So you would have as many classes as you need. The Change Actor Class, which you do right at the start, then gives all those skills/stats/equipment assigned to the class to the actor.


To get the party leader's level into a variable:

Control Variables: [001: Leader Level] = Script: $gameParty.leader().level()but then you would have to figure out how to set it up at the end of each battle.
Here are some plugins that you might find useful (use one or the other - not both):


Linked Variables (link a variable to '$gameParty.leader().level()')


Battle Result Switches (turn on the same switch for each battle outcome, then have a parallel processing common event conditioned by that switch, which will do the Control Variables shown above and then turn the switch off)
 

Teldil

Villager
Member
Joined
Dec 7, 2015
Messages
15
Reaction score
1
Primarily Uses
Hmm. thanks!..I tried using the script you wrote:

Started an event with: Control Variables: [001: Leader Level] = Script: $gameParty.leader().level()

Then a conditional branch with - If: Leader Level = 2

Show text: You're level 2!

I then chose a character which starts at level 2, and tested the game.

I'm gettting an immediate error msg: TypeError - number is not a function

help!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
please give a screenshot of your event - I think you might have placed too much into the script section.


Shaz answer was a mix of event command and script command, and only the part with the $ goes into the script line of a control variable command, everything befor is event command.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Try getting rid of the () after level. Maybe that isn't a function.
 

Teldil

Villager
Member
Joined
Dec 7, 2015
Messages
15
Reaction score
1
Primarily Uses
It works great now!!! THANK YOU!!!!!!
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top