Storing an Actors base stat and total stat in variable

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
So I have a system I want going where the player's on map movement speed is determined by the weight of the equipment they have on them. To do this, I'll have each equipment have a certain agility penalty. After that is where I'm stuck. I need to be able to store their base agility and total agility into separate variables. From there I can find the difference and determine a movement speed.


So, say Actor 1 has 30 agility after no changes made by equipment. So they are completely nekkid. I want to then store that agility score in variable 2. So say they equip some gear and the agility penalties drop their agility to 15. I want to then store that agility score into variable 3. However, since it is done dynamically in the background, it needs to check for base agility even when equipment is worn. This I do not know how to do.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
by default the engine only give access to the total stats (control variable : game data).


To get the base numbers, you'll need to access the class and actor data directly by script.


I don't know the javascript code for that one, but I'm moving it in the correct forum for javascript coding so you can get the answer faster.


Then you need to enter that code into the script line of control variable.


I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.
 

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
452
Reaction score
158
First Language
Not English
Primarily Uses
N/A
Try this code for base agility 


$dataClasses[$gameActors.actor(1)._classId].params[6][$gameActors.actor(1).level]
 

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
Try this code for base agility 


$dataClasses[$gameActors.actor(1)._classId].params[6][$gameActors.actor(1).level]


That worked perfectly! Thank you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top