• 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.

Creating Level Scripts

54
Posts
15
Years
  • Seen May 21, 2011
Hey, great tutorial, but my advance map doesn't show the map script options under header view... I'm using version 1.92, and I can't find the map script option box anywhere.

If someone could help me out it'd be awesome :)
 
3
Posts
13
Years
  • Seen Jun 11, 2010
Can I get some help please? I can't figure out how to even start off with a level-script! :D SOMEONE PLEASE REPLY AND HELP ME!!! Thanks

SOMEONE please tell me how to make a level script using Pokescript!
Thanks! :)

Can someone please help? I made a script using Pokescript and I did everything like it was on the tutorial... Is it bad to mix XSE with Pokescript? I made this script, here it is...

#org $start
jingle
applymovement 0xFF $oh
$oh 1 ; #binary 0x62 0xFE
pausemove 0
applymovement 5 $s
$s 1 ; #binary 0x11 0xFE
pausemove 0
message $1
$1 1 = See!
boxset 6
setflag 0x1000
setvar 0x4033 0x0001
release
end

Anyway, I did everything said on this tutorial and I can't figure out why it won't work when I come out of the players house and it doesn't work... But, when I step back onto the script box, it works... I want it where when the player steps out of the house, it triggers the script... PLEASE HELP!!! Thanks! :P
 
Last edited:
54
Posts
15
Years
  • Seen May 21, 2011
Can I get some help please? I can't figure out how to even start off with a level-script! :D SOMEONE PLEASE REPLY AND HELP ME!!! Thanks

SOMEONE please tell me how to make a level script using Pokescript!
Thanks! :)

Can someone please help? I made a script using Pokescript and I did everything like it was on the tutorial... Is it bad to mix XSE with Pokescript? I made this script, here it is...

#org $start
jingle
applymovement 0xFF $oh
$oh 1 ; #binary 0x62 0xFE
pausemove 0
applymovement 5 $s
$s 1 ; #binary 0x11 0xFE
pausemove 0
message $1
$1 1 = See!
boxset 6
setflag 0x1000
setvar 0x4033 0x0001
release
end

Anyway, I did everything said on this tutorial and I can't figure out why it won't work when I come out of the players house and it doesn't work... But, when I step back onto the script box, it works... I want it where when the player steps out of the house, it triggers the script... PLEASE HELP!!! Thanks! :P

I have the exact same problem

Someone help please
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I thought I'd post this here since I haven't really read it anywhere else, and I just learned how to do it :)

If anyone has ever wanted to have multiple "02 Validates values" scripts in one map, you've probably realized that just adding another map script in A-Map doesn't work. However, it is possible to have multiple 02 scripts in one map.

Go to professional header viewer and copy the Map Script Offset and open it in XSE. Got to the offset for the pointer of your 02 script - it will say:

Code:
#raw 0x2
#raw pointer ...

and then list the offset.

Re-write the script for the offset manually (you will likely have to use dynamic offsets, so change what's above to something like:

Code:
#raw 0x2
#raw pointer @go

And under your new dynamic offset, add your multiple script offsets. Basically, if the original is:

Code:
#raw word 0x5050
#raw word 0x1
#raw pointer 0x800000
#raw word 0x0

(And we know that his means that the script at 0x800000 will activate the instant you enter this map if variable 0x5050 is set to 0x1) ... and we have another script at 0x800100 that we want to activate in the same map when var 0x5050 is set to 0x2, we world write:

Code:
#raw word 0x5050
#raw word 0x1
#raw pointer 0x800000
#raw word 0x5050
#raw word 0x2
#raw pointer 0x800100
#raw word 0x0

^ And so on for any additional scripts you want to activate. Once it's compiled, all the scripts should work once the variables you indicated are activated without any freezing or errors, etc. It won't show up properly in A-Map or XSE, but it works :)

Don't know if this info is known well or not, as I haven't come across it yet, so I'm just posting it for it to be out there.
 

[I]-Hac*ker.

Touko Fan <3
36
Posts
12
Years
I thought I'd post this here since I haven't really read it anywhere else, and I just learned how to do it :)

If anyone has ever wanted to have multiple "02 Validates values" scripts in one map, you've probably realized that just adding another map script in A-Map doesn't work. However, it is possible to have multiple 02 scripts in one map.

Go to professional header viewer and copy the Map Script Offset and open it in XSE. Got to the offset for the pointer of your 02 script - it will say:

Code:
#raw 0x2
#raw pointer ...

and then list the offset.

Re-write the script for the offset manually (you will likely have to use dynamic offsets, so change what's above to something like:

Code:
#raw 0x2
#raw pointer @go

And under your new dynamic offset, add your multiple script offsets. Basically, if the original is:

Code:
#raw word 0x5050
#raw word 0x1
#raw pointer 0x800000
#raw word 0x0

(And we know that his means that the script at 0x800000 will activate the instant you enter this map if variable 0x5050 is set to 0x1) ... and we have another script at 0x800100 that we want to activate in the same map when var 0x5050 is set to 0x2, we world write:

Code:
#raw word 0x5050
#raw word 0x1
#raw pointer 0x800000
#raw word 0x5050
#raw word 0x2
#raw pointer 0x800100
#raw word 0x0

^ And so on for any additional scripts you want to activate. Once it's compiled, all the scripts should work once the variables you indicated are activated without any freezing or errors, etc. It won't show up properly in A-Map or XSE, but it works :)

Don't know if this info is known well or not, as I haven't come across it yet, so I'm just posting it for it to be out there.


Thank you sooo much :O I've been looking all over for this. Though only the first script is working, the second freezes :/
What I did: script1: compiled --> A-Map: header view--> 02 validates..... put in flag & offset, copied the map offset. Opened it in XSE, added the text metapod23 gave, and decompiled. What am I doing wrong?
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Thank you sooo much :O I've been looking all over for this. Though only the first script is working, the second freezes :/
What I did: script1: compiled --> A-Map: header view--> 02 validates..... put in flag & offset, copied the map offset. Opened it in XSE, added the text metapod23 gave, and decompiled. What am I doing wrong?

Could you post the script that isn't working and also the Map Script Offset that you rewrote to include it?
 

[I]-Hac*ker.

Touko Fan <3
36
Posts
12
Years
Sorry for the late reply. Here is the script.

Spoiler:

The Map Script Offset : $0071B598

I wasn't quite sure about what I was doing. I made 2 '[2]Validates value...' in the header view, both for the flag 7001, one for 0000 and the other for 0001. Sounded right to me ;)

Thanks for helping, Metapod23!!
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Sorry for the late reply. Here is the script.

Spoiler:

The Map Script Offset : $0071B598

I wasn't quite sure about what I was doing. I made 2 '[2]Validates value...' in the header view, both for the flag 7001, one for 0000 and the other for 0001. Sounded right to me ;)

Thanks for helping, Metapod23!!

It's been a while since I've dealt with level scripts but try the following (red = cut, blue = add):

Spoiler:
 

[I]-Hac*ker.

Touko Fan <3
36
Posts
12
Years
It's been a while since I've dealt with level scripts but try the following (red = cut, blue = add):

Spoiler:

Thanks for replying! But it didn't change anything, the first script works great, but the second freezes. The music & other sprites continue on playing and moving, only the player freezes, I can't move :S

