Sigmmma / c20

A living knowledge base for the Halo CE modding community
https://c20.reclaimers.net
GNU General Public License v3.0
57 stars 45 forks source link

H1A - Scripting - Stubs - Function Body Now Required. #149

Open ChaOtoko opened 2 years ago

ChaOtoko commented 2 years ago

As titled. I don't know if this has always been the case, or its specific to H1A or its due to an update to MCC. But I discovered this while experimenting with stubs.

If you try to create a stub without defining it the following error is produced when the script is compiled.

[test_script line 1] i expected (script stub <type> <name> <expression(s)>): (script stub void say_hello)

Looking through the level scripts "base_a10.hsc" has stub scripts with bodies.

... (script stub void halo_setup (print "Joe's Cool Cinematic")) ...

When compiled single/multiplayer maps are run in MCC their stub scripts will still execute.

So they're overridable static scripts. But can only be overridden once (it can still be in a different script file).

num0005 commented 2 years ago

just got around to this @ChaOtoko did you end up checking if this was the case in legacy H1?

ChaOtoko commented 2 years ago

I've been a bit busy myself. Anyway I've managed to install (Halo 1 CE with) legacy HEK, and can confirm that stubs require initial definition. So the workaround for blank stubs would be to just use the print keyword.

stub error H1A MCC HEK

stub error HCE legacy HEK .