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.

Changing An Actor's State Efficiency Mid-Game

Sooth

Sponsor

Hello folks,

How would I go about changing an actor's State Efficiency during the game? I'd like to call such a script in battles and use it to make a character's resistance to status effects fluctuate based on their stats: DEX, INT, etc.

Thanks for your time,

- Kriss
 
Well, I'd kind of need a bit more information in order to give you the best possible solution here.
Like, are you going to be simply modifying the basic state ranks based on their stats?
Or will you be determining them outright based on their states?
Or will you simply be changing the state ranks from time to time based on certain skills being used?

Either way, a good place to start might be to copy the state ranks out of the data_system and into the associated actors. You'd need to add a line like:
Code:
@state_ranks = $data_classes[@class_id].state_ranks

to the initialize method of Game_Actor.

Then change def state_ranks from:
Code:
def state_ranks

    return $data_classes[@class_id].state_ranks

  end
to:
Code:
def state_ranks

    return @state_ranks

  end

Then you could modify @state_ranks however you want. If you ever wanted to reset it to default, just reuse:
Code:
@state_ranks = $data_classes[@class_id].state_ranks

Anything more specific than that, though, and I'd need to have a better understanding of what you want to accomplish.

((Also, you may want to make sure $data_classes[@class_id].state_ranks isn't directly refrenced elsewhere in Game_Actor or Game_Battler.))
 

Sooth

Sponsor

Actually, if I just knew what sort of script one would have to call to change an individual actor's State Effectiveness (for example: a script to change Actor 1's 'Poison' state effectiveness from C to D - which could be easily modified to indicate different actors, states, or ranks), I'd be fine from there. I'd have a Common Event check various values, and then run scripts to change actors' State Ranks based on them. Sorry that I wasn't clear.
 

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