![]() |
Having fun with level scripts
Hello.
Have you ever noticed that scripts aren't working when you try to put them right on the warp spot? Well, I don't know the reason for that, but to make this work, you only need basic XSE scripting skills and minimal Advance Map skills. This called as "Level-Script", or "Map-Script". It "tells" the game that when you enter X map, Y script will run. What we need: - XSE (Download it from HackMew's Tools Factory. Link: http://www.pokecommunity.com/showthread.php?t=85025) - A-Map (I'll be using 1.95 Open Beta, you could download it from here: http://www.pokecommunity.com/showthread.php?t=124279) - A brain (most important thing) ___________________________________________________________________________________ Oky, let's start! [01] "setmaptile" script This is easy. It is used for auto-setmaptile scripts... You don't understand, right? For example, let's take RSE. On Route 111, there's a big rock WITHOUT door, which meants it's impossible unless you unlock it (I won't, and I will repeat it, I WON'T answer if you wanna find out how to unlock them). After you unlock, a door appears on the giant rock on Route 111 (and other routes I don't rememmber the full list). Well, here you go! The "setmaptile script"! For doing that, you need some XSE knowledge... Sigh, or just use Diego's tutorial (http://www.pokecommunity.com/showthread.php?t=164276) Okay, here's an example for a script: Code:
If you want that it will be active only while a flag is on, simply put Code:
___________________________________________________________________________________ [02] Validates values, loads handler to 0x03000EB0 (playback) Well, here we go... This is to make the "real" scripts (like applymovement and stuff)... Example for a quick script: Code:
lockall => Locks all the events happening in the map applymovement => Just an applymovement script, view Diego's scripting tutorial for more information. waitmovement => Applies the applymovement, by setting a Sprite that would wait for the movement. Simply put 0x0 after it. msgbox => Just a regular msgbox, nothing special. releaseall => Releases all the events that were locked by the "lockall" command. end => Ends the script. Rememmber - You don't need the "checkflag" command here, only the "setvar" command (unless you wish a thing to happen only while a flag is on) Alrighty, when you're done, simply compile the script. Now, open up A-Map, navigate to any map you want to have the script. Now, go to the "Header" tab. Remove ALL the scripts that are in the map and add a script "Validates values, loads handler to 0x03000EB0 (playback)". Under the text "Script offset 2", put $00[your script]. Under the text "flag", put the var you set in the script. Leave the Value box. Hit the "save map scripts" box and save the ROM. Test it. There's 99% that the script will be corrupted. Go to the "Header" tab, and press CTRL+H. You'll see lots of bytes fufufu. Look for a box called "Map script offset" and copy the script. Open up XSE again and open up your ROM. On the offset box, paste the Script from A-Map and nothing will appear. Try playing with the "Decompile" and "Level Script" buttons 'til it will. Scroll down 'til you see "#raw word 0xFFFF". simply replace the "FFFF" with "0", so you'll get "#raw word 0x0". Compile the script, test again and it should be fine! If you don't have the latest XSE version, meants you do not have that level script function, do this: Quote:
Let's say the flag is 2F. Code:
[03] On entering map/not on menu close This isn't hard at all. Have you wondered how's that on certain maps, an OW or anything else will change his location after another script? Well, that's it. In FRLG, it is most used for "setworldmapflag". In order to make an OW dissappear on a flag, type in that script: Let's say the flag "3A" is the flag. Code:
Code:
[code]dynamic 0x800000 #org @start checkflag 0x3A if 0x1 goto @tilechange release end #org @tilechange setmaptile 0x[X] 0x[Y] 0x[TILE] 0x[ATTRIBUTE] special 0x8E release end Gee, that was simple. You can use it for any purpuse you want except setmaptile. _______________________________________________________________________________________________ [04] Validates values, loads handler to 0x03000F28 Some kind of another variation for doing a "[02] Validates values, loads handler to 0x03000EB0 (playback)" script. 05 and 07 are identical to 03, except that it will also trigger on any re-draw of the Overworld [06] Unkown use, I guess. _______________________________________________________________________________________________ Gee, I worked on that for hours. Do not copy or modify without my permission pl0x! Credits: Code:
|
I never really know what a setvar is. -____- but I understand most of it.
|
Gal, movesprite does not work on the 03 level-script type. I learned this a while ago. It only works on 02 and 04. You should fix that.
|
Quote:
Thanks :) |
My version of xse does not have a level script button. As one would guess, this poses a problem when trying to create a level script. Where can I get a version that has a level script button?
|
Quote:
|
Quote:
|
Quote:
That's cool! I'd be glad if you could PM me the method and I'll add to the tutorial - I will credit you ofcourse! |
"[05] & [07] another variation for a "[03] On entering map/not on menu close" scripts."
This is not true. 05 is identical to 03, except that it will also trigger on any re-draw of the Overworld (eg, after battling, or after checking your bag). That's why it's used as a handler for hiding sprites after legendary battles. 03 doesn't execute, while 05 does. I'm not sure about 07 though. |
Quote:
I added to the tutorial and put you in the credit list :3 |
| All times are GMT -8. The time now is 9:18 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.