Author Topic: I HAVE THE EVENT SCRIPT TOLKENS!  (Read 13073 times)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« on: 2004-06-24 11:31:31 »
Good news everyone!

I'm working with lasyan3 and he was able to give me a listing of the Scripting Tolkens (Commands) for the field files.

There are over 200 scripting commands. I don't have thier definitions yet, some are hard to decypher and I haven't even dug through the field files to figure out what section conatins the tokens. (In the PSX version, it's the DAT file, which is split into two parts. The text, and then the script that's executed)

Here's a listing of the scripting commands, you read it like this:

num = name | arg

num is the tolken number (The command code)
name is the name of the command
arg is the legnth of the command including arguments. (For example RET is one command with no arguments, so it's 1)

Here are the commands.....

Code: [Select]

00 = RET | 1
01 = REQ | 3
02 = REQSW | 3
03 = REQEW | 3
04 = PREQ | 3
05 = PRQSW | 3
06 = PRQEW | 3
07 = RETTO | 5
08 = JOIN | 2
09 = SPLIT | 15
0A = SPTYE | 6
0B = GTPYE | 6
0C =  | 0
0D =  | 0
0E = DSKCG | 2
0F = SPECIAL | 2
10 = gotoNext +<1> | 2
11 = gotoNextLong +<2> | 3
12 = gotoPrev -<1> | 2
13 = gotoPrevLong -<2> | 3
14 = if UByte(<1>)[<1>] != <1> then(<1>) goto +<1> | 6
15 = if UByteL(<1>)[<1>] != <1> then(<1>) gotoLong +<2> | 7
16 = if SWord(<1>)[<2>] != <2> then(<1>) goto +<1> | 8
17 = if SWordL(<1>)[<2>] != <2> then(<1>) gotoLong +<2> | 9
18 = if USWord(<1>)[<2>] != <2> then(<1>) goto +<1> | 8
19 = if USWordL(<1>)[<2>] != <2> then(<1>) gotoLong +<2> | 9
1A =  | 0
1B =  | 0
1C =  | 0
1D =  | 0
1E =  | 0
1F =  | 0
20 = MINIGAME | 11
21 = TUTOR | 2
22 = BTMD2 | 5
23 = BTRLD | 3
24 = wait( time=<2> ) | 3
25 = NFADE | 9
26 = BLINK | 2
27 = BGMOVIE | 2
28 = KAWAI | 255
29 = KAWIW | 1
2A = PMOVA | 2
2B = SLIP | 2
2C = BGPDH | 5
2D = BGSCR | 7
2E = WCLS | 2
2F = WSIZW | 10
30 = IF-KEY | 4
31 = IF-KEYON | 4
32 = IF-KEYOF | 4
33 = UC | 2
34 = PDIRA | 2
35 = PTURA | 4
36 = WSPCL | 5
37 = WNUMB | 8
38 = STTIM | 6
39 = GOLD+ | 6
3A = GOLD- | 6
3B = CHGLD | 4
3C = HMPMAX1 | 1
3D = HMPMAX2 | 1
3E = MHMMX | 1
3F = HMPMAX3 | 1
40 = message( window=<1>, dialog=<1> ) | 3
41 = MPARA | 5
42 = MPRA2 | 6
43 = MPNAM | 2
44 =  | 0
45 = MP+ | 5
46 =  | 0
47 = MP- | 5
48 = ASK | 7
49 = MENU | 4
4A = MENU2 | 2
4B = BTLTB | 2
4C =  | 0
4D = HP+ | 5
4E =  | 0
4F = HP- | 5
50 = window( id=<1>, X=<2>, Y=<2>, W=<2>, H=<2> ) | 10
51 = WMOVE | 6
52 = WMODE | 4
53 = WREST | 2
54 = WCLSE | 2
55 = WROW | 3
56 = GWCOL | 7
57 = SWCOL | 7
58 = ST-ITM | 5
59 = DL-ITM | 5
5A = CK-ITM | 5
5B = SM-TRA | 7
5C = DM-TRA | 8
5D = CM-TRA | 10
5E = SHAKE | 8
5F = NOP | 1
60 = MAPJUMP | 10
61 = SCRLO | 2
62 = SCRLC | 5
63 = SCRLA | 6
64 = SCR2D | 6
65 = SCRCC | 1
66 = SCR2DC | 9
67 = SCRLW | 1
68 = SCR2DL | 9
69 = MPDSP | 2
6A = VWOFT | 7
6B = FADE | 9
6C = FADEW | 1
6D = IDLCK | 4
6E = LSTMP | 3
6F = SCRLP | 6
70 = battle | 4
71 = BTLON | 2
72 = BTLMD | 3
73 = PGTDR | 4
74 = GETPC | 4
75 = PXYZI | 8
76 = PLUS! | 4
77 = PLUS2! | 5
78 = MINUS! | 4
79 = MINUS2! | 5
7A = INC! | 3
7B = INC2! | 3
7C = DEC! | 3
7D = DEC2! | 3
7E = TLKON | 2
7F = RDMSD | 3
80 = set byte(<1>)[<1>]=<1> | 4
81 = SET-WORD | 5
82 = BIT-ON | 4
83 = BIT-OFF | 4
84 = BIT-XOR | 4
85 = PLUS | 4
86 = PLUS2 | 5
87 = MINUS | 4
88 = MINUS2 | 5
89 = MUL | 4
8A = MUL2 | 5
8B = DIV | 4
8C = DIV2 | 5
8D = MOD | 4
8E = MOD2 | 5
8F = AND | 4
90 = AND2 | 5
91 = OR | 4
92 = OR2 | 5
93 = XOR | 4
94 = XOR2 | 5
95 = INC | 3
96 = INC2 | 3
97 = DEC | 3
98 = DEC2 | 3
99 = RANDOM | 3
9A = LBYTE | 4
9B = HBYTE | 5
9C = 2BYTE | 6
9D = SETX | 7
9E = GETX | 7
9F = SEARCHX | 11
A0 = PC | 2
A1 = CHAR | 2
A2 = DFANM | 3
A3 = ANIME1 | 3
A4 = VISI | 2
A5 = XYZI | 11
A6 = XYI | 9
A7 = XYZ | 9
A8 = MOVE | 6
A9 = CMOVE | 6
AA = MOVA | 2
AB = TURA | 4
AC = ANIMW | 1
AD = FMOVE | 6
AE = ANIME2 | 3
AF = ANIM!1 | 3
B0 = CANIM1 | 5
B1 = CANM!1 | 5
B2 = MSPED | 4
B3 = DIR | 3
B4 = TURNGEN | 6
B5 = TURN | 6
B6 = DIRA | 2
B7 = GETDIR | 4
B8 = GETAXY | 5
B9 = GETAI | 4
BA = ANIM!2 | 3
BB = CANIM2 | 5
BC = CANM!2 | 5
BD = ASPED | 4
BE =  | 0
BF = CC | 2
C0 = JUMP | 11
C1 = AXYZI | 8
C2 = LADER | 15
C3 = OFST | 12
C4 = OFSTW | 1
C5 = TALKR | 3
C6 = SLIDR | 3
C7 = SOLID | 2
C8 = PRTYP | 2
C9 = PRTYM | 2
CA = PRTYE | 4
CB = IF-PRTYQ | 3
CC = IF-MEMBQ | 3
CD = MMB+- | 3
CE = MMBLK | 2
CF = MMBUK | 2
D0 = LINE | 13
D1 = LINON | 2
D2 = MPJPO | 2
D3 = SLINE | 16
D4 = SIN | 10
D5 = COS | 10
D6 = TLKR2 | 4
D7 = SLDR2 | 4
D8 = PMJMP | 3
D9 = PMJMP2 | 1
DA = AKAO2 | 15
DB = FCFIX | 2
DC = CCANM | 4
DD = ANIMB | 1
DE = TURNW | 1
DF = MPPAL | 11
E0 = BGON | 4
E1 = BGOFF | 4
E2 = BGROL | 3
E3 = BGROL2 | 3
E4 = BGCLR | 3
E5 = STPAL | 5
E6 = LDPAL | 5
E7 = CPPAL | 5
E8 = RTPAL | 7
E9 = ADPAL | 10
EA = MPPAL2 | 10
EB = STPLS | 5
EC = LDPLS | 5
ED = CPPAL2 | 8
EE = RTPAL2 | 8
EF = ADPAL2 | 11
F0 = MUSIC | 2
F1 = Sound | 5
F2 = AKAO | 14
F3 = MUSVT | 2
F4 = MUSVM | 2
F5 = MULCK | 2
F6 = BMUSC | 2
F7 = CHMPH | 4
F8 = PMVIE | 2
F9 = MOVIE | 1
FA = MVIEF | 3
FB = MVCAM | 2
FC = FMUSC | 2
FD = CMUSC | 6
FE = CHMST | 3
FF = GAMEOVER | 1



Now STARTMAP is the first room in the debug room. Yuffie is there and you have that first menu, here is the code for that room as it's really small.

This is the text section.
Code: [Select]

000------------------------------------------------
        NEXT{EOL}
        MENU ON{EOL}
        BATTLE LOCK{EOL}
        BATTLE UNLOCK{EOL}
        MOVIE LOCK{EOL}
        MOVIE UNLOCK{EOL}
        GLOBAL RESET{EOL}
        FULL NAME{EOL}
        NEW START{EOL}
        EXIT{STOP}
001------------------------------------------------
        BACK{EOL}
        SOUND RESET{EOL}
        FULL MATERIA{EOL}
        BATTLE999{EOL}
        EXIT{STOP}
002------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
003------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
004------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
005------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
006------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
007------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
008------------------------------------------------
MMMMMMMMMMMMMMM{STOP}
009------------------------------------------------
WWWWWWWWWWWWWWW{STOP}
00A------------------------------------------------
MMMMMMMMMMMMMMM{STOP}


and this is the script section

Code: [Select]

****** Section n°0 (dic) Script n° 0 ******
000 : PRTYP ( 00 )
002 : RET
003 : RET
                                                                               
****** Section n°0 (dic) Script n° 1 ******
000 : RET
                                                                               
****** Section n°1 (cloud) Script n° 0 ******
000 : CHAR ( 00 )
002 : PC ( 00 )
004 : RET
005 : XYZI ( 00, 00, 00, 00, 00, 00, 00, 00, 01, 00 )
010 : RET
                                                                               
****** Section n°1 (cloud) Script n° 1 ******
000 : RET
                                                                               
****** Section n°2 (tifa) Script n° 0 ******
000 : CHAR ( 01 )
002 : PC ( 02 )
004 : RET
005 : RET
                                                                               
****** Section n°2 (tifa) Script n° 1 ******
000 : RET
                                                                               
****** Section n°3 (cid) Script n° 0 ******
000 : CHAR ( 02 )
002 : PC ( 08 )
004 : RET
005 : RET
                                                                               
****** Section n°3 (cid) Script n° 1 ******
000 : RET
                                                                               
****** Section n°4 (yufi) Script n° 0 ******
000 : CHAR ( 03 )
002 : XYZI ( 00, 00, B6, FF, 7E, FF, 00, 00, 64, 00 )
00D : DIR ( 00, 60 )
010 : SLIDR ( 00, 01 )
013 : RET
014 : RET
                                                                               
****** Section n°4 (yufi) Script n° 1 ******
000 : window( id=01, X=0000, Y=0000, W=008A, H=00A9 )
00A : ASK ( 05, 01, 00, 00, 09, 00 )
011 : gotoNext +15
013 : window( id=01, X=0000, Y=0000, W=0081, H=0059 )
01D : ASK ( 05, 01, 01, 00, 04, 00 )
024 : gotoNextLong +009D
027 : if UByteL(50)[00] != 00 then(00) gotoLong +0007
02E : gotoPrev -1B
030 : gotoNextLong +0090
033 : if UByteL(50)[00] != 01 then(00) gotoLong +000A
03A : SET-WORD ( 20, 1E, 00, 00 )
03F : gotoNextLong +0081
042 : if UByteL(50)[00] != 02 then(00) gotoLong +0008
049 : SPECIAL ( FB )
04B : REQ ( 11, 74 )
04E : RET
04F : if UByteL(50)[00] != 03 then(00) gotoLong +0008
056 : SPECIAL ( FB )
058 : RET
059 : gotoNextLong +0067
05C : if UByteL(50)[00] != 04 then(00) gotoLong +0008
063 : SPECIAL ( FC )
065 : REQ ( 11, 5A )
068 : RET
069 : if UByteL(50)[00] != 05 then(00) gotoLong +0008
070 : SPECIAL ( FC )
072 : RET
073 : gotoNextLong +004D
076 : if UByteL(50)[00] != 06 then(00) gotoLong +0007
07D : SPECIAL ( FE )
07F : gotoNextLong +0041
082 : if UByteL(50)[00] != 07 then(00) gotoLong +0029
089 : SPECIAL ( FD )
08B : RET
08C : REQSW ( 0F, FD )
08F : REQ ( 03, 0F )
092 : CMUSC ( 02, 04, 0F, FD, 03 )
098 : PRQSW ( 0F, FD )
09B : PRQSW ( 06, 0F )
09E : CMUSC ( 06, 07, 0F, FD, 08 )
0A4 : JOIN ( 0F )
0A6 : CMUSC ( 04, 0A, 0F, FD, 07 )
0AC : SPLIT ( 11, 13, 00, 15, 50, 00, 08, 00, 0C, 00, 60, 74, 00, 00 )
0BB : RET
0BC : RET
0BD : RET
0BE : RET
0BF : RET
0C0 : RET
0C1 : RET
0C2 : if UByteL(50)[00] != 00 then(00) gotoLong +0008
0C9 : gotoPrevLong -00C9
0CC : gotoNextLong +0102
0CF : if UByteL(50)[00] != 01 then(00) gotoLong +00DF
0D6 : AKAO ( 00, 00, 00, C0, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
0E4 : AKAO ( 00, 00, 00, A0, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
0F2 : AKAO ( 00, 00, 00, A1, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
100 : AKAO ( 00, 00, 00, A2, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
10E : AKAO ( 00, 00, 00, A3, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
11C : AKAO2 ( 00, 00, 00, C8, FF, 7F, 00, 00, 00, 00, 00, 00, 00, 00 )
12B : AKAO2 ( 00, 00, 00, E4, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
13A : AKAO2 ( 00, 00, 00, B0, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
149 : AKAO2 ( 00, 00, 00, B1, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
158 : AKAO2 ( 00, 00, 00, B2, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
167 : AKAO2 ( 00, 00, 00, B3, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 )
176 : MUSIC ( 00 )
178 : AKAO ( 00, 00, 00, 28, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
186 : AKAO ( 00, 00, 00, 29, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
194 : AKAO ( 00, 00, 00, 2A, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
1A2 : AKAO ( 00, 00, 00, 2B, 3F, 00, 00, 00, 00, 00, 00, 00, 00 )
1B0 : gotoNextLong +001E
1B3 : if UByteL(50)[00] != 02 then(00) gotoLong +000B
1BA : SPECIAL ( F9 )
1BC : SPECIAL ( F9 )
1BE : SPECIAL ( F9 )
1C0 : gotoNextLong +000E
1C3 : if UByteL(50)[00] != 03 then(00) gotoLong +0007
1CA : battle ( 00, E7, 03 )
1CE : MHMMX
                                                                               
****** Section n°4 (yufi) Script n° 2 ******
000 : RET



THANKS LASYAN3!!!!!



Oh, and Gears has been updated.
http://the-afterm.ath.cx/gears/gears.pdf

Oh: One last thing...
Which field file is the first one where the game starts? Not STARTMAP, but where Barret says "C'mon newcomer, follow me"

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
Re: I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #1 on: 2004-06-24 18:17:10 »
Quote from: halkun
Which field file is the first one where the game starts? Not STARTMAP, but where Barret says "C'mon newcomer, follow me"


That would be MD1STIN.

And looking through those scripting commands, it looks like it won't be too hard to figure out the majority of them. At least quite a few. It seems to function very much like working with something like RPG Maker, only without the 'nice' interface...

Topher

  • *
  • Posts: 111
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #2 on: 2004-06-25 02:03:41 »
You never fail to amaze me, halkun.

sfx1999

  • *
  • Posts: 1142
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #3 on: 2004-06-25 02:32:29 »
Uhhh, isn't it tokens?

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #4 on: 2004-06-25 04:49:13 »
At least he didn't call them Tolkiens.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #5 on: 2004-06-25 11:05:47 »
Hehe, sorry, I guess I'm writing out my accent. ^_^

You know, I wish I would of been the one to find them, then I could of named them whatever I want....

trickstar66

  • *
  • Posts: 224
    • View Profile
    • http://radicalgarbage.250free.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #6 on: 2004-06-25 11:11:51 »
Quote from: halkun
Hehe, sorry, I guess I'm writing out my accent. ^_^

You know, I wish I would of been the one to find them, then I could of named them whatever I want....


Halkuns?

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #7 on: 2004-06-25 11:51:30 »
Don't tempt me ^_^

"If you look at halkun 0x28, it has the name "KOWAI" which is Japanese for 'Scary'. If you notice, it has 255 ARGUMENTS which is quite scary indeed"

Seriously, I overslept last night so I didn't get a chance to take a peek at anything last night. I need help finding what sections of the PC field files conatin the even scripts. I need to know what these arguments do too. They aren't exactly jumping out.

Anakin

  • *
  • Posts: 42
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #8 on: 2004-06-25 13:36:50 »
well KAWAI in japanese means "cute" and is a word used for the deformed (field-like) manga characters

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #9 on: 2004-06-26 07:16:45 »
AUGH! I'm so frustrated!

I'm trying to write a program to list/edit/save the script and I remember that I do not have the displine for programming!

I've never programmed file I/O in C before and it's frustrating the pants off me!

For those who want to experiment instead, the script is in the first section of the field file. Just dump that section, find the pointer to the start of the script and start dumping using my tables above. I know it sounds easy, but to me it's a pain.

I'm a writer, not a programmer.

I'm gonna work on gears some more. I'm going to need a code jockey to assist me in defining some of these commands and arguments. I can't do it by myself.

Darkdevil

  • *
  • Posts: 728
    • View Profile
    • Http://darkdevil177.5u.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #10 on: 2004-06-26 09:30:06 »
And what does being a code jockey entail?

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #11 on: 2004-06-26 11:34:47 »
here is some quick tutorial on file reading in c
Code: [Select]

/*
 note to fopen(): file modes are defined usually by two character string
 "rb" means open file for Read in Binary mode.
 r=read w=write b=binary t=text so "wt" means open for Write in Text format
 there are also other possibilites, but they are not used much ... they are mentioned in help :)

 binary commands in simple are:
 fread( pointer_to_data_buffer, 1, sizeof_data, file_handle );
 fwrite( pointer_to_data_buffer, 1, sizeof_data, file_handle );

 fread returns number of bytes read
 fwrite returns number of bytes written

 and text commands:
 fprintf( file_handle, "text text text\n" );
 fgets( buffer, buffer_size, file_handle );

 fprintf prints formatted text to a file
 fgets reads text from file until buffer_size bytes are read or end of line is read, which comes first.
*/

// Example 1
// This proggy will read 10 longs (4byte integers) from binary file
// and write them in human-readable form into text file

#include <stdio.h>  // header for file functions

FILE *fin, *fout;  // file handles
long i, l;

// input is in binary mode
fin = fopen( "somepath\\binary", "rb" );
// output will be in text mode
fout = fopen( "somepath\\text", "wt" );
// if fopen() fails then it returns NULL. So if you want to check if file
// was opened correctly then compare fin and fout to NULL

for( i=0; i<10; i++ ) {
  fread( &l, 1, sizeof( long ), fin );
  fprintf( fout, "Integer # %i. = %i\n", (int) i, (int) l );
}

fclose( fout );
fclose( fin );


Code: [Select]

//one more note
// to make things simplier when reading some complex structure, data can be read into structs too.

// maybe some byte-alignment pragma will be needed here for your compiler to pack the structure correctly without gaps between variables, if compiler's default variable alignment is 8bytes for example. #pragma pack (1) will do the trick for MSVC++

struct {
  long    length;
  float   coords[ 3 ];
} data;

fread( &data, 1, sizeof( data ), fin );

Goku7

  • *
  • Posts: 1301
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #12 on: 2004-06-26 20:51:27 »
And for what its worth, you should look at the code I wrote in Alhexx's Rewritting the FF7 Engine thread, as it contains some file I/0 stuff used for C++.

Though, I can give you a little rundown here as well.  Keep in mind that this is for C++ (not regular C), so don't get this and Mirex's stuff mixed up.

Code: [Select]

#include <fstream>    //needed for fstream file operations

//variable declaration
fstream variable_name;

//syntax for using the fstream file object to open a file
//to READ from. This applies to when the file being load-
//ed is in the same directory as the program.  If file is to
//be opened as ACSII, the "ios::binary" flag is NOT needed.

fstream variable_name("filename.txt", ios::in | ios::binary);

//syntax for opening a file in read mode that is not in the
//same directory as the program.

fstream variable_name("insert_ABSOLUTE_path_to_file_here", ios::in | ios::binary);

//the same syntax applies for files in which you wish to
//open in WRITE mode, except that instead of "ios::in"
//you use "ios::out"

fstream variable_name("filename.txt", ios::out | ios::binary);

//if you plan to APPEND to a file you are writing to,
//you should open it using the "ios::app" flag instead of
//"ios::out" flag.

fstream variable_name("filename.txt", ios::app | ios::binary);

//syntax to close a file -- the fstream object's variable
//name is not destroyed, but IS freed up for you to
//assign to a different file, if I remember correctly.

variable_name.close();


Yeah, I realize both this and what Mirex posted is a lot to digest at once, so I'll wait before going into detail about the ".read" and .write" fstream member functions.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #13 on: 2004-06-26 21:18:55 »
I appricate the help, but I really have 0 intrest in coding. I'm a *writer* (I know, you can't tell by the way I write my posts, but that's becuase I have it "off" right now.)

I code in a language called "Ruby" which is much more simple. I lothe the idea of doing manual memory management unless it's in machine code. Most file I/O requires you to manage some kind of memory buffer and a pointer an I'm not one to hose my memory just to get something the bearly works. I will contine to write Gears and hope that those more apt than I can use it to thier advantage.

Also remeber, my inbox is always open. If you have problems or dicoveroies yourself, I beg you to give me some input. Right now I'm just stuffing the file format stuff at the end until I can get a better gauge of what goes where. I have many other things on my plat I need to do first. The cool thin is if I get frustrated with something, or can't figure it out, I can move on to another. Maybe pushing the bock around in the right way will cause things to fall into order.

I'm gonna table-fy the scripting commands, and then dump the code for all the debug rooms to see what each character was supposed to test. Some of them have dummied out commands which will prove quite useful as we can see what character was supposed to do. I know that each debug room is split up by deveoper. That's what the Japanese characters mean, it's the first character of the deveoper's last name.

Now that I have how to dump the script posted here (In mutiple topics... Sorry!) I invite some of the more adventouous souls to start flipping bits and see how the dubug room is effected.

I'll have everything sorter out in Gears soon enough and that could be a unified resourse.

lasyan3

  • *
  • Posts: 76
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #14 on: 2004-06-26 22:50:34 »
Hum, you probably know it, but just in case, this document talk about the debug room : here
« Last Edit: 2008-03-09 09:58:49 by lasyan3 »

sfx1999

  • *
  • Posts: 1142
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #15 on: 2004-06-27 01:48:59 »
What!?

Memory management? If you are righting something that just reads and dissassembles scripts, you probably do not need to know that much about it. Just have it dump it's output to a file.

Also, you could have it dump it all to the screen and redirect stdout like this:

yourprogram > output.txt

in the command line. If you do not want to overwrite it, just add it to the end, you would do this:

yourprogram >> output.txt

One problem you will have is that there will not be any output to the screen doing this. This works in Linux and Windows, btw. Also, since you use Linux, you can pipe it to less (you can pipe stuff in Windows, but Windows does not have less you have to use more instead):

yourprogram|less

If you have an error and you do not want it to be redirectedto the file, use stderr instead of stdout, like this:

fprintf(stderr,"Error: could not load file %s",filename);

Micky

  • *
  • Posts: 300
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #16 on: 2004-06-28 18:04:24 »
Is this used for magic and weapon rules as well, or are those hardcoded into the kernel? And there are those scripted battles, are they using the same system? That would open the way to something like SCUMM for Final Fantasy...

Cyberman

  • *
  • Posts: 1572
    • View Profile
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #17 on: 2004-06-28 19:07:58 »
Quote from: Micky
Is this used for magic and weapon rules as well, or are those hardcoded into the kernel? And there are those scripted battles, are they using the same system? That would open the way to something like SCUMM for Final Fantasy...

No the engines for each version of FF are different notice FF8 and FF9 for the PSX are all coded using a singular image for the entire data set with a simple engine to read from it.

Each version would need a seperate engine basically FF8 and FF9 are closer than Ff7 and the others.

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #18 on: 2004-06-28 22:35:56 »
Battle is a preprogrammed module. Field can call battle using one commands and three arguments, that's it.

Does battle use the same scripting engine for battle math? I don't think so, but many of these commands are kenrel services. I have yet to map all the data within a magic LZS yet. I'm too buys playing with the event scripter.

The commands available to the field scripter are from the kernel that the field module sits on. I'm still looking at what these commands do. I haven't inserted my own commands into the debug rooms yet. I'm happy with the preset debug configs as they exersize the commands quite well.

When I finish documenting the entire debug system, I'll start tweaking each of the command testers and see what results I get.

Here's an amusing thing:
Some options don't make sense when you use the debug room. That's because the script is doing more "under the hood" than you are lead to believe.

For example, there is a command that gives a really wierd amount of gil. Actully it's not wierd at all. What the command really did was give two different amounts of gil right after another. It was a tester for the GOLD+ command and the result was to make sure the kernel added the amounts right to create a total.

Other times you character is found stuck in a all, that's because the script simply did a JUMPMAP with no location arguments. I'm sure the event programmer was just making sure the map loaded with no errors. It's trivial to change the JUMPMAP data to make the player appear on the walkmesh so you can walk around. Why though. It was understood that the walkmesh worked.

This is sooo cool ^_^

Darkdevil

  • *
  • Posts: 728
    • View Profile
    • Http://darkdevil177.5u.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #19 on: 2004-06-29 09:02:01 »
There is also a "tester battle" against 5 pyramids that give insane amounts of experiance each battle ( took me up over 40 levels in one go, And mastered 14 peices of materia)) I beleive this, like the gil+ command, Is a testing prog for Exp and AP.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #20 on: 2004-06-29 09:27:10 »
Well, kinda. That is battle #999 called thusly....

BATTLE (00, 999) (in decimal, it's really 00, E7, 03)

What happens in the 999 battle is outside of the scritping language, as the program is now in the battle module and the field module is no longer in memory. That's not to say the lower-level kernel fuctions are available, but those arn't called with the field commands anyomre as they are not accessable.

Darkdevil

  • *
  • Posts: 728
    • View Profile
    • Http://darkdevil177.5u.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #21 on: 2004-06-29 10:28:44 »
So all the battle commnds, summons, materia and items are in the basic kernal?

Perhaps if this is true, we could link back to the files they come from...

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #22 on: 2004-06-29 11:58:02 »
No the battle system has a seperite scripting system. The kernel provides "hooks" into the core system. For example, to play a sound in the event system you use thge AOKI and AOKI2 commmands. These in tern call a kernel function that takes the data, does the lookups for what sound is wanted and talks to the PSX's hardware.

The is no ability to call AOKI from battle, but there might be a battle script command that does the same thing, there may not be. Battle might just say "play sound xxx" which then you don't need all the extra stuff like repeat, balance, and volume that AOKI controls, it might be handeld automataclly by the battle engine. The fact remains that battle still needs to call the lower lever kernel fuction to make the sound play. I don't know that the command both in battle or in the kernel. I *bearly* know how AOKI works, but I'm getting better.

If you have having flights of fancy about making FF1 with the FF7 system, by all means keep dreaming. However there are things hardwired into the system you can't change. The materia system is hard-coded. You may be able to change the attributes of a particular materia, but not how it links to a character. It will always be a slot in armor or weapons.

On the same note, even though it's a eariler version of FF8's engine, You are not going to be importing FF8 characters in FF7. The graphic systems are radically different. For example in FF8, you could have mutiple texture sizes for the same character, and it could store more than one background/walkmesh in a single field file.

trickstar66

  • *
  • Posts: 224
    • View Profile
    • http://radicalgarbage.250free.com
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #23 on: 2004-06-29 12:03:23 »
It still puzzles me as to why you haven't at least renamed this misspelled thread... :)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
I HAVE THE EVENT SCRIPT TOLKENS!
« Reply #24 on: 2004-06-29 12:04:59 »
Misspleelings are my trademark. I'm better than I used to be. Qhimm used to actually edit my posts for readability