- Joined
- Aug 25, 2006
- Messages
- 971
Hello,
First off I realize that both ceres and cerrie have more-or-less been abandoned. I didn't want to let a little abandonware come between me and excellent tooling so I've given a shot at using them.
Honestly all-in-all my experience has been excellent. (Regardless of current project status, the author deserves super props!) Hot reload is the best thing ever. I remember having to spend multiple minutes waiting for my map to save and then for Wc3 to boot up between every test. Being able to hot reload is completely worth the minor architecture constraints imposed.
I'm wondering if anyone else is using Ceres + Cerrie. I'm trying to figure out the cleanest way to handle initialization. Basically I want to run code when:
Just putting lua/typescript in the base of files actually fills both conditions with one minor problem. During #1 lua code put in the 'base' of the files runs before Warcraft 3 is fully initialized and as such has all kinds of weird problems. One example is FourCC spits out a LUA error, but its hardly the only blizzard method that breaks when called from that base lua file.
During a hot reload everything works just fine because warcraft 3 is fully initialized by that point, all methods work as intended.
Currently I have a work around that looks like this:
I'm curious if anyone else is using cerrie and has any thoughts. Or knows why FourCC doesn't work properly when called in the base lua file (as built by ceres)
First off I realize that both ceres and cerrie have more-or-less been abandoned. I didn't want to let a little abandonware come between me and excellent tooling so I've given a shot at using them.
Honestly all-in-all my experience has been excellent. (Regardless of current project status, the author deserves super props!) Hot reload is the best thing ever. I remember having to spend multiple minutes waiting for my map to save and then for Wc3 to boot up between every test. Being able to hot reload is completely worth the minor architecture constraints imposed.
I'm wondering if anyone else is using Ceres + Cerrie. I'm trying to figure out the cleanest way to handle initialization. Basically I want to run code when:
- The map starts
- Cerrie does a hot reload
Just putting lua/typescript in the base of files actually fills both conditions with one minor problem. During #1 lua code put in the 'base' of the files runs before Warcraft 3 is fully initialized and as such has all kinds of weird problems. One example is FourCC spits out a LUA error, but its hardly the only blizzard method that breaks when called from that base lua file.
During a hot reload everything works just fine because warcraft 3 is fully initialized by that point, all methods work as intended.
Currently I have a work around that looks like this:
JavaScript:
let isHotReload = true;
util.contextFn("onetimeSetup", () => isHotReload = false);
function Setup() {
// Do my setup
}
if (isHotReload) {
Setup();
} else {
// Schedule Setup() to run at a later time [when wc3 is initialized]
}
I'm curious if anyone else is using cerrie and has any thoughts. Or knows why FourCC doesn't work properly when called in the base lua file (as built by ceres)