Lua decompiler? |
Sat, 14 September 2013 18:32 |
asmcint
Messages: 48 Registered: September 2013 Location: U.S.A.
|
Member |
|
|
So, I tried to tinker around with some of the .lua files... But then I remembered my freeware hex editor sucks ass, and I'm not any good with Hex in the first place. I have some small measure of competence with Lua, but I have no means of reading the files IN Lua. So... Is there any good decompiler or similar program that will allow me to view quest scripts and the like in plaintext?
To whomever designed the map of Mistpeak Valley to look so much more simple than the actual level is: May the Archangel Michael descend from the heavens and plant his boot squarely between your legs for your asshattery.
|
|
|
|
|
Re: Lua decompiler? |
Sun, 15 September 2013 07:59 |
asmcint
Messages: 48 Registered: September 2013 Location: U.S.A.
|
Member |
|
|
Welp, thanks anyway, then. I guess I'll just have to either wait, or figure out what the fuck I'm doing with a hex editor.
To whomever designed the map of Mistpeak Valley to look so much more simple than the actual level is: May the Archangel Michael descend from the heavens and plant his boot squarely between your legs for your asshattery.
|
|
|
|
Re: Lua decompiler? |
Sun, 15 September 2013 13:09 |
asmcint
Messages: 48 Registered: September 2013 Location: U.S.A.
|
Member |
|
|
Quote:and second (not sure if that script used at all)
ai\combatstyles\fable2legacycombatstyles.lua
Pretty sure some of them are still used by Fable III enemies, but not all of them.
EDIT: Also, since there is no file labeled as being combat styles for the Hero, I think it's safe to assume that the Hero's combat style falls under uniquecombatstyles.lua, which makes sense when you consider that your finishing moves are unlocked as you increase in strength and stature, and as a result every set of finishing moves that you can have is unique to each combination of stats.
To whomever designed the map of Mistpeak Valley to look so much more simple than the actual level is: May the Archangel Michael descend from the heavens and plant his boot squarely between your legs for your asshattery.
[Updated on: Sun, 15 September 2013 19:41] Report message to a moderator
|
|
|
Re: Lua decompiler? |
Mon, 16 September 2013 06:21 |
Keshire
Messages: 137 Registered: August 2013
|
Senior Member |
|
|
Artofeel wrote on Sun, 15 September 2013 11:56Keshire
Can I post some of the decompiled scripts? Just for modding and for examples.
I'm not sure because of rule number 4
Have at it. chunkspy outputs are not original files.
I wouldn't even consider rewritten or decompiled scripts original files.
And editing the compiled scripts via hex editor will only take you so far. The only thing I would use it for is to circumvent the DLC checks. Anything else I'd rather just attempt to rewrite it myself. Definitely not for the faint of heart though.
There IS a fable 2 decompiler. Because it doesn't use KoreVM. It's good to take a look at the Fable 2 scripts if you have them handy because a lot of the scripts are the same between the two games. Just compiled between normal lua and koreVM lua.
http://fable2mod.com/forums/forum.php?req=thread&postid= 249
Thankfully, Fable 3 doesn't have a problem with plaintext uncompiled LUA. Otherwise we'd really be screwed.
[Updated on: Mon, 16 September 2013 06:28] Report message to a moderator
|
|
|
Re: Lua decompiler? |
Mon, 16 September 2013 07:27 |
asmcint
Messages: 48 Registered: September 2013 Location: U.S.A.
|
Member |
|
|
Yep. We're also kinda lucky that they actually put plaintext, uncompiled lua in copies of certain files. Like scriptactivation.lua.
To whomever designed the map of Mistpeak Valley to look so much more simple than the actual level is: May the Archangel Michael descend from the heavens and plant his boot squarely between your legs for your asshattery.
|
|
|
|
|
|
Re: Lua decompiler? |
Tue, 17 September 2013 05:20 |
Keshire
Messages: 137 Registered: August 2013
|
Senior Member |
|
|
Artofeel wrote on Mon, 16 September 2013 23:31Keshire wrote on Tue, 17 September 2013 03:41
0450 0000000C [0268] getglobal 0 0 ; CombatStyles
0454 00500086 [0269] getfield_r1 0 0 80 ; Dog
0458 01000078 [0270] closure 1 0 ; 0 upvalues
045C 0001BE1E [0271] setfield 0 95 1 ; TargetScoringFunction
Should be CombatStyles.Dog:TargetScoringFunction() I think.
not like this?
CombatStyles.Dog.TargetScoringFunction = function()
end
anyway, this is simple, function code is complicated
Nope there is only one function is that lua. The rest is just command after command, table after table.
5224 ** function [0] definition (level 2)
** start of function **
source name: d:\\Pulse\\work\\f3-daily-build-PC\\Deploy\\Fable2_win32\\data\\scripts\\AI\\CombatStyles\\UniqueCombatStyles.lua
524F E3000000 line defined (227)
5253 FA000000 last line defined (250)
5257 00 nups (0)
5258 02 numparams (2)
5259 00 is_vararg (0)
525A 08 maxstacksize (8)
* code:
525B 25000000 sizecode (37)
525F 02000032 [01] loadk 2 0 ; 1
5263 0301000C [02] getglobal 3 1 ; Dog
5267 03020686 [03] getfield_r1 3 3 2 ; GetMaster
526B 04030000 [04] getfield 4 0 3 ; Combatant
526F 03020404 [05] call_i 3 2 2
5273 04040710 [06] self 4 3 260 ; "IsAlive"
5277 0402047E [07] call_i_r1 4 2 2
527B 04000002 [08] test 4 0 ; to [10] if true
527F 00120039 [09] jmp 19 ; to [29]
5283 0405000C [10] getglobal 4 5 ; Carrying
5287 04060886 [11] getfield_r1 4 4 6 ; IsCarryingRangedWeapon
528B 0500060E [12] move 5 3
528F 04020404 [13] call_i 4 2 2
5293 0500001A [14] loadbool 5 0 0 ; false
5297 0605000C [15] getglobal 6 5 ; Carrying
529B 06070C86 [16] getfield_r1 6 6 7 ; IsAvailable
529F 0700020E [17] move 7 1
52A3 06020404 [18] call_i 6 2 2
52A7 06000002 [19] test 6 0 ; to [21] if true
52AB 00040039 [20] jmp 5 ; to [26]
52AF 0605000C [21] getglobal 6 5 ; Carrying
52B3 06060C86 [22] getfield_r1 6 6 6 ; IsCarryingRangedWeapon
52B7 0700020E [23] move 7 1
52BB 06020404 [24] call_i 6 2 2
52BF 05000C0E [25] move 5 6
52C3 01050808 [26] eq 1 4 5 ; to [28] if false
52C7 00000039 [27] jmp 1 ; to [29]
52CB 0208054C [28] mul 2 2 264 ; 5
52CF 0409000C [29] getglobal 4 9 ; GUI
52D3 040A0886 [30] getfield_r1 4 4 10 ; IsEntityOnScreen
52D7 0500020E [31] move 5 1
52DB 04020404 [32] call_i 4 2 2
52DF 04000002 [33] test 4 0 ; to [35] if true
52E3 00000039 [34] jmp 1 ; to [36]
52E7 020B054C [35] mul 2 2 267 ; 3
52EB 02000412 [36] return 2 2
52EF 00000212 [37] return 0 1
* constants:
52F3 0C000000 sizek (12)
52F7 03 const type 3
52F8 0000803F const [0]: (1)
52FC 04 const type 4
const [1]: "Dog"
5305 04 const type 4
const [2]: "GetMaster"
5314 04 const type 4
const [3]: "Combatant"
5323 04 const type 4
const [4]: "IsAlive"
5330 04 const type 4
const [5]: "Carrying"
533E 04 const type 4
const [6]: "IsCarryingRangedWeapon"
535A 04 const type 4
const [7]: "IsAvailable"
536B 03 const type 3
536C 0000A040 const [8]: (5)
5370 04 const type 4
const [9]: "GUI"
5379 04 const type 4
const [10]: "IsEntityOnScreen"
538F 03 const type 3
5390 00004040 const [11]: (3)
* functions:
5394 00000000 sizep (0)
* lines:
5398 25000000 sizelineinfo (37)
[pc] (line)
539C E4000000 [01] (228)
53A0 E5000000 [02] (229)
53A4 E5000000 [03] (229)
53A8 E5000000 [04] (229)
53AC E5000000 [05] (229)
53B0 E8000000 [06] (232)
53B4 E8000000 [07] (232)
53B8 E8000000 [08] (232)
53BC E8000000 [09] (232)
53C0 E9000000 [10] (233)
53C4 E9000000 [11] (233)
53C8 E9000000 [12] (233)
53CC E9000000 [13] (233)
53D0 EA000000 [14] (234)
53D4 EB000000 [15] (235)
53D8 EB000000 [16] (235)
53DC EB000000 [17] (235)
53E0 EB000000 [18] (235)
53E4 EB000000 [19] (235)
53E8 EB000000 [20] (235)
53EC EC000000 [21] (236)
53F0 EC000000 [22] (236)
53F4 EC000000 [23] (236)
53F8 EC000000 [24] (236)
53FC EC000000 [25] (236)
5400 EF000000 [26] (239)
5404 EF000000 [27] (239)
5408 F0000000 [28] (240)
540C F5000000 [29] (245)
5410 F5000000 [30] (245)
5414 F5000000 [31] (245)
5418 F5000000 [32] (245)
541C F5000000 [33] (245)
5420 F5000000 [34] (245)
5424 F6000000 [35] (246)
5428 F9000000 [36] (249)
542C FA000000 [37] (250)
* locals:
5430 06000000 sizelocvars (6)
local [0]: attacker_info
5446 00000000 startpc (0)
544A 24000000 endpc (36)
local [1]: target
5459 00000000 startpc (0)
545D 24000000 endpc (36)
local [2]: multiplier
5470 01000000 startpc (1)
5474 24000000 endpc (36)
local [3]: master
5483 05000000 startpc (5)
5487 24000000 endpc (36)
local [4]: master_ranged
549D 0D000000 startpc (13)
54A1 1C000000 endpc (28)
local [5]: target_ranged
54B7 0E000000 startpc (14)
54BB 1C000000 endpc (28)
* upvalues:
54BF 00000000 sizeupvalues (0)
** end of function **
Also, if you didn't know already. The scripts in the other gamescript bank contain debug data for locals, and start/stop lines.
[Updated on: Tue, 17 September 2013 05:21] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Lua decompiler? |
Fri, 18 September 2015 07:35 |
TheGeniusSavant
Messages: 68 Registered: September 2015
|
Member |
|
|
Well... I dug a little deeper... I think this is the offending code... now to figure out how to disable it and either recompile it or rewrite it to work without...
039B 0606005C [176] newtable 6 0 6 ; array=0, hash=6
039F 0738000C [177] getglobal 7 56 ; EScriptableAction
03A3 07390E86 [178] getfield_r1 7 7 57 ; LOOP
03A7 06076E1E [179] setfield 6 55 7 ; Type
03AB 073B000C [180] getglobal 7 59 ; EActionPriority
03AF 073C0E86 [181] getfield_r1 7 7 60 ; PRIORITY_INTERACTION
03B3 0607741E [182] setfield 6 58 7 ; Priority
03B7 0703005C [183] newtable 7 0 3 ; array=0, hash=3
03BB 0838000C [184] getglobal 8 56 ; EScriptableAction
03BF 083E1086 [185] getfield_r1 8 8 62 ; DIG
03C3 07086E1E [186] setfield 7 55 8 ; Type
03C7 07407F1E [187] setfield 7 63 320 ; Anim "DigInto"
03CB 07033E1E [188] setfield 7 31 3 ; Spade
03CF 06077A1E [189] setfield 6 61 7 ; IntoAction
03D3 0703005C [190] newtable 7 0 3 ; array=0, hash=3
03D7 0838000C [191] getglobal 8 56 ; EScriptableAction
03DB 083E1086 [192] getfield_r1 8 8 62 ; DIG
03DF 07086E1E [193] setfield 7 55 8 ; Type
03E3 07427F1E [194] setfield 7 63 322 ; Anim "DigLoop"
03E7 07033E1E [195] setfield 7 31 3 ; Spade
03EB 0607821E [196] setfield 6 65 7 ; LoopAction
03EF 0702005C [197] newtable 7 0 2 ; array=0, hash=2
03F3 0838000C [198] getglobal 8 56 ; EScriptableAction
03F7 08441086 [199] getfield_r1 8 8 68 ; PLAY_ANIMATION
03FB 07086E1E [200] setfield 7 55 8 ; Type
03FF 07057E1E [201] setfield 7 63 5 ; Anim
0403 0607861E [202] setfield 6 67 7 ; OutOfAction
0407 06468B1E [203] setfield 6 69 326 ; NumLoops 1
|
|
|