RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX] Experience gain modifier

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 71
RMRK Junior
Would very much like to get a script that allows the modification of experience gained through note tags useable on States, Skills, Weapons and Armor. I'm interested in having it able to modify exp gain by a specific amount (like on Diablo 3) as well as a percentage. EXAMPLES:

/modexp [10]       <- this would increase experience gained per enemy killed (which is the preferred method, rather than on a per-battle basis, but per-battle is acceptable if it's significantly easier to do)

/modexp[10%]      <- this would increase experience gained by 10%. IF easier, or for further modification purposes, it could also be written as /modexp[110%] to reflect that you're gaining 10% above normal experience, which would also allow reduced experience gain as well.


*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I'll just get my old scripting box out...
Code: [Select]
# Exp Mod
# Pacman, 21/6/2012
# Use \exp_mod[x] in a weapon, armor or state's notebox to add x to all enemies'
# exp values.
# Use \expp_mod[x] in a weapon, armor or state's notebox to make all enemies'
# exp values x percent of what it was originally.
# Percentages are calculated before additions. Note that you can use negative
# numbers to subtract from the value, or numbers less than 100 to make fractions.

["Weapon", "Armor", "State"].each { |klass| pac_expmod = %Q(
class RPG::#{klass}; def exp_mod
  @exp_mod ||= self.note[/\\mod[_ ]?exp ?\[(\d+)\]/i].nil? ? 0 : $1.to_i
end; def expp_mod
  @expp_mod ||= self.note[/\\mod[_ ]?exp[_ ]?p ?\[(\d+)\]/i].nil? ? 100 : $1.to_i
end; end); eval pac_expmod }

class Game_Enemy < Game_Battler
  alias pac_expmod_exp exp
  def exp(*args)
    n = pac_expmod(*args)
    $game_party.equips.each {|equip|
      n *= equip.expp_mod / 100; n += equip.exp_mod
    }
    $game_party.members.each {|actor|
      actor.states.each {|state|
        n *= expp_mod / 100
        n += state.exp_mod
      }
    }
    return n < 0 ? 0 : n.to_i
  end
end
Note that I didn't really test it, and I'm a little rusty with scripting. Also I didn't make it work with skills because I'm not sure what you wanted with that.
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
that should be fine, worst-case scenario I can just make a skill apply a state for it anyway. Thanks man. Also, while I'm thinking about it, is there a way that you're aware of (without having to build trillions of conditional branches with parallel common events) to make weapons or equipment automatically apply a state to a character for the time that it's equipped? Or a way to hide states? my game includes some passive skills/states so it's a bit cramped having 5 - 10 states active at all times.



Also, it error'd, pointing to the line:
n = pac_expmod(*args)

Error message: line 20: NoMethodError occured. undefined method n = pac_expmod
« Last Edit: June 21, 2012, 07:11:37 PM by zerothedarklord »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Change that line to
Code: [Select]
n = pac_expmod_exp(*args)
That was a silly mistake.

I'm also really confident those scripts already exist.
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
that fixed that, now it says equip isn't defined or something.

Any idea what those scripts might be called? Those along with that variable state damage script I requested are about all I need to finish my game.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Change line 21 to
Code: [Select]
    $game_party.equips.compact.each {|equip|
That should fix the nil error you're getting.

As for your other thing, IUNNO.
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
unfortunately it didn't man, still says undefined.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Code: [Select]
    $game_party.equips.each {|equip| next if equip.nil?
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
you guessed it! still saying it's undefined.

"NoMethodError occured"
"undefined method 'equips' for # <Game_Party:0x2ac1ed0>"
« Last Edit: June 23, 2012, 12:02:20 AM by zerothedarklord »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Code: [Select]
# Exp Mod
# Pacman, 23/6/2012
# Use \exp_mod[x] in a weapon, armor or state's notebox to add x to all enemies'
# exp values.
# Use \expp_mod[x] in a weapon, armor or state's notebox to make all enemies'
# exp values x percent of what it was originally.
# Percentages are calculated before additions. Note that you can use negative
# numbers to subtract from the value, or numbers less than 100 to make fractions.

["Weapon", "Armor", "State"].each { |klass| pac_expmod = %Q(
class RPG::#{klass}; def exp_mod
  @exp_mod ||= self.note[/\\mod[_ ]?exp ?\[(\d+)\]/i].nil? ? 0 : $1.to_i
end; def expp_mod
  @expp_mod ||= self.note[/\\mod[_ ]?exp[_ ]?p ?\[(\d+)\]/i].nil? ? 100 : $1.to_i
end; end); eval pac_expmod }

class Game_Enemy < Game_Battler
  alias pac_expmod_exp exp
  def exp(*args)
    n = pac_expmod_exp(*args)
    $game_party.members.each {|actor| next if actor.nil?
      actor.equips.each {|equip| next if equip.nil?
        n *= equip.expp_mod / 100; n += equip.exp_nod
      }
      actor.states.each {|state| next if state.nil?
        n *= expp_mod / 100
        n += state.exp_mod
      }
    }
    return n < 0 ? 0 : n.to_i
  end
end
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
# Exp Mod
# Pacman, 23/6/2012
# Use \exp_mod[x] in a weapon, armor or state's notebox to add x to all enemies'
# exp values.
# Use \expp_mod[x] in a weapon, armor or state's notebox to make all enemies'
# exp values x percent of what it was originally.
# Percentages are calculated before additions. Note that you can use negative
# numbers to subtract from the value, or numbers less than 100 to make fractions.

["Weapon", "Armor", "State"].each { |klass| pac_expmod = %Q(
class RPG::#{klass}; def exp_mod
  @exp_mod ||= self.note[/\\mod[_ ]?exp ?\[(\d+)\]/i].nil? ? 0 : $1.to_i
end; def expp_mod
  @expp_mod ||= self.note[/\\mod[_ ]?exp[_ ]?p ?\[(\d+)\]/i].nil? ? 100 : $1.to_i
end; end); eval pac_expmod }

class Game_Enemy < Game_Battler
  alias pac_expmod_exp exp
  def exp(*args)
    n = pac_expmod_exp(*args)
    $game_party.members.each {|actor| next if actor.nil?
      actor.equips.each {|equip| next if equip.nil?
        n *= equip.expp_mod / 100; n += equip.exp_mod
      }
      actor.states.each {|state| next if state.nil?
        n *= expp_mod / 100
        n += state.exp_mod
      }
    }
    return n < 0 ? 0 : n.to_i
  end
end


error on line 26,  n *= expp_mod / 100

« Last Edit: June 23, 2012, 06:43:46 PM by zerothedarklord »

***
Rep:
Level 71
RMRK Junior
line 26: name error occured.
undefined local variable or method expp_mod for #<Game_Enemy:0x287a960>

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Change that to state.expp_mod
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
Alright, it isn't crashing anymore, but the experience gain is unchanged. (Testing it using equipment to modify it)

***
Rep:
Level 71
RMRK Junior
Any ideas Pac?

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
You should probably learn how to bugfix. It's not very difficult, and it's an incredibly useful skill, especially for someone who requests as much as you.

Maybe I'll make a tutorial :)
it's like a metaphor or something i don't know

***
Rep:
Level 71
RMRK Junior
lol, yeah, true that man. but I'm not the kind of person to half-ass something. If I was going to learn to bugfix, I'd just take it all the way and learn to make my own scripts, lol.

*
*crack*
Rep:
Level 64
2012 Most Unsung Member2012 Best NewbieFor frequently finding and reporting spam and spam bots
Feel free to do that.

It saves a lot of hassle if you can do things yourself.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3