Initialize without overwrite the old initialization?

Status
Not open for further replies.

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Hello there ...

I am just curious I  want to create a new initialization but in same time I don't want to overwrite the old method

I use exemple the Scene_Map

but I want to add a new call in the initiation definition but without to have  to rewrite the whole initialization method...

i am not sure but  I think we can use

 the alias?

because i am not sure...I never use alias most of time

so for me this method seem a little darky and unknow to me

but if it is not the method to take it exist a way to make a initialization without overwrite the old initialization?

thanks to the people who will answer to my question~
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
Yes use alias:

alias old_initialize initialize def initialize old_initialize # call the old method your_stuff endBut be sure to take a unique name for your alias method instead of old_initialize.,
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
ho okai thanks you so if I want to do this is

alias nio_initialize initializedef initializenio_initializemapping_nameenddef mapping nameendso with that I will not forced to rewrite the default configuration?
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
Correct. Alias will create a copy of a method as it is at that time (so the position in the script list matters at this point) and stores it in the new name you provide. Make sure the new name is unique, or you may run into some issues down the road with other scripters and maybe even yourself.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Correct. Alias will create a copy of a method as it is at that time (so the position in the script list matters at this point) and stores it in the new name you provide. Make sure the new name is unique, or you may run into some issues down the road with other scripters and maybe even yourself.
thanks you zalll you are always here for help me !

and thanks you two for helping me I was a little lost :3 so

nio give you Paper Cookie!
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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,083
Members
137,583
Latest member
write2dgray
Top