Thread: [Tutorial] Combining Scripts Help!
View Single Post
Old June 19th, 2009 (2:38 PM). Edited April 15th, 2010 by Stormzy.
HackChu's Avatar
HackChu HackChu is offline
I need a haircut...
Silver Tier
Join Date: Jan 2007
Location: Bankrupt Amerika
Age: 23
Gender: Male
Nature: Modest
Posts: 673
This will help those who need help on how to make commands work along with others.I've notice that Scripting Tutorials out there go over the basics,but some people don't know how to combine the methods used together.

1.Rival Type Battles

Okay I'm sure there are those out there that have trouble on knowing how to make a trainer battle where they walk up to you, battle, and than walk away.This will help you,I'll try the best I can.

Trainer battle 0x0
This means that an original type of battle will occur.An example is,a trainer you would meet on a route,or cave,etc.

Trainer battle 0x1
This type of battle is a Gym battle,which is always used to execute a battle when you want the trainer to walk to you before and walk away from you after a battle.

Trainer battle 0x4
This type of battle is an double battle.

Now I'll give an example of each!
Trainer Battle 0x0
Always start a script with #dynamic 0x(offset)
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
msgbox @beaten 0x6

#org @before
= I won't lose to you.

#org @after
= What!

#org @beaten
= Leave me alone!

Now at the trainer battle line 0x0 represents a regualer battle which I explained above.The 0x001 represents the Person ID from PET or Advance Trainer battle editors.The 0x0 is is the reserved byte,which is often used.The @before explains what the trainer would say if they saw you and walked up to you.And @after explains what they say during battle when they lose.Finally @beaten which is always used after the battle is what the trainer says if you talked to him.

Now Trainer battle 0x1 used with applymovements.(Look at diegoisawesome's tut for an explanation on regular 0x1 battles,as well as applymovement commands)
#dynamic 0x800000

#org @start
checkflag 0x200
showsprite 0x(person event)
applymovement 0x(person event) @move
waitmovement 0x0
msgbox @hey 0x6
trainerbattle 0x1 0x001 0x0 @before @after @later

#org @move
#raw 0x11
#raw 0x11
#raw 0xFE

#org @hey
= Hey wait up!

#org @before
= I want to battle!

#org @after
= Wow nice battle.

#org @later
msgbox @well 0x6
applymovement 0x(person event) @move2
waitmovement 0x0
hidesprite 0x(person event)
setflag 0x200

#org @well
= Well I have to go, bye.

#org @move2
#raw 0x10
#raw 0x10
#raw 0xFE

Okay, checkflag is always used to check and see if the battle was used yet,therefore it's always used.The checkflag here 0x200 would go in the person id in Amap,like this 0200, doing that would make the OW not visable until the showsprite command comes into play,than the hidesprite will make it disapear again.Now I explained that applymovements are explainable in diego's tut.Now the command @later is always used here,after the battle this is the pointer it continues from.Here on @later you can put anything,just make sure before you use the release command you add the setflag used,which in this case 0x200.Doing that will set the script,meaning that it wont trigger again.

I will try to add more when I get the chance.I hope you all can understand this.
Join us!

My 'learning how to combine battle scripts' thread:

SoulSilver FC:1162 1864 5409
Name: Ethan

Black FC: 2666 1354 4379
Name: Ashton

White 2 FC: 1120 8065 3049
Name: Nate

3DS Friend Code: 1349-4646-2412
Name: tysonrss
Reply With Quote