How to set variables to specific parameters?

R.Alexander

Warper
Member
Joined
Jan 18, 2017
Messages
2
Reaction score
2
First Language
English
Primarily Uses
I see that there is a built in way to set variables to an actors current atk, level, hp, ect. But, I want to set a variable to a characters base attack, defense, ect. I feel there should be a way to do it using javascript, but nothing I have tried seems to work. There must be something simple I am missing.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I've moved this thread to Javascript Support. Please be sure to post your threads in the correct forum next time. Thank you.



There is probably a way to do that by referncing the data files instead of the game structure (after all, you can reset an actor to base values by checking init on the change membershot command), but I don't know the code for that myself, and it can't be done by eventing alone.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
I see that there is a built in way to set variables to an actors current atk, level, hp, ect. But, I want to set a variable to a characters base attack, defense, ect. I feel there should be a way to do it using javascript, but nothing I have tried seems to work. There must be something simple I am missing.
Its in the same list as HP and MP the player ATK and DEF values.


So if you can use the Eventcommand "control variable" to set a variable to player hp than just choose DEF or ATK


Atk = Attack Value = Base attack in my understanding.


Atleast this is possible in vx-ace, i dont think that they removed it in MV.
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@R.Alexander


hi friend


here how to get the current stats


$gameActors.actor(actorId).hp
$gameActors.actor(actorId).mhp
$gameActors.actor(actorId).mp
$gameActors.actor(actorId).mmp
$gameActors.actor(actorId).param[2]
$gameActors.actor(actorId).param[3]
$gameActors.actor(actorId).param[4]
$gameActors.actor(actorId).param[5]
$gameActors.actor(actorId).param[6]
$gameActors.actor(actorId).param[7]




and if you need set , add or remove .
You need to use like this.


$gameActors.actor(actorId).addParam(paramId, n);
//paramId=: 0-MaxHP, 1-MaxMP, 2-ATK, 3-DEF, 4-MAT, 5-MDEF, 6-AGI, 7-LUK


to understand more.
In game run tape F8 to open console log.


And put in console


$gameActors.actor(1)
And you will see the array list stats


as the visual inside rmmv software stats


0, 1, 2, 3


4, 5, 6, 7


Capture.JPG
 

R.Alexander

Warper
Member
Joined
Jan 18, 2017
Messages
2
Reaction score
2
First Language
English
Primarily Uses
Okay, I figured it out. I used the control variables event and set the variable to equal


$gameActors.actor(1).paramBase(2)


to set it to actor 1's base attack. Using brackets "[ ]" instead of parentheses "( )" after param was giving me the issue. Using the console log helped a lot


Thanks
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top