Author Topic: Script question  (Read 6150 times)

kruci

  • *
  • Posts: 105
    • View Profile
Script question
« on: 2007-11-15 20:25:46 »
I didnt find info how scripts works...

I was searching for fix for my "default run"
but I ended in skript actions...

as this..
this is skript of objekt(person), whitch move to Cloud, with speed MSPED ( 00, 00, 10/4 )
If I change those MSPED values, it works, but not from begin, it works after I press CANCEL for first time.
(dont work from begin, becouse default values somewhere?)

the question is
how game jump to those scripts Section n°12 (nara2) Script n° 3/4 ?
those skripts works with CANCEL pressed/relased... so CANCEL is trigger?
(I readed somewhere that Script n° 2 is for pressing X button)

Code: [Select]
****** Section n°12 (nara2) Script n° 0 ******
000 : [A1 07] - CHAR ( 07 )
002 : [7E 01] - TLKON ( 01 )
004 : [C7 01] - SOLID ( 01 )
006 : [A4 00] - VISI ( 00 )
008 : [16 60 00 00 D7 01 00 1A] - if SWord(60)[0000] != 01D7 then(00) goto 28
010 : [16 20 00 00 C9 01 03 12] - if SWord(20)[0000] != 01C9 then(03) goto 28
018 : [A5 00 00 99 04 44 0F 00 00 76 01] - XYZI ( 00, 00, 99, 04, 44, 0F, 00, 00, 76, 01 )
023 : [7E 00] - TLKON ( 00 )
025 : [C7 00] - SOLID ( 00 )
027 : [A4 01] - VISI ( 01 )
029 : [00] - RET
02A : [C7 01] - SOLID ( 01 )
02C : [16 60 00 00 D7 01 00 0D] - if SWord(60)[0000] != 01D7 then(00) goto 3F
034 : [16 20 00 00 C9 01 03 05] - if SWord(20)[0000] != 01C9 then(03) goto 3F
03C : [AA 01] - MOVA ( 01 )
03E : [12 02] - gotoPrev 3C
040 : [00] - RET

****** Section n°12 (nara2) Script n° 1 ******
000 : [33 01] - UC ( 01 )
002 : [4A 01] - MENU2 ( 01 )
004 : [2F 01 6F 00 00 00 51 00 19 00] - WSIZW ( 01, 6F, 00, 00, 00, 51, 00, 19, 00 )
00E : [40 01 05] - message( window=01, mes=05 )
011 : [33 00] - UC ( 00 )
013 : [4A 00] - MENU2 ( 00 )

****** Section n°12 (nara2) Script n° 2 ******
000 : [00] - RET

****** Section n°12 (nara2) Script n° 3 ******
000 : [B2 00 00 10] - MSPED ( 00, 00, 10 )
004 : [00] - RET

****** Section n°12 (nara2) Script n° 4 ******
000 : [B2 00 00 04] - MSPED ( 00, 00, 04 )
004 : [00] - RET


And by the way...
do anyone know, where are submarine mingame text, and gender of chocobo text(male/female)?
(they arent easy to found, so I ask... cant find nowhere, and debugger sometimes crashed... so I neeeed debug more, but I failed.. debuder crashed... ...:P)
« Last Edit: 2007-11-16 19:43:19 by kruci »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Script qustion
« Reply #1 on: 2007-11-16 15:05:44 »
I don't know what are you talking about, but scripts can be started with a lot of ways.

System: scripts can be started with some actions. OnTalk, OnEnter, OnCollide and some other actions tried to run scripts. This can be ignored though, if script with this or higher priority already runned.

Scripts: script also can be started from other scripts with opcodes REQ, REQSW, REQEW, PREQ, PRQSW, PREW, RETTO.

kruci

  • *
  • Posts: 105
    • View Profile
Re: Script qustion
« Reply #2 on: 2007-11-16 17:48:13 »
My short explanation failed:P
Thanks for some info.

My problem.
I changed in FF7.exe walking for running, but I think that game dont know that I did it.
so...
some situation as in Jail, where is Person, which follow you after enter to this area.
With my Run mode, this person dont run, but walk.(becouse game dont know that you are running)
If I press CANCEL, I walk, and this person run.

So.. I managed, that this run change is in script
I need find, what call script  ****** Section n°12 (nara2) Script n° 3 ******
and where are default values for those person move speed.
If change of CANCEL call this script, dont exist easy fix. Else ...

In script I didnt find what this script call(maybe I was looking bad, so I asked for some script calling info).

(problems are in more places, but only this I tested myself...)

Akari

  • *
  • Posts: 766
    • View Profile
Re: Script qustion
« Reply #3 on: 2007-11-16 19:07:54 »
My short explanation failed:P
Thanks for some info.

My problem.
I changed in FF7.exe walking for running, but I think that game dont know that I did it.
so...
some situation as in Jail, where is Person, which follow you after enter to this area.
With my Run mode, this person dont run, but walk.(becouse game dont know that you are running)
If I press CANCEL, I walk, and this person run.

So.. I managed, that this run change is in script
I need find, what call script  ****** Section n°12 (nara2) Script n° 3 ******
and where are default values for those person move speed.
If change of CANCEL call this script, dont exist easy fix. Else ...

