Page 1 of 1
RE: Discussion on SWBF2 mission scripts and Lua 5.0
Posted: Wed Nov 09, 2005 2:12 pm
by Leviathan
In my opinion, this thread should be transformed into a sticky, as I think it might become rather useful soon...
Regarding your tries,
Riley', I'd like to know if you have ever used
LuaDC on
SWBF's compiled *.LUA scripts...
Posted: Wed Nov 09, 2005 2:59 pm
by Riley75
So far, LuaDec crashes on SWBF2's scripts.
And it can't be used on SWBF1's scripts, as LuaDec is only for Lua 5.0 (SWBF1 uses 4.0).
I could try building a decompiler for Lua 4.0 I suppose... Way back when, luck3y was considering doing so. I think Nimlot has considered it as well. But that's a matter for the SWBF1 modding forum.
Really Late Edit:
Leviathan, when you said "LuaDC" I was thinking you meant LuaDec.
Yes, as Nimlot says, LuaDC is for 4.0. But as far I know, nobody was ever able to get it to work with SWBF1 scripts. It was built for Homeworld, I think, which I presume uses different settings (probably "double" instead of "float" for numbers). I don't think the source code for it was released, so we couldn't rebuild it with the proper settings.
Posted: Wed Nov 09, 2005 7:40 pm
by Nimlot
LuaDC only works for Lua v4.0, so it would not work with SWBF2.
Posted: Wed Nov 09, 2005 7:43 pm
by Teancum
Ah, but as far as LUA goes, if we used this site and others to find documentation, we may be able to do a LOT more with the BF engine.
Posted: Sat Nov 12, 2005 4:32 pm
by Riley75
Quick note: I'll be updating the original post in this thread periodically, if and when additional information is known.
I've tried looking into why LuaDec crashes on the SWBF2 scripts; and why "luac -l" generates "bad code" errors. It seems like certain instructions have operand values that are invalid. From the limited tests I've run, it seems some of the SUB and ADD instructions have a bad third parameter (the "C" parameter).
The best way I can describe this issue: I suspect that the Lua environment inside SWBF2 makes additional memory addresses available to its Lua code. If that's the case, I don't know how we can deal with that. I'd need to have a better understanding of how Lua byte-code operates, and of how it interacts with its environment.
Posted: Wed Dec 21, 2005 7:25 pm
by Teancum
I've been reading into the documentation you've posted, Riley, and I wonder if we can't add new eras to BF1.... I'm going to look into it over the next while.
Posted: Wed Feb 22, 2006 1:39 am
by guru
Mod tools out! Check download and main page! topic closed.