The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other How to create an Event according to what Starter I choose in Emerald? (https://www.pokecommunity.com/showthread.php?t=355298)

LegendChu September 7th, 2015 8:42 PM

How to create an Event according to what Starter I choose in Emerald?
 
Okay how exactly do I create Scripts to make the following Events have different options according to the Starter I choose in Emerald, I mean have a different Event happen according to whether I choose Treecko/Torchic/Mudkip?

1) Have an NPC give a Pokemon depending on my Starter.

2) Create another Rival (other than Brendan/May) & make him have different Pokemon, based on what Starter I've chosen.

3) Change the Pokemon League Champion based on my Starter, I mean have a different Champion depending on what Starter I choose.

Pika Pika :chu:

Squeetz September 7th, 2015 8:46 PM

Set a flag or variable depending on the starter you chose and then have those later scripts check for it.

LegendChu September 7th, 2015 10:47 PM

Quote:

Originally Posted by Squeetz (Post 8919950)
Set a flag or variable depending on the starter you chose and then have those later scripts check for it.

Hey Squeetz, a little example will be helpful (maybe for a Trainer Battle based on chosen Starter), thanks! :)

Pika Pika :chu:

chrunch September 7th, 2015 11:23 PM

say you set flag 0x200-0x202 depending on which starter you chose. A script would look like this:
Code:

#org @start
checkflag 0x200
if 0x1 goto @treecko
checkflag 0x201
if 0x1 goto @mudkip
checkflag 0x202
if 0x1 goto @torchic
end

#org @treecko
trainerbattle 0x...

#org @mudkip
trainerbattle 0x...

#org @torchic
trainerbattle 0x...


Fill out the trainerbattle part yourself, or if it's giving a pokemon for example you could replace it with givepokemon 0x...

Of course you would have to set one of those flags when you get your starter in the first place, and since I don't hack emerald I have no idea what flags are safe to use. But that's the basic concept, it's not too hard if you know some simple scripting.

Spherical Ice September 8th, 2015 6:28 AM

Incidentally, I'd recommend setting a variable, usually 0x4031, to a value from 0-2 corresponding to the three starters and check that instead, as that variable is already used by the vanilla ROM (in certain specials, for example) to determine the starter. That way you save using three flags for something that can be done with just one variable, too.

Xencleamas September 8th, 2015 7:05 AM

Variable 0x4023 (in Emerald) is where the value of the chosen starter is registered. It is set to 0x0 if you chose the first slot (which is Treecko), 0x1 if you chose the second slot (Torchic), or 0x2 if you chose the third slot (Mudkip). You can just simply use the compare command with variable 0x4023 in scripts in order to achieve on what you are expecting. Just look at the overworld scripts of either Brendan or May for examples of scripts that uses variable 0x4023 to guide you.

LegendChu September 9th, 2015 4:24 AM

Okay, this is the Script for the First Battle with your Rival (on Route 103).

Spoiler:

'-----------------------
#org 0x1EC3C1
lockall
checkgender
compare LASTRESULT 0x0
if 0x1 goto 0x81EC3DA
compare LASTRESULT 0x1
if 0x1 goto 0x81EC434
end

'-----------------------
#org 0x1EC3DA
msgbox 0x81EC7A6 '"MAY: Let's see[.] The POKéMON found..."
callstd 0x4
closeonkeypress
playsong 0x19F 0x1
applymovement 0x2 0x827259E
waitmovement 0x0
applymovement 0x2 0x8272598
waitmovement 0x0
applymovement 0x2 0x827259A
waitmovement 0x0
msgbox 0x81EC7DE '"Oh, hi, [player]\v\h05!\p[.]Oh, I s..."
callstd 0x4
copyvar 0x8000 0x4023
compare 0x8000 0x0
if 0x1 goto 0x81EC48E
compare 0x8000 0x1
if 0x1 goto 0x81EC49E
compare 0x8000 0x2
if 0x1 goto 0x81EC4AE
end

'-----------------------
#org 0x1EC434
msgbox 0x81EC989 '"BRENDAN: Okay, so it's this one and..."
callstd 0x4
closeonkeypress
playsong 0x1A5 0x1
applymovement 0x2 0x827259E
waitmovement 0x0
applymovement 0x2 0x8272598
waitmovement 0x0
applymovement 0x2 0x827259A
waitmovement 0x0
msgbox 0x81EC9CE '"Hey, it's [player]!\p[.]Oh, yeah, D..."
callstd 0x4
copyvar 0x8000 0x4023
compare 0x8000 0x0
if 0x1 goto 0x81EC4BE
compare 0x8000 0x1
if 0x1 goto 0x81EC4CE
compare 0x8000 0x2
if 0x1 goto 0x81EC4DE
end

'-----------------------
#org 0x1EC48E
trainerbattle 0x3 0x214 0x0 0x81EC881
goto 0x81EC4EE
end

'-----------------------
#org 0x1EC49E
trainerbattle 0x3 0x217 0x0 0x81EC881
goto 0x81EC4EE
end

'-----------------------
#org 0x1EC4AE
trainerbattle 0x3 0x211 0x0 0x81EC881
goto 0x81EC4EE
end

'-----------------------
#org 0x1EC4BE
trainerbattle 0x3 0x20B 0x0 0x81ECA59
goto 0x81EC4FC
end

'-----------------------
#org 0x1EC4CE
trainerbattle 0x3 0x20E 0x0 0x81ECA59
goto 0x81EC4FC
end

'-----------------------
#org 0x1EC4DE
trainerbattle 0x3 0x208 0x0 0x81ECA59
goto 0x81EC4FC
end

'-----------------------
#org 0x1EC4EE
msgbox 0x81EC8AE '"MAY: I think I know why my dad has\..."
callstd 0x4
goto 0x81EC50A
end

'-----------------------
#org 0x1EC4FC
msgbox 0x81ECA79 '"BRENDAN: I think I get it.\nI think..."
callstd 0x4
goto 0x81EC50A
end

'-----------------------
#org 0x1EC50A
closeonkeypress
copyvar 0x8000 PLAYERFACING
compare 0x8000 0x1
if 0x1 goto 0x81EC585
compare 0x8000 0x2
if 0x1 goto 0x81EC53D
compare 0x8000 0x3
if 0x1 goto 0x81EC561
compare 0x8000 0x4
if 0x1 goto 0x81EC561
end

'-----------------------
#org 0x1EC585
applymovement 0x2 0x81EC5CE
waitmovement 0x0
sound 0xA
applymovement 0x2 0x81EC5D0
waitmovement 0x0
goto 0x81EC5A2
end

'-----------------------
#org 0x1EC53D
applymovement MOVE_PLAYER 0x81EC5C8
applymovement 0x2 0x81EC5BE
waitmovement 0x0
sound 0xA
applymovement 0x2 0x81EC5C1
waitmovement 0x0
goto 0x81EC5A2
end

'-----------------------
#org 0x1EC561
applymovement MOVE_PLAYER 0x81EC5D6
applymovement 0x2 0x81EC5CE
waitmovement 0x0
sound 0xA
applymovement 0x2 0x81EC5D0
waitmovement 0x0
goto 0x81EC5A2
end

'-----------------------
#org 0x1EC5A2
hidesprite 0x2
setvar 0x4084 0x4
clearflag 0x379
setflag 0x82
setvar 0x40C7 0x1
clearflag 0x3D3
playsong2 0x0
fadedefault
releaseall
end


'-----------
' Movements
'-----------
#org 0x27259E
#raw 3E 'Face Player
#raw FE 'End of Movements

#org 0x272598
#raw 56 'Exclamation Mark (!)
#raw FE 'End of Movements

#org 0x27259A
#raw 14 'Delay5
#raw 14 'Delay5
#raw 14 'Delay5
#raw FE 'End of Movements

#org 0x1EC5CE
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements

#org 0x1EC5D0
#raw C 'Jump2 Down
#raw 14 'Delay5
#raw 8 'Step Down (Normal)
#raw 8 'Step Down (Normal)
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements

#org 0x1EC5C8
#raw 14 'Delay5
#raw 12 'Delay3
#raw 27 'Step on the Spot Left (Fastest)
#raw 14 'Delay5
#raw 25 'Step on the Spot Down (Fastest)
#raw FE 'End of Movements

#org 0x1EC5BE
#raw A 'Step Left (Normal)
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements

#org 0x1EC5C1
#raw C 'Jump2 Down
#raw 14 'Delay5
#raw 8 'Step Down (Normal)
#raw 8 'Step Down (Normal)
#raw 8 'Step Down (Normal)
#raw 8 'Step Down (Normal)
#raw FE 'End of Movements

#org 0x1EC5D6
#raw 14 'Delay5
#raw 25 'Step on the Spot Down (Fastest)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x1EC7A6
= MAY: Let's see[.] The POKéMON found\non ROUTE 103 include[.]

#org 0x1EC7DE
= Oh, hi, [player]\v\h05!\p[.]Oh, I see, my dad gave you\na POKéMON as a gift.\pSince we're here, let's have a quick\nbattle!\pI'll give you a taste of what being\na TRAINER is like.

#org 0x1EC989
= BRENDAN: Okay, so it's this one and\nthat one that live on ROUTE 103[.]

#org 0x1EC9CE
= Hey, it's [player]!\p[.]Oh, yeah, Dad gave you a POKéMON.\pSince we're here, how about a little\nbattle?\pI'll teach you what being a TRAINER's\nabout!

#org 0x1EC881
= Wow! That's great!\n[player]\v\h05, you're pretty good!

#org 0x1ECA59
= Huh, [player], you're not too shabby.

#org 0x1EC8AE
= MAY: I think I know why my dad has\nan eye out for you now.\pI mean, you just got that POKéMON,\nbut it already likes you.\pYou might be able to befriend any\nkind of POKéMON easily.\pWell, it's time to head back to\nthe LAB.

#org 0x1ECA79
= BRENDAN: I think I get it.\nI think I know why my dad has his eye\lout for you now.\pLook, your POKéMON already likes you,\neven though you just got it.\p[player], I get the feeling that you\ncould befriend any POKéMON with ease.\pWe should head back to the LAB.


I tried making a Trainer Battle Script, based on it. Here it is:

Spoiler:
#dynamic 0x800000

copyvar 0x8000 0x4023
compare 0x8000 0x0
if 0x1 goto @grass
compare 0x8000 0x1
if 0x1 goto @fire
compare 0x8000 0x2
if 0x1 goto @water
end

#org @grass
trainerbattle 0x0 0x001 0x0 @beforebattle @afterbattle
msgbox @trainerdefeated 0x6
release
end

#org @fire
trainerbattle 0x0 0x002 0x0 @beforebattle @afterbattle
msgbox @trainerdefeated 0x6
release
end

#org @water
trainerbattle 0x0 0x003 0x0 @beforebattle @afterbattle
msgbox @trainerdefeated 0x6
release
end

#org @beforebattle
= Oh, so you finally got your own Pokemon huh, let me show you how a real Trainer battles!

#org @afterbattle
= I can't believe I lost to a punk like you!

#org @trainerbeaten
= What do you want now, go away!


I also tried to create a simple Give Pokemon Script. Here goes:

Spoiler:
#dynamic 0x800000

copyvar 0x8000 0x4023
compare 0x8000 0x0
if 0x1 goto @grass
compare 0x8000 0x1
if 0x1 goto @fire
compare 0x8000 0x2
if 0x1 goto @water
end

#org @grass
givepokemon 0x001 0x5 0x0CD 0x0 0x0 0x0

#org @fire
givepokemon 0x004 0x5 0x0D7 0x0 0x0 0x0

#org @water
givepokemon 0x007 0x5 0xD1 0x0 0x0 0x0

If Starter's Treecko, you get Bulbasaur (Lv.5, holding Miracle Seed)
If Starter's Torchic, you get Charmander (Lv.5, holding Charcoal)
If Starter's Mudkip, you get Squirtle (Lv.5, holding Mystic Water)


Correct me, if I'm wrong (might be):3c

Pika Pika :chu:


All times are GMT -8. The time now is 2:30 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.