In script I didnt find what this script call(maybe I was looking bad, so I asked for some script calling info).

(problems are in more places, but only this I tested myself...)

Manual running is hardcoded. MSPED only changes speed for MOVE-type opcodes. When you press run button movement speed set to another value. RIN/WALK animation switch is hardcoded and depends on walking speed.

What do you mean by "I changed in FF7.exe walking for running" you changed something in binary? or you just change field script?

kruci

  • *
  • Posts: 105
    • View Profile
Re: Script qustion
« Reply #4 on: 2007-11-16 19:57:53 »
I changed it in ff7.exe
I changed two jumps. Switched animation and wallking speed. So character run, but game dont know that hes running.
Those are two switch, both depend on "CANCEL" pressed.
http://forums.qhimm.com/index.php?topic=7022.msg86742#msg86742


script which I posted is whole script for object NARA2 (I edited it, it wasnt whole:P)
Script n° 0 test something and then move to Cloud...
Script n° 1 is useless.. only Talk action...
Script n° 3 called on ?? run MSPED ( 00, 00, 10 )
Script n° 4 called on ?? walk  MSPED ( 00, 00, 4 )

... if I change MSPED values, object NARA2 is still walking after me, but If I press CANCEL,... from now its behave right(if Cloud walk, it walk, if I run it run)
So, Script n° 3 is on CANCEL pressed? Script n° 4 on CANCEL relased?
I want find what starts those script to know that my ideas on unreal easy fixing are right:P
« Last Edit: 2007-11-16 20:02:55 by kruci »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Script question
« Reply #5 on: 2007-11-17 03:39:51 »
Give me map name. I look at scripts myself.

kruci

  • *
  • Posts: 105
    • View Profile
Re: Script question
« Reply #6 on: 2007-11-17 11:39:50 »
its Jail2


Dont care about this much, I have higher priority on finding submarine minigame text(Mission Complete, Mission Incomplete,...) and chocobo gender text(Male/Female)
« Last Edit: 2007-11-17 12:38:32 by kruci »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Script question
« Reply #7 on: 2007-11-19 13:15:32 »
Script n° 3 called on ?? run MSPED ( 00, 00, 10 )
Script n° 4 called on ?? walk  MSPED ( 00, 00, 4 )

This scripts called from "sp" entity.

RET ()
IFUWL (60,00,00,D7,01,00,31,00)
IFUWL (20,00,00,C9,01,03,28,00)
SETBYTE (50,05,00)
IFKEY (40,02,19)
REQ (0C,43) <========================= HERE
IFUBL (50,05,00,00,13,00)
IFKEY (40,02,03)
JMPFL (09,00)
REQ (0C,64) <========================= HERE
SETBYTE (50,05,01)
JMPBL (15,00)
JMPBL (23,00)
RET ()

kruci

  • *
  • Posts: 105
    • View Profile
Re: Script question
« Reply #8 on: 2007-11-20 17:58:25 »
actualy I tested it, reported it, and then deleted it before...
becouse.... for the first time I did mistake...(modifing bad file), so I thought its wrong, so I deleted report..
for second time it didnt worked properly if I changed it ... so I didnt report it again...
it worked... but it only destroyed run of this nara2 object... swaping REQ maked its always walk...

I thought that it is there, but....

IF-KEY ( 40, 02, 19 ) according to wiki opcodes should not be CANCEL triger.
Or I am wrong? what is USHORT bit field? 0x4002 or 0x240? Little or big endian...?
Ok , it must be 0x4002, wiki dont say what is 0x2 so I was confused.

REQ (0C,43) , REQ (0C,64)
so the question is what REQ means... ok 0xC is nara script, but others?
P / F  = priority/function = Bit[3]/Bit[5]= 43 = 1/01011 -> what call this? what is func with ID 11?
64 = 10/00000             -> this call MOVA? (nara2) Script n° 0?
I thought that those call changing speed of moving... but I was wrong?


hmm, maybe I misunderstand those function, so thats why I did wrong modifing...

maybe I shouldnt look to wiki to much... some informations are realy confusing...

OK, thanks .... Its is sure script releted and I dont want change scripts....(becouse its not easy solution...)

Akari

  • *
  • Posts: 766
    • View Profile
Re: Script question
« Reply #9 on: 2007-11-20 20:07:29 »
REQ (0C,43) , REQ (0C,64)
so the question is what REQ means... ok 0xC is nara script, but others?
P / F  = priority/function = Bit[3]/Bit[5]= 43 = 1/01011 -> what call this? what is func with ID 11?
64 = 10/00000             -> this call MOVA? (nara2) Script n° 0?
I thought that those call changing speed of moving... but I was wrong?

This is hex value so
43 = 010/00011 script 3
64 = 011/00100 script 4

MOVA is moving towards entity with given ID.

kruci

  • *
  • Posts: 105
    • View Profile
Re: Script question
« Reply #10 on: 2007-11-21 16:58:36 »
yeah thanks,
very lame from me:P
... that was confusion from my decimal reading of hex numbers...

I try play with it little later... I try keep priority.... maybe this was mistake..