Author Topic: [PSX/PC] DelingScript  (Read 3013 times)

Shard

  • Insane poster
  • *
  • Posts: 334
  • Karma: 34
    • View Profile
[PSX/PC] DelingScript
« on: 2015-12-21 23:23:18 »
So, I'm making a tool primarily for my use in editing FF8 field scripts that will transform the assembly-like instructions from Deling into a more workable format. I'll be uploading unfinished versions to get feedback and bug reports.

DelingScript v0.3

Instructions
Run the jar file, put the Deling assembly code on the right, click the left arrow.

Lines with _ before them have no conversion yet. Someday they all will. Right now over half the opcodes are supported.

Current features:
  • Converts Deling's assembly-like code to a format with syntax similar to C/Java/Python etc.
  • Converts the script-like syntax back to assembly. Supports all functions.
  • Removes redundant jumps and labels.
  • Removes some dead script code.
  • Allows comments
  • Customizable function names (for all you non-English people).

Planned features:
  • Ability to click or highlight a function and get documentation for what it does.
  • Syntax Highlighting.

It's in early development, so post any features or suggestions you want to see out of it. ALso post any bugs you find, because we all want it to be bug free when it's done.
« Last Edit: 2018-04-24 17:29:16 by Covarr »

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 32
    • View Profile
Re: FF8 Scripting Language
« Reply #1 on: 2015-12-22 00:04:47 »
That's actually pretty handy, since there are already a lot of info about OPcodes, maybe you should add like a hover thing on the codes that also tells what parameters needs to be added. That would fasten workflow while writing new scripts! :)

Sega Chief

  • No life
  • *
  • Posts: 2663
  • Karma: 158
  • These guys is sick
    • View Profile
Re: FF8 Scripting Language
« Reply #2 on: 2015-12-22 14:56:01 »
Translated Op Codes for the FF8 field editor would be great; would be very interested in testing/using it. Is there a compiled list of the translated OpCodes for FF8's field script kept anywhere? I looked at the Wiki, but it seems a bit vague with a lot of them.

paul

  • Crazy poster
  • *
  • Posts: 180
  • Karma: 33
    • View Profile
Re: FF8 Scripting Language
« Reply #3 on: 2015-12-22 17:47:45 »
I had a project that was going to be used for QGears like this:

https://github.com/paulsapps/SUDM

Getting the decompilation step correct is quite difficult though.

Shard

  • Insane poster
  • *
  • Posts: 334
  • Karma: 34
    • View Profile
Re: FF8 Scripting Language
« Reply #4 on: 2015-12-22 18:10:25 »
Translated Op Codes for the FF8 field editor would be great; would be very interested in testing/using it. Is there a compiled list of the translated OpCodes for FF8's field script kept anywhere? I looked at the Wiki, but it seems a bit vague with a lot of them.
Was it this one? That's the most complete list of them. I was able to document about half of them before I lost my mind.

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Re: FF8 Scripting Language
« Reply #5 on: 2015-12-22 22:18:30 »
Coincidentally, I'm working on something similar for FF7. It's progressing fairly well; it'll turn this:

Code: [Select]
UC Disabled=1 //0x0
MENU2 Disabled=1 //0x2
PTURA PartyID=0, Speed=15, Direction=2 //0x4
IFSW BankValue1=2, BankValue2=0, Value1=0, Value2=999, Comparison=2, Offset=16 //0x8 --> 1f
WINDOW WindowID=1, X=67, Y=137, Width=233, Height=73 //0x10
MESSAGE WindowID=1, DialogueID=121 //0x1a
JMPF Offset=14 //0x1d --> 2c
WINDOW WindowID=1, X=39, Y=153, Width=261, Height=57 //0x1f
MESSAGE WindowID=1, DialogueID=120 //0x29
UC Disabled=0 //0x2c
MENU2 Disabled=0 //0x2e
TURNGEN BankRotation=0, Rotation=164, Direction=2, Steps=15, Calculation=2 //0x30

Into this:

Code: [Select]
string sMyoldmanwas = "“My old man was a miner, but\n he couldn't go to work after monsters \n started appearing in the Mythril Mines.”{New Scr}“Now all he does is sit around\n getting drunk in the bar…”";
string sMydadstill = "“My dad still just sits at the\n bar drinking, even though\n he knows Meteor's coming!”{New Scr}“It's sad. Even though he's an adult,\n he just doesn't want to see\n the world as it really is.\n I dunno what to do.”";

EnableMenuAndMove(False);
TurnToPartyMember(0, 15);
if (PPV > 999) {
ShowMessage(67, 137, 233, 73, sMydadstill);
} else {
ShowMessage(39, 153, 261, 57, sMyoldmanwas);
}
EnableMenuAndMove(True);
TurnSmooth(164, Closest, 15);

It'll extract nested if's and while loops from the instructions; I just really need to finish processing all the various opcodes. Shouldn't take too long, since the code structure is the tricky part, and that's mostly done.

Shard

  • Insane poster
  • *
  • Posts: 334
  • Karma: 34
    • View Profile
First non-working version
« Reply #6 on: 2015-12-23 18:13:28 »
Ok, I've "finished" the assembly -> script translation part. Anyone who's curious is free to take a look at it and give suggestions. Especially feature suggestions. This is a very, very early version so it's going to be kinda rubbush :P

DelingScript v0.1

Run the jar file, put the Deling assembly code on the right, click the left arrow.

Oh, and the lines with _ before them mean I haven't converted those yet. Eventually every opcode will be supported. That's just temporary.
« Last Edit: 2015-12-23 18:36:23 by Shard »

Shard

  • Insane poster
  • *
  • Posts: 334
  • Karma: 34
    • View Profile
Re: [FF8] DelingScript
« Reply #7 on: 2016-01-26 00:26:34 »
V0.3 is out. It will convert both ways, and comments in the script are supported. ("//" style)

Not all functions get converted nicely yet. They still work but they look ugly.

I'm mainly looking for bugs at this point. If you convert something back and forth, it should be functionally identical to how it started. If you find a piece of assembly that doesn't convert to how it functionally started, please post the assembly.
« Last Edit: 2016-01-26 00:29:19 by Shard »