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...
Discussion on SWBF2 mission scripts and Lua 5.0 (FAQ)
Moderator: Moderators
-
- Missing Jedi Admin
- Posts: 3277
- Joined: Fri Nov 12, 2004 2:54 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
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.
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.
Last edited by Riley75 on Wed Nov 09, 2005 8:18 pm, edited 1 time in total.
- Nimlot
- Jedi Admin
- Posts: 103
- Joined: Wed Oct 20, 2004 9:35 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
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.
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.
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana