[q2x] OT: Lua questions

Brian Hook hook_l at pyrogon.com
Fri Jan 30 20:28:05 EST 2004


> You may be able to do this with coroutines and a line hook. We have
> a debugger that can single step.

The various hooks seem to induce a large amount of overhead.  If 
anything, I'd try to do it only during branches (which is how most 
MUDs do it).

> You can do this with metatables.

That's a run time thing, not compile time.

> There is a posix regex library. Have a look in the Lua addons on
> the wiki.

Hmmm, I missed that somehow.  

> BTW I've almost got the flyer converted over to Lua in q2x. 

They not keep you busy up at that studio? =)

> written a Python script to generate an auto binding wrapper for the
> q2x stuff. Even after the refactoring Quake seems quite hardcoded.

It is still very hardcoded, and it's not done being refactored.

> I think that's how you envisaged it though Brian, that Lua would
> just bind to a stub which is the game DLL. Then the monster scripts
> and config live in the game. (Oh, Lua is a DLL as well now, which
> links with game exe and game DLL. They all share the same Lua
> state.) This way you could write monsters in Lua or C. I think it's
> going to be too much work for me to convert all of the monsters
> over to Lua so I may ask to check it all in after 2-3 of them and
> ask for help. i.e. some will be Lua and some C.

I was actually envisioning 100% of the game logic in Lua, like this:

gamex86.dll => gameluax86.dll

Same interface, so the server doesn't notice any change, it's just 
talking to the Lua subsystem.  The Lua subsystem, however, talks to 
all its own Lua modules, and provides entry points for the Lua stuff 
to do heavy-lifting, i.e. kernel traps.

Brian





More information about the q2x mailing list