Sign Up connects you to ROM Hackers around the world.

Special 0x7e

0 Votes
Posted August 2, 2015 by Derlo
Category: Scripting
Total Views: 932

So does anyone know how special 0x7e the JPANHackEngine work?
Insert with the tool but every time active script, the rom break.
I tried to enter the routine, but it's the same problem.

Tags: Jpan, specials

This solved the problem

1 Vote
Spherical Ice
Posted August 2, 2015 by Spherical Ice

(Of course, you'd do multiple checks to ensure it is any of the different mountain tiles, etc.)

Special 0x7F returns the behaviour and background bytes of the tile at the given co-ordinates to 0x8004 and 0x8005, respectively. So, for example, if you wanted to check if the tile to the right of the player is a sign post, you could do something like this:

getplayerpos 0x8004 0x8005
addvar 0x8004 0x1
special 0x7F
compare 0x8004 0x84 // the special returns the behaviour byte to 0x8004, and 0x84 is the behaviour byte used for signposts
if 0x1 goto @thetiletotherightoftheplayerisasignpost
goto @thetiletotherightoftheplayerisntasignpost

Other Answers

1 Vote
Spherical Ice
Posted August 7, 2015 by Spherical Ice

Special 0x7E gets the tile number at the given co-ordinates, so if you wanted to check if the tile above the player was a mountain, you'd do something like this:

(in my tileset, the mountain is tile 0x79)

getplayerpos 0x8004 0x4005
subvar 0x8005 0x1 // the tile above the player is -1 on the Y axis
special2 0x4001 0x7E
compare 0x4001 0x79
if 0x1 goto @thetileabovetheplayerismountain
goto @thetileabovetheplayerisnotmountain

1 Vote
Posted August 7, 2015 by Derlo

thanks Spherical Ice!!

In fact, the error was not "exactly" this!
The problem is that Jpan tool repoint the special for an empty spot where it should be routine. and every time I used the command, the rom reset.
So I tried to manually enter routine, when I copy / paste routine to insert in the rom, it had letters [characters] hidden between the spaces, which made the routine not worked. Then rewrote the routine manually and changed the special to the pointer where I had placed the routine. Now work well!

0 Votes
Posted August 2, 2015 by Derlo

Special 0x7e, Tile Number getter, gets the tile's number at (0x8004, 0x8005)
location. Should usually be used in conjunction with special 0x8f, the player
location to variables special. Returns to a given variable the desired number

-1 Vote
Posted August 2, 2015 by Joexv

Whats the special supposed to do? I dont believe I've used that one before.