• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

De-Activating Level Scripts

1,104
Posts
16
Years
Level%20scripts.PNG

Actually here's something that I forgot to add to the actual tutorial.
Pointers in GBA
When repointing/searching for pointers you need to know that pointers appear differently in a hex editor.
A pointer like 0x08123456, would appear like this
56 34 12 08 in a hex editor.
You reverse the bytes.
Just incase you still don't understand, maybe this might make it easier to see.

08 80 02 0D
is the same as....
0D 02 80 08


Thanks to:
Teh Baro for the tutorial on WAH, which is how I learnt how to do this.
 
Last edited:

Thrace

@tion
1,048
Posts
16
Years
  • Age 33
  • Seen Oct 2, 2016
Well this is very useful. So I assume editing and creating level scripts are done the same as normal scripts? According to what you've decompiled that seems to be the case except for the boxset close thing. Is that just something from ScriptEd? Because I use PokeScript only.
 
1,104
Posts
16
Years
Well this is very useful. So I assume editing and creating level scripts are done the same as normal scripts? According to what you've decompiled that seems to be the case except for the boxset close thing. Is that just something from ScriptEd? Because I use PokeScript only.
Editing, Creating, it's pretty much the same process. There's enough info here to figure out on your own how to make your own level scripts. If you're willing to just keep trying and trying, you'd eventually figure it out. The only part that you might have trouble with, the part that involves....
(byte) (pointer) (byte) (pointer)
Because you can't "double up" on the same byte, and use it twice, but also depending on the script a different byte would be needed. The only I've tried so far are.
01 - I think setmaptile
02 - Normal script
04 - Weather related scripts.
If I'm incorrect on these, tell me, these are just the types of bytes that worked with my scripts.

#raw 0x68, doesn't have a command in a default database, it's something that you either know or you don't. Since it's only scriptable through "#raw 68", I gave a little insight into what it does to the right of it. It isn't in ScriptED or Pokescript(Unless you edit the database.), might be in XSE when it comes out, but I'm not sure what Hackmew is going to include with the program.
 

D-Trogh

Dead
439
Posts
18
Years
might be in XSE when it comes out, but I'm not sure what Hackmew is going to include with the program.
Of course that'll be in XSE.. It allready is actually.. XD
It decompiles flawlessly.. :P
Our 'database' counts 112 commands.. And I may have an outdated one..
But.. B2T
 

Mastermind_X

ASM-Hacker
92
Posts
17
Years
I was wondering about the 1A 02 80 so I reversed it. Just to add that information:

1A 02 80 sets the jingle which is played if you get the item. Possible values are 0x013E and 0x0101.


greetz
MX
 
1,104
Posts
16
Years
I was wondering about the 1A 02 80 so I reversed it. Just to add that information:

1A 02 80 sets the jingle which is played if you get the item. Possible values are 0x013E and 0x0101.


greetz
MX

That's what I thought when I saw the 0x13E, which when used like this, fanfare 0x13E, plays that the jingle that happens when you recieve the item. I didn't write it because, I didn't want to write anything that was possibly completely wrong.
I guess there's always more than one way to activate a command.
Thanks for clearing that up.
 

Mastermind_X

ASM-Hacker
92
Posts
17
Years
Uhm. I didn't know, that there are such big gaps in the knowledge about the commands.
Anyway, I decided to reverse them all. Up to now, I know all the meanings of commands 0x00 - 0x44. And I'll go on tomorrow.

greetz
MX
 

Thrace

@tion
1,048
Posts
16
Years
  • Age 33
  • Seen Oct 2, 2016
So if I wanted to make a sprite disappear after an event could I just compile the following code from PokeScript and change the pointer?
Code:
#org $Start
checkflag 0x82f
if B_false gosub $no
applymovement 0x04 $disappear
$disappear 1 ; #Binary 0x0a 0x60 0xfe
end

#org $no
release
end

EDIT: Whoops probably the wrong place for this
 

/Circa

a face in the clouds.
881
Posts
16
Years
I fixed my problem.

I just have a little question, with a level script, if I want an event to occur when I enter, could I compile the event, but not place it anywhere, and then in a level script have it point to that event?

For instance, if I want the player to move up to Nurse Joy in a Pokemon Center, could I make it in the level script:

checkflag 0x200
if b_true goto $done
applymovement 0xFF $goto

Like a normal script?
Or would it be some different commands?
 
112
Posts
17
Years
I fixed my problem.

I just have a little question, with a level script, if I want an event to occur when I enter, could I compile the event, but not place it anywhere, and then in a level script have it point to that event?

For instance, if I want the player to move up to Nurse Joy in a Pokemon Center, could I make it in the level script:

checkflag 0x200
if b_true goto $done
applymovement 0xFF $goto

Like a normal script?
Or would it be some different commands?

You have to know where the script you are compiling is, so you can repoint the level script to it.
And yes, all you need to do is make a normal script and it will work, no different commands needed.
All you have to make sure is that you flip your offset when repointing it. So lets say, 0x800000, that would be flipped around:
00 00 08
or some other one like 81A37B would be:
7B A3 81

That is all..
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
I have constructive criticism!
I'm pretty sure that C7 does not set the colour, that's done inside the message (but it does seem to stop the message from showing, in my experimenting).
And 6B does not release the sprite. Instead, it makes the currently shown message disappear.
But that's just me being picky again.

Anyway, nice tutorial - It'll be great to just reverse this effect and make our own script in a normal map ;)
 
1,104
Posts
16
Years
I have constructive criticism!
I'm pretty sure that C7 does not set the colour, that's done inside the message (but it does seem to stop the message from showing, in my experimenting).
And 6B does not release the sprite. Instead, it makes the currently shown message disappear.
But that's just me being picky again.

Anyway, nice tutorial - It'll be great to just reverse this effect and make our own script in a normal map ;)
#raw 0xC7 does change the text colour. I use it myself a lot. Could you show me what you did? Maybe I might see the problem.
And I was told 0x6B was that, but I'm not sure. I now know it has a similiar effect to 0x68.

But please note this tutorial was posted 4 months ago. A lot of knowledge has been gained by people since then.
 
Back
Top