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.

Anybody know how to make DOUBLE EXP/TRIPLE EXP script?

Kyo

Member

Script Request Template
Requesting for Double Or Triple EXP Script

Script Title:
Double EXP & Triple EXP Script

RMXP or RMVX:
I use RMXP

Detailed Description:
Well i think it will easy if it do like this , If the player use Holy Apple , A message will come out and say that the player will granted double or triple EXP in like 15 minutes or something , When the 15 minutes period past another message will appear and say that the Apple effect just gone away Or something like that.

Anybody could help me?
 
I'll do this for you. It will have to be between scripts and events.
Make the "Holy Apple" item call a common event. Your common event should work like this:

Message: You've eaten a Holy Apple. The half-worm you consumed has enabled you to learn twice as fast in battle.

Call Script: $exp_multiplier = 2

Wait: There are 2400 frames in a minute. That's 12 "Wait: 200 frames" commands. So for 15 minutes, that would be 180 wait commands.

Call Script: $exp_multiplier = 1

Message: You have successfully completed digesting the half-worm. As it leaves your body, its effects are no longer with you.


# Experience Multiplier Script

$exp_multiplier = 1


class Scene_Battle
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
def start_phase5
# Shift to phase 5
@phase = 5
# Play battle end ME
$game_system.me_play($game_system.battle_end_me)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Initialize EXP, amount of gold, and treasure
exp = 0
gold = 0
treasures = []
# Loop
for enemy in $game_troop.enemies
# If enemy is not hidden
unless enemy.hidden
# Add EXP and amount of gold obtained
exp += enemy.exp
gold += enemy.gold
# Determine if treasure appears
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# Treasure is limited to a maximum of 6 items
treasures = treasures[0..5]
# Obtaining EXP
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp * $exp_multiplier
if actor.level > last_level
@status_window.level_up(i)
end
end
end
# Obtaining gold
$game_party.gain_gold(gold)
# Obtaining treasure
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# Make battle result window
@result_window = Window_BattleResult.new(exp * $exp_multiplier, gold, treasures)
# Set wait count
@phase5_wait_count = 100
end
end

#==============================================================================
# ** Interpreter (part 7)
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
def command_315
# Get operate value
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# Process with iterator
iterate_actor(@parameters[0]) do |actor|
# Change actor EXP
actor.exp += value * $exp_multiplier
end
# Continue
return true
end
end


Script covers both battle and the event "Change EXP..." option.
 

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