• 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

Haku.

(FLAME)...H....A...K..U
385
Posts
16
Years
This could be useful to beginners learning to script.
I already learn level script when i began to scripting.Weird....
 

Reygok

Beginning Hacker
60
Posts
14
Years
  • Seen Jan 22, 2016
I think you forgot this tread, so I post a seond time

Hm, the level scripts, or better: the level script works, but only one! When I add another script, on an other map, the first changes in this second!
I had a script in Players house, the mother walks towards the player and say good morning and so on. But when I add a level sript in Prof Birch's Laboratory to get the first pokémon, and save it, I get my first Pokémon from my mother when I leave my room in my house! The offset of level sript 1 simply changed, its now the same as the seond! But I took a different var! Whats the problem?
 

VVB

2
Posts
14
Years
  • Age 33
  • Seen Jan 23, 2010
Ah, and dont you know whats this problem with the color changing sprites when I use showpokepic? I put a Charmander, a Bulbasaur and a Mudkip, and when I klick charmander, it is black, then i click bulbasaur and mudkip, they are normal color, then charmander again, who turned into blue and white, then also bulbasaur is black... does the comand wrk different in the new version of XSE, like callstd or whats the problem?

I have the same problem. It seems that the one I select first gets messed up colours.

I have no idea why. :S
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Hm, the level scripts, or better: the level script works, but only one! When I add another script, on an other map, the first changes in this second!
I had a script in Players house, the mother walks towards the player and say good morning and so on. But when I add a level sript in Prof Birch's Laboratory to get the first pokémon, and save it, I get my first Pokémon from my mother when I leave my room in my house! The offset of level sript 1 simply changed, its now the same as the seond! But I took a different var! Whats the problem?
Well, it's not the level script. It's advance-map that messes the level scripts up.
After you insert a first level script, and you move right along to the next map and try to add a level script, it would usually become the last one you entered, even if it's on a different map. So to fix this:

On the second map (that has the problems), just add about two level scripts or add them until you get a blank, editable one. Once you get the editable blank one, delete all that come before it. Now enter the settings for the level script and it should work.
 

Reygok

Beginning Hacker
60
Posts
14
Years
  • Seen Jan 22, 2016
Okay, thanks for the answer, I'm pretty sure it should work now, but I cannot test it XD
Actually, every time I open up a script with XSE, the pointers are shown as I named them, like '@start', and there are no offsets! Even when I open the Map script offset, the pointers are called '@swizzle' or something like that. That means when I change the FFFF after the pointer, and then klick compile, it says: 'no Dynamic offset'
Have I switched an option somewhere? I dont think so... Or could it be that I dont know any more how the whole thing works, because I didn't script for 2 months :p
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
Some of the technicalities here are a little off... D:
The var you(well, I) used--0x4033--should be inserted into the Flag area. And for some strange reason, the value you(I) used in the setvar command(setvar 0x4033 0x1) has to be subtracted by one.


Since I used 0x1, I subtract 1 and get 0x0. so I put 0x0 into the Value box.
It does not have to be subtracted by 1. The reason we use 0x0 in the Value box is because the var starts at 0. The Value box dictates which value the var has to be to start the script. After the script, you set it to 1 (or indeed any other value if you choose to), and this means it no longer equals zero, so no longer activates.

Wow, the level script really worked!!!
But...
2vrss37.jpg


Advance Map overwrites the 0000 that you put into the Value box, with FFFF.
Actually, it overwrites a completely separate number with FFFF, one for which there was no input box (as it was thought to be unused). This is not such a mistake in the tutorial, but for future reference it should always be set to zero, not whatever you set the "Value" box to.
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Quick question, what is a Level Script and what is it used for? noob question probably, but I hang out more in the Game Developing section.
A level script is a script that activates when the map is loaded. Simply put...

Thanks a lot!
This tut works for me!

But I have problems with
the "03 On entering map/not on menu close" thing . . .
Er.. What's the problem?

Some of the technicalities here are a little off... D:

