Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old 3 Weeks Ago (03:35 AM). Edited 3 Weeks Ago by Lance32497.
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
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.

MAKE SURE TO READ ONE OF THESE TUTORIALS!
Tajaros XSE tutorial
DiegoisawesomeXSE Tutorial


LETS START!

  1. Dynamic Offsets~Definition
  2. Script Structure~How to construct script
  3. Applymovement~Move your overworlds!


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.





Spoiler:


Code:
#dynamic 0x740000

#org @start
lockall
setflag 0x200
setvar 0x4033 0x1
msgbox @text 0x6
settrainerflag 0xA
releaseall
end

#org @text
=
As you can see, I just put the code in an org but, will those codes do anything to rom when executed? Yup! It will, and it won't freeze the game. But it doesn't mean that nothing will happen if I just inserted many codes in an org, because some codes have a special function, like call, you will not use Call @1
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.





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 [s] down, use yourself as your model, so face down, look what happened, you face downward, so that the raw will do the same thing on designated OW



This is all for now!
And I'll add more,
I hope this thread helps you!

__________________
My Threads

Reply With Quote
  #2    
Old 3 Weeks Ago (05:46 AM).
NewDenverCity's Avatar
NewDenverCity
 
Join Date: Apr 2014
Location: Antarctica
Gender: Male
Nature: Calm
checkflag takes up 3 bytes, the if line takes up 6, the msgbox line takes up 8, and then release and end take up 2. All in all that's 19 bytes.


Also the third spoiler made little sense to me. I've made many scripts with applymovement, but that was written out a little strangely.
Reply With Quote
  #3    
Old 3 Weeks Ago (12:39 PM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Quote originally posted by NewDenverCity:
checkflag takes up 3 bytes, the if line takes up 6, the msgbox line takes up 8, and then release and end take up 2. All in all that's 19 bytes.


Also the third spoiler made little sense to me. I've made many scripts with applymovement, but that was written out a little strangely.
That's for instance,
but thanks for mentioning it
__________________
My Threads

Reply With Quote
  #4    
Old 3 Weeks Ago (02:38 PM).
Hopeless Masquerade's Avatar
Hopeless Masquerade
すきま妖怪
Community Supporter
 
Join Date: Mar 2010
Location: 幻想郷
Age: 17
Gender: Male
Nature: Relaxed
Please improve your grammar.

I actually understand what I'm doing when it comes to scripting, and I could barely understand what you're trying to say.
__________________
Reply With Quote
  #5    
Old 3 Weeks Ago (04:19 PM).
Lance32497's Avatar
Lance32497
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Quote originally posted by Hopeless Masquerade:
Please improve your grammar.

I actually understand what I'm doing when it comes to scripting, and I could barely understand what you're trying to say.
Lol, sorry for that, I'm using mobile phone and I have damn keypad, I'll edit that as soon as I can
__________________
My Threads

Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 09:10 PM.