I've downloaded the svn trunk and compiled it fine on XP (one small glitch with streflop.a - needed to rename it to libstreflop.a so ld could see it), but can't find any information about call-lua except for its presence in the source. I wanted to play around with inter-unit communication and figured that instead of messing with C++ source, I could try to do it in Lua.
My plan was to make MAX_MESSAGES sets of unit ids, each set consisting of observer ids to be notified. Then when some message is sent, it's passed to it's destination (or broadcast) only to units which are in the corresponding set. Retrieval of messages would happen in an additional cob thread, eg. like this:
Code: Select all
MessageLoop() {
while(TRUE) {
while (get MESSAGES_AVAILIBLE) {
get MESSAGE_ID
get MESSAGE_PARAM
// process messages
}
sleep 50;
}
}
Code: Select all
get HOOK_MESSAGE (msg_id)
Code: Select all
get SEND_MESSAGE (msg_id, dest, param1, param2)
I looked at scriptor and its .cfg is made of fail, if it wasn't, I'd rather do something like
Code: Select all
hook-message msg_id;
unhook-message msg_id;
send-message msg_id, destination, param1, param2;
wait-for-message msg_id;
wait-for-any-message;
So, finally, the question is - is it feasible to make messages and/or public vars in Lua, or should I start hacking away at Sim/Units/Cob/? (Hope that somebody wants it, because I don't plan to make a mod, just to hack on something interesting :))