A
Akari
Guest
Of course it was normal script that was later compiled to bytecode. Using this instructions you can implement almost all known constructions in languages. For example Lua language compile...This is a good opportunity to ask more about the AI code and the battle engine. You seem to be suggesting that the AI code is not just some assembly-like scripting language, but was compiled from some other source. What sort of source? If compiled, could some of the 'oddities' of certain scripts (see Ultimate Weapon's HP code) be down to compiler issues? And what *actually* happens to the AI code every frame? Does it just push the battle engine around as a scripting language, or does it get transformed into some intermediate form, like bytecode?Why do you even think about stack. It's now that hard to create some abstraction to be closer to original code.
Example output from my dumper:
Code: [Select]Code:script 1:0x0000 [0x0004 + 0x00] = b(0x00);0x0006 [0x0008 + 0x00] = b(0x00);0x000c [0x0000 + 0x00] = b(0x00);0x0012 JumpIfNotAllFriendsInFrontRow(0x0029);0x001f [0x0008 + 0x00] = b(b[0x0008 + 0x00] & 0x01);0x0029 JumpIfNotAllFriendsInBackRow(0x0040);0x0036 [0x0008 + 0x00] = b(b[0x0008 + 0x00] & 0x02);0x0040 JumpIfNotAllOpponentsInFrontRow(0x0057);0x004d [0x0004 + 0x00] = b(b[0x0004 + 0x00] & 0x01);0x0057 JumpIfNotAllOpponentsInBackRow(0x006e);0x0064 [0x0004 + 0x00] = b(b[0x0004 + 0x00] & 0x02);0x006e JumpIfSelfNotInFrontRow(0x0084);0x007b [0x0000 + 0x00] = b(0x00);0x0081 0x72 JumpTo(0x008a)0x0084 [0x0000 + 0x00] = b(0x01);0x008a JumpIfRandomNot(1/0x03)(0x00c7);0x0092 JumpIf((b[0x0004 + 0x00] & 0x02) != 0x02)(0x00b0);0x009e SetRandomOpponentInBackRowToAttack();0x00ad 0x72 JumpTo(0x00bd)0x00b0 SetRandomOpponentWithLowestCurrentHP();0x00bd [0x000c + 0x00] = h(0x0113);0x00c4 0x72 JumpTo(0x00f9)0x00c7 JumpIf((b[0x0004 + 0x00] & 0x01) != 0x01)(0x00e5);0x00d3 SetRandomOpponentInFrontRowToAttack();0x00e2 0x72 JumpTo(0x00f2)0x00e5 SetRandomOpponentWithLowestCurrentHP();0x00f2 [0x000c + 0x00] = h(0x0112);0x00f9 RunCommand(0x20, h[0x000c + 0x00]);0x00ff 0x73 FinishScript()
Code: [Select]
Code:
y = 5print(y)
Code: [Select]
Code:
LOADK 0 1 ; 5SETGLOBAL 0 0 ; yGETGLOBAL 0 2 ; printGETGLOBAL 1 0 ; yCALL 0 2 1RETURN 0 1 0
And what stranges in Ultima Weapon's script you talking about?
Ai code already bytecode that executed when it's called (when timer filled or when some conditions met).
Last edited: