New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enemy gold and exp formula issues #229

Closed
HimeWorks opened this Issue Sep 24, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@HimeWorks
Member

HimeWorks commented Sep 24, 2014

The amount of exp and gold you gain after battle may not match what the battle message say.
This is not a bug in my script.

This is how gold is awarded by default:

module BattleManager
  def self.gain_gold
    if $game_troop.gold_total > 0 # <----
      text = sprintf(Vocab::ObtainGold, $game_troop.gold_total) #<----
      $game_message.add('\.' + text)
      $game_party.gain_gold($game_troop.gold_total) #<----
    end
    wait_for_message
  end
end

Notice: the $game_troop.gold_total is called not once, not twice, but three times!

Separately.

This assumes that the gold total, therefore, never changes (and is quite stupid for that matter, but lots of things in the default scripts are kind of questionable)

So what happens when you start including randomization in the formulas?
You suddenly have inconsistencies.

A temp fix is to change it so that the value is not calculated twice

module BattleManager
  def self.gain_gold
    gold = $game_troop.gold_total
    if gold > 0
      text = sprintf(Vocab::ObtainGold, gold)
      $game_message.add('\.' + text)
      $game_party.gain_gold(gold)
    end
    wait_for_message
  end
end

A similar thing can be done for exp.

@HimeWorks HimeWorks added the bug label Sep 24, 2014

@HimeWorks HimeWorks closed this Sep 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment