Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] EASY GYM LEADER SCRIPTING

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.



View Poll Results: Did this Help You???
1 16 21.05%
2 3 3.95%
3 10 13.16%
4 10 13.16%
5 37 48.68%
Voters: 76. You may not vote on this poll

Reply
 
Thread Tools
  #1    
Old April 19th, 2009 (01:51 AM). Edited April 15th, 2010 by hashtag.
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
Inserting a new gym leader using XSE scripts.

REQUIRMENTS
Spoiler:
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!!
Spoiler:
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:

Spoiler:
USE RAI-KUN'S TUTORIAL AND GET THEM.


BADGES FLAGES:
Spoiler:
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:
Spoiler:
#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!!!
__________________
Reply With Quote
  #2    
Old April 19th, 2009 (07:30 AM).
Sophidius's Avatar
Sophidius Sophidius is offline
Need a storyline? PM me!
 
Join Date: Mar 2009
Location: Farawaystan
Nature: Quiet
Posts: 153
Great, can you also show how to do double battles?
__________________
Officially stopped hacking, but do check out my fanfic: The Legend of the Aquatus

Did you know that Mewtwo is actually a crossing between Marowak (Cubone's mother from Pokemon Tower) and Mew? O_o
Reply With Quote
  #3    
Old April 19th, 2009 (08:12 AM).
Tropical Sunlight's Avatar
Tropical Sunlight Tropical Sunlight is offline
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 19
Gender: Male
Posts: 3,578
Send a message via Windows Live Messenger to Tropical Sunlight
Quote originally posted by sophidius:
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.
__________________
Reply With Quote
  #4    
Old April 20th, 2009 (06:12 AM). Edited April 21st, 2009 by Blazichu.
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
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
__________________
Reply With Quote
  #5    
Old April 21st, 2009 (01:54 PM).
machomuu's Avatar
machomuu machomuu is offline
We'll practice like it's 1999!
Moderator
 
Join Date: Apr 2008
Location: Americalanavania
Gender: Male
Nature: Relaxed
Posts: 7,306
But...couldn't you just as easily learn this and more through XSE tutorials?

This doesn't explain what everything does.
__________________
Reply With Quote
  #6    
Old April 22nd, 2009 (04:46 AM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Posts: 1,816
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
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #7    
Old April 22nd, 2009 (05:22 AM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
You mean after the main match?
the leader asks whether we will hav a re-match!!
__________________
Reply With Quote
  #8    
Old May 2nd, 2009 (03:57 AM).
infernoflash infernoflash is offline
 
Join Date: Apr 2009
Location: Sweden
Gender:
Posts: 7
Thanks a million times aerow! I relly needed a Gym Leader script.
Reply With Quote
  #9    
Old May 4th, 2009 (01:03 AM).
Count's Avatar
Count Count is offline
 
Join Date: May 2009
Location: On a Torterra.
Gender: Male
Nature: Bold
Posts: 111
Ohh very useful. :'3 Can't really see the contents yet but lol I'll check that later.
Reply With Quote
  #10    
Old May 10th, 2009 (06:23 PM).
Alpha Bass's Avatar
Alpha Bass Alpha Bass is offline
Scrap-Data™
 
Join Date: May 2009
Location: Cyberspace
Gender: Male
Nature: Relaxed
Posts: 59
Ah, thanks for the info, this shall surely help me finish up parts of Mirage Version.
Reply With Quote
  #11    
Old May 12th, 2009 (01:03 AM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
Ok np i always help a member in need!!!
__________________
Reply With Quote
  #12    
Old May 13th, 2009 (09:21 AM).
jwalbowler jwalbowler is offline
 
Join Date: May 2009
Gender:
Posts: 1
i was wondering: how do you change the names of the badges so that they are recognized by that name throughout the game?
Reply With Quote
  #13    
Old May 14th, 2009 (09:43 PM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
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.
__________________
Reply With Quote
  #14    
Old July 24th, 2009 (11:29 PM).
mavidlol2's Avatar
mavidlol2 mavidlol2 is offline
 
Join Date: Sep 2008
Location: Poke World
Gender:
Posts: 13
what do waitfanfare and fanfare do? and whats fanfare 0x13E ?
__________________
Typhlosion = Awesome
Reply With Quote
  #15    
Old July 25th, 2009 (12:01 AM).
Late's Avatar
Late Late is offline
Pokémon Artist
 
Join Date: Nov 2008
Location: "We all live in a Pokémon World!"
Age: 20
Gender: Male
Nature: Careful
Posts: 549
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).
__________________

Please feed my Pokémon and warm my eggs.
Thanks for everyone who have clicked these, you've helped me a lot

Anyone has Club Nintendo codes that you don't need? I want those.
If you have one code for me I can trade you my Explorers of Sky code as I can't put it because I have registered already one. (Registered my brother's game and now I can't register mine...) Someone have same thing? PM me.
I know there's nobody who wishes to do this xD
I'm talking about Club Nintendo of Europe.
Reply With Quote
  #16    
Old July 27th, 2009 (12:40 AM).
mavidlol2's Avatar
mavidlol2 mavidlol2 is offline
 
Join Date: Sep 2008
Location: Poke World
Gender:
Posts: 13
oh...ok thanks
so even if i dont put them in my script its ok right?
__________________
Typhlosion = Awesome
Reply With Quote
  #17    
Old July 27th, 2009 (12:58 AM).
Late's Avatar
Late Late is offline
Pokémon Artist
 
Join Date: Nov 2008
Location: "We all live in a Pokémon World!"
Age: 20
Gender: Male
Nature: Careful
Posts: 549
If you don't want music to play when you have your badge.
__________________

Please feed my Pokémon and warm my eggs.
Thanks for everyone who have clicked these, you've helped me a lot

Anyone has Club Nintendo codes that you don't need? I want those.
If you have one code for me I can trade you my Explorers of Sky code as I can't put it because I have registered already one. (Registered my brother's game and now I can't register mine...) Someone have same thing? PM me.
I know there's nobody who wishes to do this xD
I'm talking about Club Nintendo of Europe.
Reply With Quote
  #18    
Old July 28th, 2009 (07:19 AM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
Quote originally posted by jwalbowler:
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.....
__________________
Reply With Quote
  #19    
Old August 3rd, 2009 (10:28 PM).
3n3rGyZ 3n3rGyZ is offline
 
Join Date: Jul 2009
Gender: Male
Posts: 33
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
Reply With Quote
  #20    
Old August 8th, 2009 (11:26 PM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
Quote originally posted by 3n3rGyZ:
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
__________________
Reply With Quote
  #21    
Old August 9th, 2009 (10:53 AM).
.Seth's Avatar
.Seth .Seth is offline
.explorer.
Crystal Tier
 
Join Date: Jun 2008
Location: A capacitor in a power supply board.
Gender: Male
Nature: Quiet
Posts: 1,645
Easily done and pretty pointless tutorial IMO.
But, good job on this, I suppose.
Reply With Quote
  #22    
Old August 10th, 2009 (04:04 PM).
●•ΛΣЯӨЩ•●'s Avatar
●•ΛΣЯӨЩ•● ●•ΛΣЯӨЩ•● is offline
Silver Tier
 
Join Date: Nov 2008
Location: Kanto
Gender: Male
Nature: Bold
Posts: 440
Quote originally posted by 非常に高いレベル:
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!!
__________________
Reply With Quote
  #23    
Old May 16th, 2010 (11:02 AM).
Elite Trainer Red's Avatar
Elite Trainer Red Elite Trainer Red is offline
 
Join Date: Apr 2010
Location: Mt.Silver
Gender: Male
Nature: Adamant
Posts: 43
Omg epicness!
Im so using this tut!
__________________
This signature has been disabled.
Reason: Spoilers in signature
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #24    
Old May 18th, 2010 (11:12 AM).
PeregrineFig's Avatar
PeregrineFig PeregrineFig is offline
Starting Pokémon Obsidian
 
Join Date: Feb 2010
Location: Michigan, USA
Age: 20
Gender: Male
Nature: Hardy
Posts: 202
Quote originally posted by jwalbowler:
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.
__________________
Current Projects:
POKéMON AQUA SAPPHIRE
POKéMON OBSIDIAN

Reply With Quote
  #25    
Old June 17th, 2010 (05:56 PM).
.Paradox .Paradox is offline
Hack Completion: ~5%...LOL
 
Join Date: Jun 2010
Age: 19
Gender: Male
Posts: 16
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.
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

Forum Jump


All times are UTC -8. The time now is 07:56 AM.