PDA

View Full Version : [Tutorial] EASY GYM LEADER SCRIPTING


●•ΛΣЯӨЩ•●
April 19th, 2009, 01:51 AM
Inserting a new gym leader using XSE scripts.

REQUIRMENTS
O.k now the basic thing you need to know is
1.)Basic Xse scripts.
2.)Hex value of your gym leader,use advance trainer to do it.
3.)Patience.

LETS BEGIN
Firstly open your Xse and in it open your Rom that you wanna use.

Then open Free space finder and Get a free space of about 100 bytes.

Match Types!!
trainerbattle 0x1 0x(Hex of leader) 0x0 @beforematch @aftermatch @later ==>Official Battles

trainerbattle 0x4 0x(Hex of leader) 0x0 @beforematch @aftermatch @later ==>Double Battles


Ok lets start

#dynamic 0x(your offset)

#org @start
lockall
faceplayer
checkflag 0x(The Badge you want)
if 0x1 goto @end
msgbox @002 0x6
trainerbattle 0x1 0x(Hex of leader) 0x0 @beforematch @aftermatch @later
end

#org @beforematch
=(Dialogue before battle in the battle screen)

#org @aftermatch
=(Dialogue after losing the battle but in the battle screen)

#org @later
msgbox @003 0x6
fanfare 0x13E
msgbox @004 0x4
waitfanfare
closeonpresskey
msgbox @005 0x6
giveitem 0x(your item in hex) 0x(quantity in hex) 0xtype
setflag 0x(the badge you want)
releaseall
end

#org @done
msgbox @001 0x6
release
end

#org @001
=(go to the next town to get ur next badge)

#org @002
=(intro Before match)

#org @003
=(you got the [] badge)

#org @004
=([player] recieved [] badge)

#org @5
=(message before giving item)

HERE REPLACE [] WITH A NAME AND () WITH ANY THING YOU WANT.

ITEMS HEX CODES:
USE RAI-KUN'S TUTORIAL AND GET THEM.


BADGES FLAGES:
0x820 - First Badge
0x821 - Second Badge
0x822 - Third Badge
0x823 - Fourth Badge
0x824 - Fifth Badge
0x825 - Sixth Badge
0x826 - Seventh Badge
0x827 - Eighth Badge
HERE'S AN EXAMPLE:
#dynamic 0x830000

#org @start
lock
faceplayer
checkflag 0x820
if 0x1 goto @done
msgbox @2 0x6
trainerbattle 0x1 0x19E 0x0 @before @after @later
end

#org @before
= Show me what ya got!

#org @after
= What the-?

#org @later
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
msgbox @5 0x6
giveitem 0x12A 0x1 0x5
setflag 0x820
release
end

#org @done
msgbox @1 0x6
release
end

#org @1
= You should travel to Moserde town\nto get your next badge.

#org @2
= Welcome to Fander Town Gym.\nYou want to challenge me?

#org @3
= Congratulations!\pFor beating me, you get\nthis badge!

#org @4
= \v\h01 recieved a badge!

#org @5
= Oh, and please take this.

SPECIAL THANKS TO:
RaiRai-Kun
diegoisawesome
HACKMEW

FOR GIVING EXPERT TUTORIALS AND MAKING ME GET INTO XSE IN A DAY!!!

Sophidius
April 19th, 2009, 07:30 AM
Great, can you also show how to do double battles?

Tropical Sunlight
April 19th, 2009, 08:12 AM
Great, can you also show how to do double battles?
That's quite easy.
You just need to make two scripts with different text, put a setflag on the end and a checkflag on the start.
And check Double Battle in A-Trainer.

●•ΛΣЯӨЩ•●
April 20th, 2009, 06:12 AM
I Figured Out The Gym Rematch Scripts , I Will be Posting It By Tommorow!!!!!!!!!!!!

Please dont post it without my permision and if you have any doubts just pm me.This is a word 2007 and PDF file file:)

machomuu
April 21st, 2009, 01:54 PM
But...couldn't you just as easily learn this and more through XSE tutorials?

This doesn't explain what everything does.

0m3GA ARS3NAL
April 22nd, 2009, 04:46 AM
You forgot the after battle text.
(The text the leader says after you got the badge and item, like if you left the gym, came back in, and spoke to him/her.)
I tell you this since there ARE people here that are just SO LAZY, they wont even take a minute to add it... XD

●•ΛΣЯӨЩ•●
April 22nd, 2009, 05:22 AM
You mean after the main match?
the leader asks whether we will hav a re-match!!;)

infernoflash
May 2nd, 2009, 03:57 AM
Thanks a million times aerow! I relly needed a Gym Leader script.

Count
May 4th, 2009, 01:03 AM
Ohh very useful. :'3 Can't really see the contents yet but lol I'll check that later.

Alpha Bass
May 10th, 2009, 06:23 PM
Ah, thanks for the info, this shall surely help me finish up parts of Mirage Version.

●•ΛΣЯӨЩ•●
May 12th, 2009, 01:03 AM
Ok np i always help a member in need!!!

jwalbowler
May 13th, 2009, 09:21 AM
i was wondering: how do you change the names of the badges so that they are recognized by that name throughout the game?

●•ΛΣЯӨЩ•●
May 14th, 2009, 09:43 PM
sorry bro i could no get what your question was but why not insert your custom badge name after the gym match analogue??
I bet it'll help.;)

mavidlol2
July 24th, 2009, 11:29 PM
what do waitfanfare and fanfare do? and whats fanfare 0x13E ?

