PDA

View Full Version : De-Activating Level Scripts


thethethethe
December 22nd, 2007, 05:52 AM
http://pixloads.com/public/46287/Level%20scripts.PNG?no_history
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.

litium
December 27th, 2007, 07:24 AM
Cool :D Thanks! It will be useful in a near future

Thrace
January 7th, 2008, 02:10 PM
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.

thethethethe
January 7th, 2008, 08:38 PM
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
January 9th, 2008, 12:16 PM
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
January 9th, 2008, 02:01 PM
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

thethethethe
January 9th, 2008, 04:37 PM
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
January 10th, 2008, 03:55 PM
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
January 13th, 2008, 10:26 PM
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?
#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
January 26th, 2008, 04:30 PM
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?

Saken
January 29th, 2008, 06:40 PM
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..

Aero-LyNx
March 22nd, 2008, 07:56 AM
Don't take without permission!
Can I save it to my computer??
Because I can't always turn on the internet?

greenozano
March 22nd, 2008, 09:01 PM
yeah it just means just dont post it again without permission.

thethethethe
March 22nd, 2008, 09:06 PM
yeah it just means just dont post it again without permission.

Exactly right! Of course you can save it to your computer, you just aren't allowed to post it.

Aero-LyNx
March 22nd, 2008, 10:57 PM
Sorry, I'm a little bad at english. :D

score_under
March 29th, 2008, 02:24 PM
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 ;)

thethethethe
March 30th, 2008, 12:51 AM
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.

score_under
April 6th, 2008, 03:52 AM
Just tested it, and C7 works on Fire Red but not on Ruby.

alexk1995
July 30th, 2008, 09:06 AM
good tutorial I vee read all your tutorials