This question is for scripters, not for people using someone else's scripts in their project.
When you write scripts for your OWN projects (not to share) and you are adding to or modifying existing methods, do you put the script into its own Materials slot, or do you change the original code? Why?
I tend to like having things all together, and I'm wondering if my reasons for doing this are really worth it. So I thought it'd be interesting to hear from others, as well as get a list of the pros and cons of each method.
Modifying Original Class
Pros
Pros
What else can you add?
When you write scripts for your OWN projects (not to share) and you are adding to or modifying existing methods, do you put the script into its own Materials slot, or do you change the original code? Why?
I tend to like having things all together, and I'm wondering if my reasons for doing this are really worth it. So I thought it'd be interesting to hear from others, as well as get a list of the pros and cons of each method.
Modifying Original Class
Pros
- Everything for a class/method is in a single place. No searching through multiple scripts to find everything that happens within a method
- No need to alias or overwrite classes. I haven't tested (but I should), but I suspect every time you alias a method, it adds a miniscule amount to the processing time whenever that method is called, for the extra step of jumping to the aliased method (it would be just a tiny amount, but aliasing Game_CharacterBase.update 3 times in 3 different scripts, when you have 100 events, means looking up an aliased method 300 times per frame) - I would be happy for someone to tell me that this doesn't happen, that the process of compressing a game merges all the method aliases into a single call
- It just has a perception of being neater and more organized. My opinion only, and whether or not it makes a difference in any other area, being well organized is important to me
- Makes it hard to share scripts
- It's a bit risky when making new scripts - editing the original methods doesn't give you a "clean slate" to go back to if something goes wrong, so you have to remember what you changed, and where you changed it
- Hard to copy individual scripts from one project to another
Pros
- Easy to share scripts
- Easy to keep new mods contained - if something goes wrong, you know exactly which script slot contains the offending code
- Still organized, but in terms of script purpose rather than classes
- If you want to change something, your class/method could be in one of several script slots - lots of searching, checking to make sure you're changing it in the right place
- Risk of recursion, if you unknowingly use the same alias on the same method in more than one location
- Extra concern of getting the location of the new script correct - does it have to be above or below other scripts, does the alias have to be called before or after your new processing, are you actually aliasing or overwriting the original method?
What else can you add?



