Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Creating a new modified Hash class

I need to add a new feature to a battle script, but it will be hard to rewrite the behavior of all the 25 options it have now. They add effets to battle, like attacking to all enemies, attack onlt to flying ones,etc

These new feature is the hability to set any config value with a event variable.
As im using a Hash constant to configurate things i thing the more quick method willl be creating a new hash class and rewriting the method that gives the value in a normal way, creating a condition to check if the hash have to return the event variable code or not.

The idea will be to check for a code like traditional '\v[id]'.

This its possible?
 
It's possible, of course, however not really recommended... all other Hash instances will be affected by your change, which will most likely result in some incompatibilities, if not straight-from-the-start incompatibility with RMVXP defaults. Seriously, if you didn't plan your script ahead appropriately, fix it the right way - not with some mumbo jumbo cheating. That way you'll get the better script, the better compatibility and a lecture on 'scribble before you fiddle' ;)
 
BlueScope":2sebllel said:
It's possible, of course, however not really recommended... all other Hash instances will be affected by your change, which will most likely result in some incompatibilities, if not straight-from-the-start incompatibility with spongen2 defaults. Seriously, if you didn't plan your script ahead appropriately, fix it the right way - not with some mumbo jumbo cheating. That way you'll get the better script, the better compatibility and a lecture on 'scribble before you fiddle' ;)

¿Why? I will using the modified hash as a new class that inherits from hash...
¿how can affect the paent class?

I know its a bad way but its saving time to do other things. Maybe i will modify script but later, and now i need it..
 
If you're creating a subclass, then yeah, you would avoid compatibility issues. Seriously though, if that's your way of troubleshooting, I bet you also like to fix your car by putting it on a cart you can then pull around. Or a stove by making a campfire on the inside. Or a script by converting it to events.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top