Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Some question with the variables in the default script.

I tried looking for the following variables that stores the following data:

-Variable that stores the actor's level
-Variable that stores the average agility of the party (Which if I'm not mistaken, it was used in the "escape" calculation)

Also, what statement that I can use to change the number of steps that the party has taken in-game?

Need some help with this  :cool:, thanks.
 
-Variable that stores the actor's level:
$game_actors[ID].level

-Variable that stores the average agility of the party:
It's not really stored in a variable, it is instead calculated directly. The code is in update_phase2_escape of Scene_Battle2 and is something like:

Code:
    actors_agi = 0
    actors_number = 0
    for actor in $game_party.actors
      if actor.exist?
        actors_agi += actor.agi
        actors_number += 1
      end
    end
    if actors_number > 0
      actors_agi /= actors_number
    end

Also, what statement that I can use to change the number of steps that the party has taken in-game?
You can get it with $game_party.steps and increase it by 1 with $game_party.increase_steps but if you really want to change it into an arbitrary number you should go into the script editor, Game_Party class and change attr_reader  :steps to attr_accessor :steps and then use $game_party.steps = x

Edit: poccil beat me to it :)
 
Thanks for the info, both of you. :D

EDIT:
Is it possible for me to make a variable to store party's average level similar to the average agility used to calculate the escape chance?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top