FrozenInfernoZX
What is out there?
- 756
- Posts
- 12
- Years
- United States
- Seen Feb 27, 2019
I figured that I'll post some script templates for beginners that are in need of a sense of direction! The scripts are well formatted, allowing you to learn and get used to the commands. At first scripting may seem like a huge complex task, but it is not that bad when you keep rehearsing them over and over again. This thread will periodically be updated!
------------------------------
Important note: If you are using Emerald, use a dynamic offset of at least 0xEA0000. I usually like to allocate an entire 0x100000 bytes of space only used for scripting. That way, little text strings may not get caught in vital data that may contain a few "FF FF FF FF" in between.
Let's start out with a simple "checkflag" script.
Here is a special battle scenario that will allow you to re-battle a trainer once the "checktrainerflag" gets cleared with the "cleartrainerflag" command.
Here is a script segment that checks for a certain item which then branches to other offsets accordingly.
The "jump" command at the end is used to connect this script to another script.
Here is another script segment, a trainer battle that continues execution immediately after the script.
That is all for now! I will be uploading more templates containing all sorts of scenarios and specific events.
------------------------------
Important note: If you are using Emerald, use a dynamic offset of at least 0xEA0000. I usually like to allocate an entire 0x100000 bytes of space only used for scripting. That way, little text strings may not get caught in vital data that may contain a few "FF FF FF FF" in between.
Let's start out with a simple "checkflag" script.
Spoiler:
#dyn 0x-free-space
#org @offset-main
'------------------------------------
' General Flag Check
'------------------------------------
faceplayer
lockall
checkflag 0x---
if true jump @endevent
msgbox @text-1
callstd msg_noclose
setflag 0x---
release
end
#org @endevent
msgbox @text-2
callstd msg_noclose
release
end
#org @text-1
= Text-1.
#org @text-2
= Text-2.
#org @offset-main
'------------------------------------
' General Flag Check
'------------------------------------
faceplayer
lockall
checkflag 0x---
if true jump @endevent
msgbox @text-1
callstd msg_noclose
setflag 0x---
release
end
#org @endevent
msgbox @text-2
callstd msg_noclose
release
end
#org @text-1
= Text-1.
#org @text-2
= Text-2.
Here is a special battle scenario that will allow you to re-battle a trainer once the "checktrainerflag" gets cleared with the "cleartrainerflag" command.
Spoiler:
#dyn 0x-free-space
#org @offset-main
'------------------------------------
' Special Battle Mod
'------------------------------------
faceplayer
lockall
checktrainerflag 0x36
if true jump :continue
msgbox @text-1
callstd msg_noclose
special 0x03B 'This special ignites the playsound command to play into the trainer battle.
playsound 0x129 0x129 'Basically, you can have different music for special trainers at any time.
trainerbattle 0x0 0x36 0x0 @text-1 @text-2
:continue
msgbox @text-3
callstd msg_noclose
release
end
#org @text-1
= Here I was minding my own tiny\nbusiness and then a loser comes...
#org @text-2
= You messed up my biking flow\nfool...
#org @text-3
= Go away and let me get back\non track!
#org @offset-main
'------------------------------------
' Special Battle Mod
'------------------------------------
faceplayer
lockall
checktrainerflag 0x36
if true jump :continue
msgbox @text-1
callstd msg_noclose
special 0x03B 'This special ignites the playsound command to play into the trainer battle.
playsound 0x129 0x129 'Basically, you can have different music for special trainers at any time.
trainerbattle 0x0 0x36 0x0 @text-1 @text-2
:continue
msgbox @text-3
callstd msg_noclose
release
end
#org @text-1
= Here I was minding my own tiny\nbusiness and then a loser comes...
#org @text-2
= You messed up my biking flow\nfool...
#org @text-3
= Go away and let me get back\non track!
Here is a script segment that checks for a certain item which then branches to other offsets accordingly.
The "jump" command at the end is used to connect this script to another script.
Spoiler:
storeitem 0x0 ITEM 'Hex value of an item.
checkitem ITEM 1
compare lastresult 0x0
if true jump @noitem
jump @continue
checkitem ITEM 1
compare lastresult 0x0
if true jump @noitem
jump @continue
Here is another script segment, a trainer battle that continues execution immediately after the script.
Spoiler:
special 0x03B
playsound 0x--- 0x---
trainerbattle 0x0 0x--- 0x0 @text-1 @text-2
jump @continue 'You can jump to another script offset or continue with more commands as normal.
#org @text-1
= Text-1.
#org @text-2
= Text-2.
playsound 0x--- 0x---
trainerbattle 0x0 0x--- 0x0 @text-1 @text-2
jump @continue 'You can jump to another script offset or continue with more commands as normal.
#org @text-1
= Text-1.
#org @text-2
= Text-2.
That is all for now! I will be uploading more templates containing all sorts of scenarios and specific events.
Last edited: