Closed soushimiya closed 3 weeks ago
This approach might work for things like stages, but for more complex scripts like a DJ character, it's best to use the Polymod scripting class.
You can also have scripts that extend the Script class itself to further extend the object (such as adding more effects to a UI skin).
I think I wanna keep scripts how they are right now just to keep everything consistent. Maybe I'll revisit this idea for the scripts in the future but I think what I have is good for now. Also I don't think using loadMods()
and unloadMods()
is necessarily faster than using init()
as they just end up calling init()
themselves after modifying the mod list. I was having a few weird problems with loadMods()
and unloadMods()
anyways so I wanna keep that the same.
This is an replacement of ScriptableScript that loads scripts from a single ".hxc" file instead of creating new classes. This can simplify script structure since it don't have to define different class names one by one.
The Script class is replaced by an improved version of Hscript's Interp class. This improved version includes import functionality not found in the original Hscript, as well as additional functionality to get/set objects from the current instance.
For example, the code to implement the Botplay mode could look like this:
As you can see, you can change values such as scoreTxt directly and also call PlayState functions.
Other bug fixes/Tweaks (From a PR that was closed by mistake)