XP - MAKING SCRIPT MESSAGE DURATION LAST LONGER
Posts
Pages:
1
I'm using this script that makes consumable ammo for ranged weapons. It works fine, except that the message that appears when you don't have any more ammo blinks up very quickly and then disappears. Anyone know how to make it last for a couple of seconds first? Thanks!
#============================================================================
# Syn's Ammo Requirements
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 1.00
# August 15, 2007
# Tested with SDK 2.1
#============================================================================
#----------------------------------------------------------------------------
# Customization Section
#----------------------------------------------------------------------------
module Ammo
# Format = {weapon_id => Ammo_cost}
Range_weapons_id = {4 => 1,7 => 1,11 => 1,13 => 1,18 => 1,24 => 1,25 => 1,27 => 1,28 => 1,38 => 2,40 => 1,51 => 1,49 => 5,14 => 5,23 => 5,50 => 5,29 => 1,17 => 1,1 => 1,48 => 1}
# Format = {weapon_id => Item_id
Range_ammo_id = {4 => 5,7 => 6,11 => 7,13 => 5,18 => 5,24 => 5,25 => 6,27 => 7,28 => 5,38 => 6,40 => 5,51 => 7,49 => 7,14 => 7,23 => 7,50 => 8,29 => 5,17 => 7,1 => 9,48 => 10}
# Format = {skill_id => Ammo_cost}
Skill_ammo = {73 => 3}
# Note on Skills: When using Skills the Current Ammo for the equipped
# weapon will be used. So if Skill 73 is used and Weapon 17 is equipped
# then Ammo #33 will be used.
end
#----------------------------------------------------------------------------
# Begin Scene_Battle
#----------------------------------------------------------------------------
class Scene_Battle
# Alias Methods
alias syn_scene_battle_range make_basic_action_result
alias syn_scene_battle_skill make_skill_action_result
#----------------------------------------------------
# Alias the Attacking method
#----------------------------------------------------
def make_basic_action_result
# Gather the current Ammo Cost
gather_ammo_cost = Ammo::Range_weapons_id
# Gather the Current Ammo
gather_ammo = Ammo::Range_ammo_id
# Check if the Active Battler is attacking and if they are using a ranged weapon
if @active_battler.current_action.basic == 0 and Ammo::Range_weapons_id.has_key?(@active_battler.weapon_id)
# Check the Ammo Count
if $game_party.item_number(gather_ammo) >= gather_ammo_cost
# Sufficient Ammo, remove item
$game_party.lose_item(gather_ammo,gather_ammo_cost)
syn_scene_battle_range
else
# Insufficient Ammo
@help_window.set_text("#{@active_battler.name} is out of ammo!", 1)
end
# Call Default Code
else
syn_scene_battle_range
end
end
#----------------------------------------------------
# Alias the Skill method
#----------------------------------------------------
def make_skill_action_result
# Gather the current Ammo Cost
gather_ammo_cost = Ammo::Skill_ammo
# Gather Ammo
gather_ammo = Ammo::Range_ammo_id
# Check if the Actor is using a defiend skill
if Ammo::Skill_ammo.has_key?(@active_battler.current_action.skill_id)
# Check if Ammo is present
if $game_party.item_number(gather_ammo) >= gather_ammo_cost
# Sufficient Ammo, remove item
$game_party.lose_item(gather_ammo,gather_ammo_cost)
# Call Default Code
syn_scene_battle_skill
else
# Set Window; Do Nothing
@help_window.set_text("#{@active_battler.name} is out of ammo!", 1)
end
# Otherwise SKip the check and call default code
else
syn_scene_battle_skill
end
end
end
#============================================================================
# Written by Synthesize
# Special Thanks: ~Emo~ for the request
#----------------------------------------------------------------------------
# Ammo Requirements
#============================================================================
# Syn's Ammo Requirements
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 1.00
# August 15, 2007
# Tested with SDK 2.1
#============================================================================
#----------------------------------------------------------------------------
# Customization Section
#----------------------------------------------------------------------------
module Ammo
# Format = {weapon_id => Ammo_cost}
Range_weapons_id = {4 => 1,7 => 1,11 => 1,13 => 1,18 => 1,24 => 1,25 => 1,27 => 1,28 => 1,38 => 2,40 => 1,51 => 1,49 => 5,14 => 5,23 => 5,50 => 5,29 => 1,17 => 1,1 => 1,48 => 1}
# Format = {weapon_id => Item_id
Range_ammo_id = {4 => 5,7 => 6,11 => 7,13 => 5,18 => 5,24 => 5,25 => 6,27 => 7,28 => 5,38 => 6,40 => 5,51 => 7,49 => 7,14 => 7,23 => 7,50 => 8,29 => 5,17 => 7,1 => 9,48 => 10}
# Format = {skill_id => Ammo_cost}
Skill_ammo = {73 => 3}
# Note on Skills: When using Skills the Current Ammo for the equipped
# weapon will be used. So if Skill 73 is used and Weapon 17 is equipped
# then Ammo #33 will be used.
end
#----------------------------------------------------------------------------
# Begin Scene_Battle
#----------------------------------------------------------------------------
class Scene_Battle
# Alias Methods
alias syn_scene_battle_range make_basic_action_result
alias syn_scene_battle_skill make_skill_action_result
#----------------------------------------------------
# Alias the Attacking method
#----------------------------------------------------
def make_basic_action_result
# Gather the current Ammo Cost
gather_ammo_cost = Ammo::Range_weapons_id
# Gather the Current Ammo
gather_ammo = Ammo::Range_ammo_id
# Check if the Active Battler is attacking and if they are using a ranged weapon
if @active_battler.current_action.basic == 0 and Ammo::Range_weapons_id.has_key?(@active_battler.weapon_id)
# Check the Ammo Count
if $game_party.item_number(gather_ammo) >= gather_ammo_cost
# Sufficient Ammo, remove item
$game_party.lose_item(gather_ammo,gather_ammo_cost)
syn_scene_battle_range
else
# Insufficient Ammo
@help_window.set_text("#{@active_battler.name} is out of ammo!", 1)
end
# Call Default Code
else
syn_scene_battle_range
end
end
#----------------------------------------------------
# Alias the Skill method
#----------------------------------------------------
def make_skill_action_result
# Gather the current Ammo Cost
gather_ammo_cost = Ammo::Skill_ammo
# Gather Ammo
gather_ammo = Ammo::Range_ammo_id
# Check if the Actor is using a defiend skill
if Ammo::Skill_ammo.has_key?(@active_battler.current_action.skill_id)
# Check if Ammo is present
if $game_party.item_number(gather_ammo) >= gather_ammo_cost
# Sufficient Ammo, remove item
$game_party.lose_item(gather_ammo,gather_ammo_cost)
# Call Default Code
syn_scene_battle_skill
else
# Set Window; Do Nothing
@help_window.set_text("#{@active_battler.name} is out of ammo!", 1)
end
# Otherwise SKip the check and call default code
else
syn_scene_battle_skill
end
end
end
#============================================================================
# Written by Synthesize
# Special Thanks: ~Emo~ for the request
#----------------------------------------------------------------------------
# Ammo Requirements
#============================================================================
Pages:
1














