Lance32497
LanceKoijer of Pokemon_Addicts
- 792
- Posts
- 10
- Years
- Criscanto town-Ginoa Region xD
- Seen Aug 14, 2017
SCRIPTING GUIDE
Foreword
Good Day guys!
I am Lance32497, I'm here not to teach you scripting code, or what are the programs that will help you with scripting because there're many tutorials tackling that subject, so I'm here for newbies that are confused on how they will start in scripting.
Note
Before I start it, make sure that you already knew what are the codes needed in scripting or just the basic of it.
[FONT="<font><font>Bangers</font></font>"]MAKE SURE TO READ ONE OF THESE TUTORIALS![/FONT]
Tajaros XSE tutorial
DiegoisawesomeXSE Tutorial
LETS START!
- [alink id="Dynamic Offsets"]Dynamic Offsets~Definition[/alink id]
- [alink id="Script Structure"]Script Structure~How to construct script[/alink id]
- [alink id="Applymovement"]Applymovement~Move your overworlds![/alink id]
[A ID]Dynamic Offsets[/A ID]
Spoiler:
Code:
#dynamic 0x800000
Wondering why in making a script, we always put #dynamic 0xoffset at the beginning.
Well, that's because for the tool locates Free spaces in rom, the script must give a starting offset.
But! It doesn't mean that by putting that command, the tool will find Free spaces in given offset for the entire script.
No! It will find free spaces for #org script,
example:
Code:
#dynamic 0x800000
#org @start
checkflag 0x200
if 0x1 goto @done
msgbox @text 0x6
release
end
#org @done
msgbox @text2 0x6
setflag 0x200
end
#org @text
=
#org @text2
=
Dynamic offset converts every org in hex then counts how many bytes needed for a single org.
For instance, the @start org needs 12 bytes(18 in Decimal), the tool used will find offset in 0x800000 that has 12 free space bytes or FF
Code:
0x800000-FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
then same procedure in next org.
So that's Dynamic offsets all about.
[A ID]Script Structure[/A ID]
Spoiler:
Code:
#dynamic 0x740000
#org @start
lockall
setflag 0x200
setvar 0x4033 0x1
msgbox @text 0x6
settrainerflag 0xA
releaseall
end
#org @text
=
if 0x6 goto @start
releaseall
special 0x110
compare 0x4033 0x6
return
lock
That's an error! And you must know first the use of those commands So how to make an effective script? Or Script's Structure? Well, you need to put some logic. In my example, the script first gives 0x740000 offset as its starting offset, so any free spaces from 0x740000 up-to the last offset of the room will be checked. Then #org @start is our first org, so when script is executed, it will go first in that org, then it will lock all overworlds then it will set the flag 200, set var 4033 to 0x1, then call a message string, after that message string has been displayed, it will return and go to the next function which will set the flag of trainer A and will release all overworlds that has been locked and ends the script. Pretty simple huh?
Just follow the pattern then you'll be good.
[A ID]Applymovement[/A ID]
Spoiler:
This is very simple, so all I do is to give you an idea on how to make a perfect moving OW through the script: "Upon putting movement raw's, always think that you are the overworld, if the raw will Face the sprite
This is all for now!
And I'll add more,
I hope this thread helps you!
Last edited: