Level Scripting Tutorial

View previous topic View next topic Go down

Level Scripting Tutorial

Post by Steelix on 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:
#dynamic 0x800000

#org @start
setvar 0x7000 0x1
msgbox @1 0x2
end

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:
#dynamic 0x------

#org @start
checkflag 0xw/e
if 0x1 goto @begin
end

#org @begin
(and then the rest of the script.)



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..."
avatar
Steelix
Admin
Admin

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

View user profile http://playpokemon.darkbb.com

Back to top Go down

Re: Level Scripting Tutorial

Post by Bolens on 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.
avatar
Bolens
New Memeber
New Memeber

Posts : 3
Join date : 2010-06-26

View user profile

Back to top Go down

Re: Level Scripting Tutorial

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

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

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

View user profile http://playpokemon.darkbb.com

Back to top Go down

Re: Level Scripting Tutorial

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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