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.

[FILLED] Reserve Party Members Share EXP

I think I recall seeing a script like this somewhere. The basic idea is that characters not in the party will still get experience points when battles are won. Specifically, if possible, I'd like these "reserve" characters to get a bit less experience points than the active characters, like 70% or something along those lines. Does anybody know if a script like this exists? If not, this is a request for one to be made.
 
well, if your actors aren't being stored anywhere, you can't really give them exp.

I guess you could give each actor in the game extra exp, it just wouldn't really... yeah.

Anyways, heres something I guess. (I did this in fast reply and off the top of my head, so if something doesn't work, just let me know).

Code:
class Game_Party
  attr_accessor :gain_exp_share
  attr_accessor :exp_share_percent
  alias seph_expshare_init initialize
  def initialize
    seph_expshare_init
    @gain_exp_share = true
    @exp_share_percent = 70
  end
end

class Window_BattleResult < Window_Base
  alias seph_expshare_init initialize
  def initialize(exp, gold, treasures)
    seph_expshare_init(exp, gold, treasures)
    if $game_party.gain_exp_share && $game_party.exp_share_percent != 0
      exp = Integer(exp * ($game_party.exp_share_percent / 100.0))
      for i in 1...$data_actors.size
        actor = $game_actors[i]
        actor.exp += exp unless $game_party.actors.include?(actor)
      end
    end
  end
end

Just use:
Code:
$game_party.gain_exp_share = true (on) or false (off)
$game_party.exp_share_percent = Percent of Gain (Just use whole numbers, so 5% use 5)

Let me know if something doesn't work (and isn't it sad I didn't even have to open rmxp for this :()
 
The way my game works, it'd actually be fine if every single actor gained exp at once. Anyway SephirothSpawn, your script appears to work to an extent. However, all non-active actors seem to get 100% equal experience, not 70%, even though I typed 70 in your code. Also, is there a way for the script to always be active, without having to call it?
 
I've tried my hardest to understand what could be wrong with SephirothSpawn's script, but try as I may, I just don't know anything about scripting. Could anybody with a bit of Ruby knowledge help tell me what SephirothSpawn was trying to accomplish with that, and what the problem could be? (Hearing from SephirothSpawn himself would be ideal, but I know he's busy.)

As for what Alistor posted, it looks great, but I already have a party switching system, making the majority of that script useless to me.
 
That was my mistake. I made a small error. I fixed it from the script above.

Those codes to turn it off or on or change the percent are options. To make them on automatically, just change

@gain_exp_share = true
@exp_share_percent = 70

the true for on or off, and the 70 to whatever percent.

Everything should work fine now.
 
Actually, now it doesn't seem to work at all... Before it worked at 100% exp if I entered those options in a Call Script before a battle. Now, however, no matter what I do, nothing seems to happen. Meaning, non-active actors seem to get no exp at all.
 

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