News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Reusability

Started by dvincent, February 10, 2018, 03:59:57 PM

Previous topic - Next topic

dvincent

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!

JustNoPoint

Common1 would be the closest you can get if you wanted all your chars to use certain code.

XGargoyle

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!

K4thos

or you can abandon mugen CNS in favor of ikemen ZSS, where you can write functions that will handle repeating code in script.

dvincent

Thanks for the information!