Late
July 25th, 2009, 12:01 AM
It's the music when you have beaten the gym leader. Fanfare, it starts to play that music. Waitfanfare (I don't know, maybe wanfare has to wait...). 0x13E is wanfare that you want to play, there's different fanfares. I haven't tested fanfares yet so I am not so sure about this.

I think this will help me. Looks very easy, I'm going to test it (when I have solved my first problem, if you can help me with that go and tell it, my question is in Add new pokémon 15 easy-steps and put answer there).

mavidlol2
July 27th, 2009, 12:40 AM
oh...ok thanks
so even if i dont put them in my script its ok right?

Late
July 27th, 2009, 12:58 AM
If you don't want music to play when you have your badge.

●•ΛΣЯӨЩ•●
July 28th, 2009, 07:19 AM
i was wondering: how do you change the names of the badges so that they are recognized by that name throughout the game?

Do you script?????
well if you do you'd know......need help,i'm always on msn.....

3n3rGyZ
August 3rd, 2009, 10:28 PM
How would I change the pokemon that the gym leaders would use?
And what are the gym leaders hex values?

Sorry if I'm being a noob, just trying to learn :)

●•ΛΣЯӨЩ•●
August 8th, 2009, 11:26 PM
How would I change the pokemon that the gym leaders would use?
And what are the gym leaders hex values?

Sorry if I'm being a noob, just trying to learn :)
There's a tool By HackMew use it to edit trainers

.Seth
August 9th, 2009, 10:53 AM
Easily done and pretty pointless tutorial IMO.
But, good job on this, I suppose.

●•ΛΣЯӨЩ•●
August 10th, 2009, 04:04 PM
Easily done and pretty pointless tutorial IMO.
But, good job on this, I suppose.
it was the first script that i've made so i decided to post it!!

Elite Trainer Red
May 16th, 2010, 11:02 AM
Omg epicness!
Im so using this tut!

PeregrineFig
May 18th, 2010, 11:12 AM
i was wondering: how do you change the names of the badges so that they are recognized by that name throughout the game?

You can either change every instance of the badge name in the scripts (no menus or anything use the badges, just the gym leaders themselves, mainly) or if your new badge name has the exact same number of letters as the old, you can use a hex editor's find/replace function to instantly swap out the names.

.Paradox
June 17th, 2010, 05:56 PM
This is a good tutorial and I know it's kinda old, but your script skeleton is a little flawed. Well for one thing at line 23 it should be closeonkeypress not closeonpresskey, and it says "if 0x1 goto@end" but there is no @end, it's @done. Also, It has the msgbox @005 part, but the actual message is @5. All of these lead to an unknown keyword or a missing dynamic label. It's a great tutorial, I mean, it's good scripting. But there's some typos.

You should fix it.

ERROR
June 23rd, 2010, 11:07 AM
thnx one of the useful scripts for xse :D

SkyStorm365
June 27th, 2010, 10:35 AM
Aces man. Great TuT. Pokemon Royal Red(my hack,still in pre-production) is nearing the production stage.(laptop died which stalled work). Once again great tut man.

thia12
June 28th, 2010, 07:11 AM
I love you, but...

Do you know how to make an script for Elite 4, like so that you need all the badges to enter the building?

Resultz
August 8th, 2010, 11:57 AM
its a good tutorial and all, but i get Error 13 type mismatch on line 25, the give item bit.

should the quantaty in hex for tms be 1? '0x1'?

Mr.KoolAid
April 5th, 2012, 06:41 PM
I copied and changed the example script to the trainer I wanted in PET and what I wanted him to say. After I beat him i get a YES/NO box which decides if i get the badge or not. It does not tell me i got the badge (but i did). He also says nothing after the battle when i talk to him again. (this happens to all the trainers i put into the game)

On a side note the leader only has one of the two pokemon i gave him. His ID in PET only had one originally, but i changed it to two. was i supposed to do something else?

YouListeningROMs
April 5th, 2012, 08:28 PM
This is extremely basic and fundamentally flawed. As .Paradox explained, there are some typos, but no real gym leader behaves this basically in-game. There are a complex set of scripts that would be involved. Also, your flags for badges only apply to FRLG and not R/S/E.

rpgsonic
June 16th, 2012, 12:50 PM
HEY I NEED HELP ON HERE IT TELLS ME I NEED ADVANCED TRAINER TO FINE HEX OF MY GYM LEADER IT WONT TELL ME (I DONT GET WHAT IT IS REALLY)

MrFantasy
June 27th, 2012, 05:48 AM
Not to sound like an ultra noob but I can't even find Advanced Trainer anywhere on this site or any other and it's really getting on my nerves ><

Magic
June 27th, 2012, 05:57 AM
Not to sound like an ultra noob but I can't even find Advanced Trainer anywhere on this site or any other and it's really getting on my nerves ><

This thread looks an absolute mess, but go here (http://www.pokecommunity.com/showthread.php?t=85025), scroll down to the spoiler and you'll find HackMew's tools - A-Trainer included.

MrFantasy
June 27th, 2012, 06:05 AM
You are my new favorite person in the entire world! xD

Rezordaxx
August 25th, 2013, 02:32 AM
Thanks this was helpfull!

The_Show
January 27th, 2014, 05:06 PM
This was wonderful. I do have a question. The 0x1 offset for trainnerbattle makes it an official battle, music and all. But how would you go about making the gym battle a double battle? I'm quite positive 0x4 would be the right offset, but the "gym leader theme" doesn't play, only a normal trainer battle theme does.

How could I make a gym leader double battle?

Donut
February 19th, 2014, 12:06 PM
How do I edit what the gym badges look like. Is there a program that lets me import and export the badge sprites?

M0ZEPH
February 19th, 2014, 01:11 PM
Thanks! This will help me a lot!