Game Variables

I want to make an information window that displays the current main actors extra and special parameters in the way the status menu displays the standard parameters. Yanfly had a script for this in Ace but hid MV plugins allow you to change these parameters rather than display them. I have found a script call that calls the relevant game variable but you need to know it's number to use it. The idea being to set a normal variable to the game variable and to then display the normal variable in the information window. I can manage the last part but cannot find a list of game variable numbers. Any ideas?

The idea behind this would be to give the player the option of which extra or specific parameters they wanted to increase after completing an event. However, they would need the information on the current values to be able to make an informed choice.

Am I missing something or is the list hiden? I've tried the online help and googled the issue with no luck. Also tried opening the data files etc.

Any help greatly appreciated.
To get the value of an actor's extra or special parameter you need a reference to the actor. You can reference an actor by:
  • Their database ID, e.g. for actor ID 1:

    $gameActors.actor(1)
  • Or their position in the party (leader is position 0, next is 1, etc), e.g. for the leader:

    $gameParty.members()[0]
Then you can reference the appropriate parameter with a dot, e.g. $gameActors.actor(1).eva is the Evasion value for actor ID 1. A full list of extra/special parameter names can be seen in the spoiler below~
Spoiler: Extra & special param names

Extra​

Hit Rate: hit Evasion Rate: eva Critical Rate: cri Critical Evasion: cev Magic Evasion: mev Magic Reflection: mrf Counter Rate: cnt HP Regeneration: hrg MP Regeneration: mrg TP Regeneration: trg

Special​

Target Rate: tgr Guard Effect Rate: grd Recovery Rate: rec Pharmacology: pha Mana Cost Rate: mcr TP Charge Rate: tcr Physical Damage Rate: pdr Magical Damage Rate: mdr Floor Damage Rate: fdr Experience Rate: exr

Source​

(Under the "Actor/Enemy Params" section.)
Also, remember that extra/special parameters are percentages: 1 = 100%, 0.2 = 20%, etc. Game variables round numerical results down to an integer afterwards, so for storing the value in a game variable you may want to consider one of these approaches:
  1. Control Variables -> Script -> $gameParty.members()[0].hrg * 100
    Stores party leader's HP Regen multiplied by 100, as a number.

  2. Control Variables -> Script -> ($gameParty.members()[0].hrg).toString()
    Stores party leader's HP Regen as a string, i.e. text (no rounding).
That should be sufficient if you only need to display the values in a Show Choices command or something, but if you want a custom menu then that'll need a plugin.
To get the value of an actor's extra or special parameter you need a reference to the actor. You can reference an actor by:
  • Their database ID, e.g. for actor ID 1:

    $gameActors.actor(1)

  • Or their position in the party (leader is position 0, next is 1, etc), e.g. for the leader:

    $gameParty.members()[0]

Then you can reference the appropriate parameter with a dot, e.g. $gameActors.actor(1).eva is the Evasion value for actor ID 1. A full list of extra/special parameter names can be seen in the spoiler below~
Spoiler: Extra & special param names

Extra​

Hit Rate: hit Evasion Rate: eva Critical Rate: cri Critical Evasion: cev Magic Evasion: mev Magic Reflection: mrf Counter Rate: cnt HP Regeneration: hrg MP Regeneration: mrg TP Regeneration: trg

Special​

Target Rate: tgr Guard Effect Rate: grd Recovery Rate: rec Pharmacology: pha Mana Cost Rate: mcr TP Charge Rate: tcr Physical Damage Rate: pdr Magical Damage Rate: mdr Floor Damage Rate: fdr Experience Rate: exr

Source​

(Under the "Actor/Enemy Params" section.)
Also, remember that extra/special parameters are percentages: 1 = 100%, 0.2 = 20%, etc. Game variables round numerical results down to an integer afterwards, so for storing the value in a game variable you may want to consider one of these approaches:
  1. Control Variables -> Script -> $gameParty.members()[0].hrg * 100
    Stores party leader's HP Regen multiplied by 100, as a number.

  2. Control Variables -> Script -> ($gameParty.members()[0].hrg).toString()
    Stores party leader's HP Regen as a string, i.e. text (no rounding).
That should be sufficient if you only need to display the values in a Show Choices command or something, but if you want a custom menu then that'll need a plugin.
Great. Thanks for that. Clear and concise. I'll give it a go.
Great. Thanks for that. Clear and concise. I'll give it a go.
Screen shot of system running well in Victor's Information Window and called via a Common Event.
Thanks for your help. Much appreciated.
Nice! You're welcome~

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/game-variables.147404/