RPG Maker Forums

I've got the following code that is only partly working:



Code:
alias_method :shaz_old_hp=, :hp=

def hp=(hp)
# do some extra stuff here
shaz_old_hp = hp
end
When this is called, the new function IS getting called, but the old one isn't. The extra stuff is being done, but hp on the actor isn't changing.

I've also tried calling it these ways:



Code:
shaz_old_hp=hp
shaz_old_hp= hp
shaz_old_hp=(hp)
and none of them are calling the original Game_Battler.hp= method.

Does anyone know what the correct way to call the aliased method is?

Edit: *sigh*

One final look at Google provided the answer immediately after I posted this. Why didn't I choose those particular keywords in the first place?

The answer is this:



Code:
self.shaz_old_hp = hp

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,587
Latest member
Usagiis
Top