checking players stats

White Flare

Villager
Member
Joined
Mar 23, 2016
Messages
20
Reaction score
5
First Language
English
Primarily Uses
Long story short - I want an event to be able to check if a players luck is over 10 using an if statement.

Will also accept a way to set the party leaders luck to a variable. I found "$gameParty.leader().level" which works for level but changing it to "$gameParty.leader().luck" isn't working.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,608
Reaction score
1,405
First Language
French
Primarily Uses
RMMV
Long story short - I want an event to be able to check if a players luck is over 10 using an if statement.

Will also accept a way to set the party leaders luck to a variable. I found "$gameParty.leader().level" which works for level but changing it to "$gameParty.leader().luck" isn't working.
Code:
if ($gameActors._data[1].luk===?){
 //Do this....
}
set the ? with your valur , for stric more than >10

Code:
if ($gameActors._data[1].luk>10){
 //Do this....
}
_data[1] === player 1
_data[2] === player 2
_data[...] === player ....
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,241
Reaction score
6,784
First Language
German
Primarily Uses
RMMV
why using a script line at all if it is in an event?
The regular method for this is to use control variable (with the game data option) to load the parameter of the actor you want, then check it with a conditional branch.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,608
Reaction score
1,405
First Language
French
Primarily Uses
RMMV
why using a script line at all if it is in an event?
The regular method for this is to use control variable (with the game data option) to load the parameter of the actor you want, then check it with a conditional branch.
lol why using the regular method ?
In addition, this will allow him to learn a little more JavaScript.
 

White Flare

Villager
Member
Joined
Mar 23, 2016
Messages
20
Reaction score
5
First Language
English
Primarily Uses
Thank you for the long story short answer. Probably shouldn't be trying to write javascript at 3am after a full work day lol.
I went with - "Control Variables:#0005 Player Attribute = $gameParty.leader().luk" and its working great.

why using a script line at all if it is in an event?
The regular method for this is to use control variable (with the game data option) to load the parameter of the actor you want, then check it with a conditional branch.
I'm curious how this works as I've poked around a bit with it and am not sure of the method required. If I set a variable == game data party member 1 how do I test for his luck stat without code in the conditional branch?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,241
Reaction score
6,784
First Language
German
Primarily Uses
RMMV
You load the luk value of an actor into the variable by using the control variable command, and then check the value of the variable in the regular conditional branch.
You don't need code for this, because you don't use the script line options of either command.
In the case of the control variable command you use the game data option instead of the scriptline option, and in case of the conditional branch just check the variable against whatever number you want to check.
 

White Flare

Villager
Member
Joined
Mar 23, 2016
Messages
20
Reaction score
5
First Language
English
Primarily Uses
You load the luk value of an actor into the variable by using the control variable command, and then check the value of the variable in the regular conditional branch.
You don't need code for this, because you don't use the script line options of either command.
In the case of the control variable command you use the game data option instead of the scriptline option, and in case of the conditional branch just check the variable against whatever number you want to check.
Finally figured it out. So many sub menus full of options starts to obscure things. Thanks for the help everyone.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Hey people! What do you think about a core plugin? This will save some lines of code that I repeatedly use in all my plugins...
Wondering if I should make my enemies scale in my non-linear rpg. I'm leaning towards yes, but I don't want to use Yanfly's plugin...
French folk trying to pronounce English words. I loved how the man pronounced squirrel as 'square friend'.
Therapist: any questions? Me: Yeah, are there actually people who think Hotel California is about drugs and not fame or are people just trying to upset me?
Therapist: They WHAT?
It's interesting. There are no safety hazards in our country, but if you look at the shelves in supermarkets, you'd say there's a zombie apocalypse here.

Forum statistics

Threads
94,592
Messages
922,145
Members
124,461
Latest member
ppkvvet
Top