Author Topic: Understanding the LINE field op code  (Read 4071 times)

dangarfield

  • *
  • Posts: 30
    • View Profile
Understanding the LINE field op code
« on: 2020-09-08 17:03:38 »
Hi,

I'm just playing around LINE field op code (0xD0) and have a few questions about the game behaviour.
I'll update this after:
http://wiki.ffrtt.ru/index.php?title=FF7/Field/Script/Opcodes/D0_LINE

There are generally 6 scripts (other than the init and main) if the entity is a LINE (taken from Makou Reactor):

  script index 2 -> S1 - [OK]
  script index 3 -> S2 - Move
  script index 4 -> S3 - Move
  script index 5 -> S4 - Go
  script index 6 -> S5 - Go 1x
  script index 7 -> S6 - Go away

[OK]
Occurrences - This is often present, but mostly contains a single RET op code.
Behaviour - I'm sure this is triggered when the player is close to the line and presses the [OK] button, eg blin59

Move
 - Occurrences
The script index 2 Move is often present, but again mostly contains a single RET op code.
The script index 3 Move is not often present but when it is, the script index 2 typically isn't, again, always ends with a RET.
There are 11 occurrences when both index 2 & 3 Move are present and both have more than one single RET op code.
10 of these contain exactly the same ops in both (fields - hyou4, hyou5_4)  - A REQEW and a RET with exactly the same params. Every one of these leads to a MAPJUMP.
1 of these (field - del12) contains 2 ops in the index 2 Move script (UC,MENU, and no RET). The index 3 Move script contains 11 ops including a final RET op

As a result of the above, I believe that it is relatively safe to assume the following logic:

 - Behaviour
This is triggered every time the player is close to the line.
If the index 2 Move is present, it executes until it receives a RET or finishes all of the ops, then
If the index 3 Move is present, it executes until it receives a RET or finishes all of the ops.

Go
Occurrences - This is often present, and always contains a final RET op code.
Behaviour - I'm sure this is triggered every time the player leaves the line

Go 1x
Occurrences - This is occasioanlly present, and always contains a final RET op code.
Behaviour - I'm sure this is triggered when the player leaves the line, but only once for the duration of the time in the field. Come examples are doors remaining open after they are programmatically triggered. bugin2.

Go away
Occurrences - Can be present alongside Go and Go 1x. Always contains a final RET op code.
Behaviour - Very similar to Go, but the distance that the player has to be away from the point is large (maybe 4x). Examples are the jumps on las0_6

It's worth noting that any combination of Go, Go 1x and Go away can be present an executable on any script.

Here is a JSON file containing a little more details on the occurrences, frequencies and combinations of the LINE op code usage: https://github.com/dangarfield/ff7-fenrir/blob/master/workings-out/output/line-occurences.json


Updates:
- Updated Move occurrences and behaviour- Should be final
- Updated Go, Go 1x & Go Move - Should be final

No further updates required.

Thanks,
Dan Garfield
« Last Edit: 2020-09-09 19:25:04 by dangarfield »

dangarfield

  • *
  • Posts: 30
    • View Profile
Re: Understanding the LINE field op code
« Reply #1 on: 2020-09-09 16:24:43 »
After investigation, I've updated the points above and will update the wiki too: http://wiki.ffrtt.ru/index.php?title=FF7/Field/Script/Opcodes/D3_SLINE

If you have any further insights, please reply or update the wiki.

Thanks

Akari

  • *
  • Posts: 766
    • View Profile
Re: Understanding the LINE field op code
« Reply #2 on: 2020-11-19 07:45:09 »
Line run scripts by this events:
script 1 - if PC talk to line
script 2 - if PC move towards line (with solid radius)
script 3 - if PC cross the line (position of entity cross the line by moving)
script 4 - if PC move inside line (any directions) (with solid radius)
script 5 - if PC enter the line (with solid radius)
script 6 - if PC leave the line (with solid radius)

I can check additional detales if you interested.
« Last Edit: 2020-11-19 07:47:28 by Akari »