05-20-2016, 11:36 PM
I have been stretching my coding time between Sil's DDR and Cassie's CMS system.
With the CMS and other demos he uses, he has a Scene_Base package. Funny enough, the Scene_Battle script in his Scene_Base package has an untouched/unchanged 'def update_phase4_step2' method which was the actual method aliased in the animated battler script. Because he made no changes to update_phase4_step2, there was no need for him to include it in his Scene_Base package... totally a waste.
Oh, alias is a way to attach new code to an existing method. It's might be easy to look at it like this:
First an alias statement that links the two names. It'll assume that running 'new_update' will execute your original code.
Then 'def' (or define method) of the revised update method
Then we call 'new_update' which is the new name to the 'original' update method... ala alias. So we're running the original update.
THEN we run 'new_code' ... whatever that may be.
Then we end the method... done
With the CMS and other demos he uses, he has a Scene_Base package. Funny enough, the Scene_Battle script in his Scene_Base package has an untouched/unchanged 'def update_phase4_step2' method which was the actual method aliased in the animated battler script. Because he made no changes to update_phase4_step2, there was no need for him to include it in his Scene_Base package... totally a waste.
Oh, alias is a way to attach new code to an existing method. It's might be easy to look at it like this:
Code:
alias new_update update
def update
new_update
new_code
end
Then 'def' (or define method) of the revised update method
Then we call 'new_update' which is the new name to the 'original' update method... ala alias. So we're running the original update.
THEN we run 'new_code' ... whatever that may be.
Then we end the method... done