- Joined
- Dec 2, 2013
- Messages
- 105
- Reaction score
- 19
- First Language
- English
- Primarily Uses
Ok i have spent most of today looking for a way to do this but here is my issuse,
My game currently has Actors classes change depending on what weapon they have equiped, that part work fine,
that issue is with HP and because different classes have different base hp it kinda bugs out.
in my game you start with a class called "no class" that has a base hp of 1 but then when you eqiup a weapon which results in a immedate class change your base hp is adjusted but your current hp will remain at 1.
i need a way to preserve the %hp before the change and adjust the actors hp after it.
hopefully someone call at least ponit me in the right direction.
Also i made 2 common events to complete the above task but im not sure how to get them to run during this script.
or maybe there is a better way to do this.
Here is the Script im using to manage the class changes...
My game currently has Actors classes change depending on what weapon they have equiped, that part work fine,
that issue is with HP and because different classes have different base hp it kinda bugs out.
in my game you start with a class called "no class" that has a base hp of 1 but then when you eqiup a weapon which results in a immedate class change your base hp is adjusted but your current hp will remain at 1.
i need a way to preserve the %hp before the change and adjust the actors hp after it.
hopefully someone call at least ponit me in the right direction.
Also i made 2 common events to complete the above task but im not sure how to get them to run during this script.
or maybe there is a better way to do this.
Here is the Script im using to manage the class changes...
=begin
Equipment Changes Class v0.5
by kirinelf
Requested by: TheCastle
Notes:
Simply copy and paste the following in the module:
WEAPON_TYPE_ID[n] = m
where n is the weapon type ID and m is the class ID.
For example, WEAPON_TYPE_ID[1] = 1 will make all axes
turn the wearer into a Soldier.
=end
module EQUIP_CLASS
WEAPON_TYPE_ID = {}
WEAPON_TYPE_ID[1] = 1 # WEAPON_TYPE_ID[Weapon Type ID] = Class ID.
WEAPON_TYPE_ID[2] = 2
#========================================================================
# Do not edit anything under this line unless you know what you're doing!
#========================================================================
end
class Game_Actor < Game_Battler
alias equip_change_equip change_equip
def change_equip(slot_id, item)
equip_change_equip(slot_id, item)
case slot_id
when 0
unless item.nil?
class_id = EQUIP_CLASS::WEAPON_TYPE_ID[item.wtype_id]
end
$game_temp.reserve_common_event(5)
if class_id != nil
change_class(class_id, true)
init_exp
init_skills
end
end
end
end
Equipment Changes Class v0.5
by kirinelf
Requested by: TheCastle
Notes:
Simply copy and paste the following in the module:
WEAPON_TYPE_ID[n] = m
where n is the weapon type ID and m is the class ID.
For example, WEAPON_TYPE_ID[1] = 1 will make all axes
turn the wearer into a Soldier.
=end
module EQUIP_CLASS
WEAPON_TYPE_ID = {}
WEAPON_TYPE_ID[1] = 1 # WEAPON_TYPE_ID[Weapon Type ID] = Class ID.
WEAPON_TYPE_ID[2] = 2
#========================================================================
# Do not edit anything under this line unless you know what you're doing!
#========================================================================
end
class Game_Actor < Game_Battler
alias equip_change_equip change_equip
def change_equip(slot_id, item)
equip_change_equip(slot_id, item)
case slot_id
when 0
unless item.nil?
class_id = EQUIP_CLASS::WEAPON_TYPE_ID[item.wtype_id]
end
$game_temp.reserve_common_event(5)
if class_id != nil
change_class(class_id, true)
init_exp
init_skills
end
end
end
end
Last edited by a moderator:
