Play Pokemon
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Level Scripting Tutorial

2 posters

Go down

Level Scripting Tutorial Empty Level Scripting Tutorial

Post by Steelix Sat Jun 26, 2010 3:23 am

Ok so, here is my level scripting tutorial!

1.) Make your script. Whether it be a givepokemon, applymovement, etc..

2.) Put a setvar 0x(variable) 0x1 somewhere in the script. You should put the setvar somewhere in the script where the player is FORCED to do it.
- For the variable, use numbers 7000 and up to be safe.

EX:
Spoiler:

3.) Compile the script.

4.) Open up A-Map. In the header tab(on the map you want the script in). Delete all the other Map scripts, or if you want to keep them, just click "add"

5.) Under Script Type, select 02 Validates values, loads handler to...

6.) Paste the script offset into the Script offset 2 box.

7.) Put the number of the variable that will be set to 0x1 in your script under Flag(The 0x(variable)). Leave the Value box alone.

8.) Press "Save Map Scripts"

9.) Press Ctrl-H and that should open up Pro-Header view.

10.) In the Map options>Map script offset box, copy the offset and paste it into the Offset box in XSE, you have to open your ROM in XSE first though..

11.) Decompile the script and then you might get a blank, if you do hit the button next to the decompile button, and then hit the decompile button itself. After that a script should pop up.

12.) There should be a minimum of three parts to the script: two things with pointers and your script that you made. In the second part, there should be a pointer to your script. Under it, there should be a #raw word 0x(random number). Replace the random number with 0. Compile it and test it out in the game.


Making level scripts work after another script:
So you want your level script to activate AFTER a certain script?
Well its really simple, the way I do it is you need a setflag 0xw/e in the script(not the level script)
After that, in the level script put this:
checkflag 0xw/e
if 0x1 goto @begin

So it could be like this
Spoiler:



So basically that script wont activate until the other script has activated. Simple? I think so.



Also on a side note.. You can not have 2 level scripts on the same map set to "02 Validates values, loads handler to..."
Steelix
Steelix
Admin
Admin

Posts : 31
Join date : 2010-06-06
Location : Florida

https://playpokemon.darkbb.com

Back to top Go down

Level Scripting Tutorial Empty Re: Level Scripting Tutorial

Post by Bolens Sat Jun 26, 2010 12:55 pm

Thanks man, as I should really learn level scripting for my hack. I can do everything else, so I might as well learn this to. Thanks.
Bolens
Bolens
New Memeber
New Memeber

Posts : 3
Join date : 2010-06-26

Back to top Go down

Level Scripting Tutorial Empty Re: Level Scripting Tutorial

Post by Steelix Sat Jun 26, 2010 1:14 pm

No Problem! Level scripting is actually easier then most things.
Steelix
Steelix
Admin
Admin

Posts : 31
Join date : 2010-06-06
Location : Florida

https://playpokemon.darkbb.com

Back to top Go down

Level Scripting Tutorial Empty Re: Level Scripting Tutorial

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum