#==============================================================================
# Add-On: Guns 1.1
# by Kylock
#------------------------------------------------------------------------------
# This Add-On allows you to use additional animations for guns.
# To use this script, verify if your guns have the attribute with the same
# ID as GUN_ELEMENT in the weapon's tab of your database.
#==============================================================================
module N01
# $game_actors.animation_id
# Element for the weapon/skill that has the Gun Animation
GUN_ELEMENT = 27
ANIM = []
# Attack Animation
ranged_anime = {
"GUNSHOT" => ["sound", "se", 100, 100, '357_magnum'],}
ANIME.merge!(ranged_anime)
=begin
"OBJ_ANIM_WEIGHT"
=end
# Action Sequence
RANGED_ATTACK_ACTION = {
"GUN_ATTACK" => ["JUMP_AWAY","WPN_SWING_V","30", "OBJ_ANIM_WEAPON", "WPN_SWING_V",
"12","WPN_SWING_VL","OBJ_ANIM_L","One Wpn Only",
"16","Can Collapse","JUMP_TO","COORD_RESET"],}
ACTION.merge!(RANGED_ATTACK_ACTION)
end
module RPG
#------------------------------------------------------------------------------
class Weapon
alias kylock_guns_base_action base_action
def base_action
# If the "Gun" attribute is marked on the weapon's element,
# the new attack sequence is used
if $data_weapons[@id].element_set.include?(N01::GUN_ELEMENT)
return "GUN_ATTACK"
end
kylock_guns_base_action
end
end
#------------------------------------------------------------------------------
class Skill
alias kylock_sguns_base_action base_action
def base_action
# If the "Gun" attribute is marked on the weapon's element,
# the new attack sequence is used
if $data_skills[@id].element_set.include?(N01::GUN_ELEMENT)
return "GUN_ATTACK"
end
kylock_sguns_base_action
end
end
end
In the VERY beginning, do you see "GUNSHOT" =>
?
That's the hash that defines the sound to play with "gun type" weapons. Problem is, most of the weapons in my game are guns, and I don't want them all to have the same sound. However, I've tried a case-when, where I went:
case whatever_weapon_id
when 54
GUNSHOT =>
ETC....
With each defining gunshot. No luck. If it were a class or something, I could give it attr_s, which would allow it to work. But it's not.
It seems like most everything that would work isn't available with a module.
Does that help?
Yeah, Ryex, I'll go check your script ^_^.
And btw, when I was younger, GS was my FAVORITE RPG, hands down.