YesNoOk
avatar

Reusability (Read 438 times)

Started by dvincent, February 10, 2018, 03:59:57 pm
Share this topic:
Reusability
#1  February 10, 2018, 03:59:57 pm
  • avatar
Hello,

Is there a way to encapsulate some states somewhere and just reference on StateDef?

I'm looking at some fighters and I can see so much duplicated code that I'm getting dizzy.

Thanks!
Re: Reusability
#2  February 10, 2018, 04:48:19 pm
  • ******
    • www.justnopoint.com/
Common1 would be the closest you can get if you wanted all your chars to use certain code.
Re: Reusability
#3  February 10, 2018, 05:42:21 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
You can also split the code into several .cns files and have common code, such as specific helpers or universal stuff all located in one of these files. Kinda similar to a template, so you just drop the file into your character and then he has full access to these features
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Reusability
#4  February 10, 2018, 06:03:59 pm
  • **
or you can abandon mugen CNS in favor of ikemen ZSS, where you can write functions that will handle repeating code in script.
Re: Reusability
#5  February 11, 2018, 03:05:24 am
  • avatar
Thanks for the information!