It does not have to be subtracted by 1. The reason we use 0x0 in the Value box is because the var starts at 0. The Value box dictates which value the var has to be to start the script. After the script, you set it to 1 (or indeed any other value if you choose to), and this means it no longer equals zero, so no longer activates.
Actually, it overwrites a completely separate number with FFFF, one for which there was no input box (as it was thought to be unused). This is not such a mistake in the tutorial, but for future reference it should always be set to zero, not whatever you set the "Value" box to.
1. I didn't know that. I'll add it to the first post ;)
2. Ahh, Okay. I assumed that it overwrote the value box because it worked whenever I changed it back to 0000. But I'll change that too.


But, I have a question for you. Have you found a way to allow more than one level script (type: 02) activate on a map?
 

Reygok

Beginning Hacker
60
Posts
14
Years
  • Seen Jan 22, 2016
And why don't you answer my post, cooley XD
Perhaps you dont know an answer...

Okay, thanks for the answer, I'm pretty sure it should work now, but I cannot test it XD
Actually, every time I open up a script with XSE, the pointers are shown as I named them, like '@start', and there are no offsets! Even when I open the Map script offset, the pointers are called '@swizzle' or something like that. That means when I change the FFFF after the pointer, and then klick compile, it says: 'no Dynamic offset'
Have I switched an option somewhere? I dont think so... Or could it be that I dont know any more how the whole thing works, because I didn't script for 2 months :p
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
And why don't you answer my post, cooley XD
Perhaps you dont know an answer...
Or perhaps, it could be I didn't see your question.. :D.... :tired:
To answer your question, it's not really a script related question.
I think it may be the XSE settings you have. It's called the "Refactoring function" So press Ctrl+D and uncheck the option. It appends all the static offsets you decompile, into dynamic "@snippet" labels so that you can easily repoint.

When it says "No dynamic offset", it means there's no dynamic offset there.... I thought you would've figured it out by now.
 

Tropical Sunlight

The Faltine
3,476
Posts
16
Years
I have a problem, you see.
Here's my script. I have set the level script type to 02.
Spoiler:

The problem is, the movements for 0x11, 0x12 and 0x13 don't work.
Yes, the player does move.
How do I fix this?
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
I have a problem, you see.
Here's my script. I have set the level script type to 02.
Spoiler:

The problem is, the movements for 0x11, 0x12 and 0x13 don't work.
Yes, the player does move.
How do I fix this?
You should've posted this in the script help thread.
11 = 0xB in hex, 12 = 0xC, 13 = 0xD so if your person number is 11, you should put 0xB, 12 you should put 0xC, and so on...

0x11 = 17
0x12 = 18
0x13 = 19

So if there's no person number 17 on the map, nothing will happen :\
 

Tropical Sunlight

The Faltine
3,476
Posts
16
Years
You should've posted this in the script help thread.
11 = 0xB in hex, 12 = 0xC, 13 = 0xD so if your person number is 11, you should put 0xB, 12 you should put 0xC, and so on...

0x11 = 17
0x12 = 18
0x13 = 19

So if there's no person number 17 on the map, nothing will happen :\
Oh. Thanks cooley!
You're cool really helpful!
Thanks! Sorry for not posting this in the Script Help Thread, I thought it might've been releated to the fact that it's a level script...
thanks again!
 
71
Posts
15
Years
  • Seen Jul 9, 2017
I don't really get it.
I have this code:

Spoiler:

and i put 800000 in the script offset 2 screen
and 4033 in flag
Still, when I go from home i don't see any textbox at all
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
I don't really get it.
I have this code:

Spoiler:

and i put 800000 in the script offset 2 screen
and 4033 in flag
Still, when I go from home i don't see any textbox at all
What type of Level script did you try to use?
 
224
Posts
16
Years
  • Seen Mar 8, 2016
OMG.... All this time.... For trying to make that level script to work only after a certain event.... That solution is so simple! I can't believe I never thought of it!

Good work, Cooley!
 

Dratii

Working on something new...
195
Posts
15
Years
  • Seen Oct 24, 2023
Thanks for this cooley. It helped in filling in the fine gaps in my level script knowledge.
 
13
Posts
14
Years
  • Seen Feb 5, 2011
Uhm..hi.
Your great tutorial helped me very much. My levelscripts worked great so far.
But now I habe a little question. I wanted to set some tiles after a flag was activated.
I tried it a long time, but it dont worked...
Is there something special, that I have to use, when I want to use the command setmaptile in a levelscript?
(I tried it with script-type 03)
 
Back
Top