I know... Double post, but it's an important announcement that's worthy of a bump. I just uploaded the beginnings of a fieldscript dumper into SVN. It can be found under the /utils directory off the main tree.
You can see it
hereI started coding at 3 in the afternoon and went until four in the morning, by looking at my comments you sould be able to tell two things.
1) General program flow
2) How punch drunk I get after coding after 2am.
I make no apologies for the code. I haven't touched C in almost 8 years, so it's pretty bad. Oh and it's gonna get worse! ^_^
The output fieldscript is designed so that if a compilier is created, it can parse the output. I have everything but the actual dumper coded. All that's really missing is the
dumpscript(int addr); function that takes an offset in the field file and starts writing out opcodes.
Of course, most likely you are going to need to pass more than just the address, you will probably need the pass the entity names, offset the the dialog strings, and other goodies as I totaly horked up my varible scope. I wish I could of used a struct, but some of the entity data is dynamic.
The field script will look like this when finished...
# Final Fantasy 7 Field Script
# Original Name: startmap
# Created by: hiroki
#
# Internal filename: startma
#
#################### Entity 0 (dic) ####################
entity dic (script 0)
{
prtyp(0)
ret
ret
}
entity dic (script 1)
{
ret
}
alias dic (script 1 to 31)
#################### Entity 1 (cloud) ####################
entity cloud (script 0)
{
char(0)
pc(0)
ret
xyzi(00,00,00,00,00,00,00,00, 01,00 )
ret
}
entity cloud (script 1)
{
ret
}
alias cloud (script 1 to 31)
#################### Entity 2 (tifa) ####################
entity tifa (script 0)
{
.......
Commands that use conditionals will have blocks of code
ifubytel(<5>[15] == 12)
{
special (250)
ret
JmpLong lbl_014:
}
Just a heads up...