Kain Nobel
Member
Good day everybody!
I'm not sure if this is more of a question or a brainstorm, but it is something that I would like to hear everybody's thoughts on and how you'd do it, maybe we could just brainstorm and do it together.
I was thinking too hard the other week, like I always do, when I came up with something that sounded like a simple idea, but when I started thinking about the details the 'simple' idea didn't sound so simple anymore... I mean, it probably could be something simple, but I donno, the secret lies within 'alias'... how does alias work exactly? No, I don't mean "Hey I'm a n00b how do I use alias", I'm talking about what is 'alias' really doing when we call it? Like, how exactly does it record the previously named method, rename it and call it upon redefinition accurately? And for that matter, how does the information stack whenever a method is called?
Here's what I was thinking of doing, I was thinking of making an alternative/replacement to alias and alias_method calls, by creating a new method called the 'stacked_method'. With this method, it would almost be like an 'auto-alias' without the need for making an alias name, matter of fact I want to make it where you don't have to do NOTHING at all but call a 'stacked_method(?)' within a method redefinition (not previous to it or nothing).
[spoiler='alias/alias_method' call]
[/spoiler]
Compared to...
[spoiler='stacked_method' call]
[/spoiler]
But then that also leads to the question, how would you auto-log definitions? For instance, how would you auto-log the default Game_Battler initialze method without touching the default script? This is something you might want to think about too, because I'd like to hear your input on these questions/ideas.
I have my own twisted version that I came up with in my head, it almost sounds kinda evil though and a little harder than it should be, thats why I want to hear what you'd do if you were to try and do this, and your knowledge as it is on stuff like this.
I'm not sure if this is more of a question or a brainstorm, but it is something that I would like to hear everybody's thoughts on and how you'd do it, maybe we could just brainstorm and do it together.
I was thinking too hard the other week, like I always do, when I came up with something that sounded like a simple idea, but when I started thinking about the details the 'simple' idea didn't sound so simple anymore... I mean, it probably could be something simple, but I donno, the secret lies within 'alias'... how does alias work exactly? No, I don't mean "Hey I'm a n00b how do I use alias", I'm talking about what is 'alias' really doing when we call it? Like, how exactly does it record the previously named method, rename it and call it upon redefinition accurately? And for that matter, how does the information stack whenever a method is called?
Here's what I was thinking of doing, I was thinking of making an alternative/replacement to alias and alias_method calls, by creating a new method called the 'stacked_method'. With this method, it would almost be like an 'auto-alias' without the need for making an alias name, matter of fact I want to make it where you don't have to do NOTHING at all but call a 'stacked_method(?)' within a method redefinition (not previous to it or nothing).
[spoiler='alias/alias_method' call]
Code:
def method
 # ...very initial/previous stack of code
end
alias_method, :old_method, :method
def method
 # ...
 old_method
end
Compared to...
[spoiler='stacked_method' call]
Code:
def method
 # ...Very initial/previous stack of code
end
def method
 # ...
 stacked_method(method)
end
But then that also leads to the question, how would you auto-log definitions? For instance, how would you auto-log the default Game_Battler initialze method without touching the default script? This is something you might want to think about too, because I'd like to hear your input on these questions/ideas.
I have my own twisted version that I came up with in my head, it almost sounds kinda evil though and a little harder than it should be, thats why I want to hear what you'd do if you were to try and do this, and your knowledge as it is on stuff like this.