I appreciate the help, though =)(
 

colcolstyles

Yours truly
1,588
Posts
15
Years
Thanks for replying! But it didn't change anything, the first script works great, but the second freezes. The music & other sprites continue on playing and moving, only the player freezes, I can't move :S

I appreciate the help, though =)(

Wait, why do you have a branching segment at the beginning of your level script? The thing with having multiple type 2 level scripts is that the game will automatically compare your variable ('0x7000') for you and branch to the correct script. Something else to note: if you set '0x7000' to 1 right after the first level script, it will trigger the second level script immediately after the first one finishes.

Anyway, I just tested it out and it worked so if there's a problem, you're doing something else wrong. I'm afraid I can't help you with that.
 

[I]-Hac*ker.

Touko Fan <3
36
Posts
12
Years
Wait, why do you have a branching segment at the beginning of your level script? The thing with having multiple type 2 level scripts is that the game will automatically compare your variable ('0x7000') for you and branch to the correct script. Something else to note: if you set '0x7000' to 1 right after the first level script, it will trigger the second level script immediately after the first one finishes.

Anyway, I just tested it out and it worked so if there's a problem, you're doing something else wrong. I'm afraid I can't help you with that.

1. Why I did that I don't know actually, 'cause I know it checks that itself...

2. I know it will trigger the second one right after that, I want that to happen actually.

3. I think I know what's wrong... I just messed something up with another script... I think I know how to fix it, damn I hope so....
 
124
Posts
12
Years
I'm having a problem with my script.
Every I try to use it as a level script, I don't get the results I should see in XSE when pasting the maps offset script into it.
This is the script that I'm trying to use:
#org $testmovementscript
lock
message $whereami
boxset 6
applymovement 0xFF $huh
pausemove 0x0
message $whatisthat
boxset 6
applymovement 0xFF $runup
pause 0x30
setvar 0x5000 0x0001
release
end

#org $whereami
$whereami =Where am I?

#org $huh
#raw 0x56
#raw 0xFE

#org $whatisthat
$whatisthat =What is that?

#org $runup
#raw 0x36
#raw 0xFE

(I'm using Pokescript)

When I decompile the map offset in XSE (Level Script toggled), this is what I get:

'---------------
#org 0x6B20
#raw 0x0

I have repeated all the steps over and over again but still end up with this result and my game crashing every time.
I have removed all maps scripts so this is the only one on it.
Any help would be gratefully appreciated!

-------------------------------------------------------------------------------------------------------------------------------------------------------------
EDIT:
I figured out what my problem was, When copying the map script offset, I was copying the double '00' at the beginning of the offset.
Level scripts works perfectly now. Thank you for a great tut!
 
Last edited:

阴魂君

_(:зゝ∠)_ so busy i am…
22
Posts
11
Years
Thank a lot ,but I have a question to ask you.I want the level sprite to go work when I go to a town every time,(for example,I want the weather changes at random every time I come to a town),so how to write the sprite?
 

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
Thank a lot ,but I have a question to ask you.I want the level sprite to go work when I go to a town every time,(for example,I want the weather changes at random every time I come to a town),so how to write the sprite?

Lol, Cooley isn't around anymore...:/

But it sounds to me that you just want the level script to repeat itself everytime, which is simple.
Don't use a setvar (or you can if you need to remember).
But in that case, (we'll use 0x5000 as an example), I'd setvar 0x5000 0x0.
THEN, when I put in the Flag and Value, I'd put Flag: 5000, Value: 0000.

If the value is set to zero, then the level script will always repeat itself because that variable will always be zero (unless you use an addvar command, it'll stay 0).
 

阴魂君

_(:зゝ∠)_ so busy i am…
22
Posts
11
Years
Lol, Cooley isn't around anymore...:/

But it sounds to me that you just want the level script to repeat itself everytime, which is simple.
Don't use a setvar (or you can if you need to remember).
But in that case, (we'll use 0x5000 as an example), I'd setvar 0x5000 0x0.
THEN, when I put in the Flag and Value, I'd put Flag: 5000, Value: 0000.

If the value is set to zero, then the level script will always repeat itself because that variable will always be zero (unless you use an addvar command, it'll stay 0).

Thanks a lot (>_<)ノシI'm going to set some spirits about changing weather and weather forecast...
 
Back
Top