• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Code: Port of the BW2 Repel system to GBA...

For emerald:

Alright, so with the help of Le Pug and Touched, I've made a very, very ratchet system for it. The repel's effect wore off script offset is at 2A4B2A, so you can repoint it or just goto @pointer it...
Anyways, of course, this would be much better with a multichoice, but just for testing I did yes/no boxes. Anyways, here it is, you don't need to credit us or anything..

#dynamic 0xE40000
#org @start
lockall
msgbox @woreoff 0x6
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @Repel
msgbox @2 0x5
compare 0x800D 0x1
if 0x1 goto @Super
msgbox @3 0x5
compare 0x800D 0x1
if 0x1 goto @Max
releaseall
end

#org @Repel
checkitem 0x56 0x1
compare 0x800D 0x1
if 0x4 goto @rp
msgbox @notenough 0x6
releaseall
end

#org @notenough
= You don't have enough.

#org @rp
sound 0x2F
msgbox @usedr MSG_SIGN
removeitem 0x56 0x1
setvar 0x4021 100
release
end

#org @usedr
= [player] used a Repel.

#org @1
= Use a Repel?

#org @2
= Use a Super Repel?

#org @3
= Use a Max Repel?

#org @Super
checkitem 0x53 0x1
compare 0x800D 0x1
if 0x4 goto @sp
msgbox @notenough 0x6
releaseall
end

#org @sp
sound 0x2F
msgbox @useds MSG_SIGN
removeitem 0x53 0x1
setvar 0x4021 200
releaseall
end

#org @useds
= [player] used a Super Repel.

#org @Max
checkitem 0x54 0x1
compare 0x800D 0x1
if 0x4 goto @mp
msgbox @notenough 0x6
releaseall
end

#org @mp
sound 0x2F
msgbox @usedm MSG_SIGN
removeitem 0x54 0x1
setvar 0x4021 250
release
end

#org @usedm
= [player] used a Max Repel.

#org @woreoff
= The Repel's effect wore off[.]
 
@Dark Sneasel
Steps are in HEX, so the line

is currently wrong and produces 256 steps-repel.

Nice to see someone else dont mess up the hole bag routine :) Thats the better soulotion i guess to ;)

In the newest XSE you don't need to put 0x in front of a number and it won't be hex.
 
@Dark Sneasel
Steps are in HEX, so the line

is currently wrong and produces 256 steps-repel.

Nice to see someone else dont mess up the hole bag routine :) Thats the better soulotion i guess to ;)
You know, you keep saying Darthatron's routine sucks. Why don't you share your routine with us? You have more than 15 posts now, I believe.
 
Because DarkSneasel posted the soulution? If you setvar 0x4021 0x9, repel work for 9 steps. Some Routines do "backgroundwork" and those stepcounters are some of those.
You can compare also this var, for example, for an quest or sth. else like this:

Code:
compare 0x4021 25
if 0x1 goto @operdoor
//doorclosed
end

@opendoor
//open secret door
end
DarkSneasel's script doesn't work exactly like BW's repels though. BW automatically uses the type of repel you used last time. You have to manually choose the repel you want to use though, in DarkSneasel's case. So it's, like DarkSneasel said, a ratchet solution.
(I still think this is cool, but an ASM port of Darthatron's repel routine would be better though)
 
Wait, there's an emerald item ASM hack? So can't we just make one var, and give it a different value depending on the repel they use, then do the repel effect, and then after the repel wears off, compare the var?

edit: it appears that ASM doesn't work, and big daddy Touched is working on some items stuff ;)
 
Last edited:
What about super repel and Max repel?
 
[PokeCommunity.com] Port of the BW2 Repel system to GBA...


I DID IT! ! !

But wait?

After I pressed YES, It restarts!!

Hpw can I fix that? Also The callasm offset given by dartharton, Do I need to change that or just copy that?
 
That's Awesome! I Don't Play around with Scripting much...Not a stronghold for me. Maybe someone can make this into an ips Patch for Everyone to enjoy!
 
That's Awesome! I Don't Play around with Scripting much...Not a stronghold for me. Maybe someone can make this into an ips Patch for Everyone to enjoy!
9 times out of 10, you're not going to get an ips patch in the research forums. I suggest learning how to compile scripts and how to use a hex editor, since this isn't really hard to insert if you know how to do those two things.
 
9 times out of 10, you're not going to get an ips patch in the research forums. I suggest learning how to compile scripts and how to use a hex editor, since this isn't really hard to insert if you know how to do those two things.
Yeah, I Had Realized that when i saw Non ips stuff in the research forms here. I started to learn how to insert a hex editor... Thanks!
 
Why people dont do amazing things like this for Emerald ??? Emerald got battle frontier so its much better than fire red. Wake up hackers :o
 
Hello! So, I have managed to develop another ratchet repel system for Emerald, and here's the script:
Code:
#dynamic 0xE40000

#org @repelsystem
lock
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @yes
release
end

#org @yes
lock
multichoice 0x0 0x3 0x71 0x0
copyvar 0x8000 0x800D
compare 0x800D 0x0
if 0x1 goto @repel
compare 0x800D 0x1
if 0x1 goto @superrepel
compare 0x800D 0x2
if 0x1 goto @maxrepel
compare 0x800D 0x3
if 0x1 goto @exit
release
end

#org @exit
release
end

#org @1
= Repel's effect wore off...\pUse another?

#org @repel
checkitem 0x56 0x1
compare 0x800D 0x1
if 0x4 goto @rp
msgbox @notenough 0x6
release
end

#org @notenough
= You don't have enough.

#org @rp
sound 0x2F
msgbox @usedr MSG_SIGN
removeitem 0x56 0x1
setvar 0x4021 100
release
end

#org @usedr
= [player] used a Repel.

#org @superrepel
checkitem 0x53 0x1
compare 0x800D 0x1
if 0x4 goto @sp
msgbox @notenough 0x6
releaseall
end

#org @sp
sound 0x2F
msgbox @useds MSG_SIGN
removeitem 0x53 0x1
setvar 0x4021 200
releaseall
end

#org @useds
= [player] used a Super Repel.

#org @maxrepel
checkitem 0x54 0x1
compare 0x800D 0x1
if 0x4 goto @mp
msgbox @notenough 0x6
release
end

#org @mp
sound 0x2F
msgbox @usedm MSG_SIGN
removeitem 0x54 0x1
setvar 0x4021 250
release
end

#org @usedm
= [player] used a Max Repel.

Here's how to apply it. First, you must grab hold of XSE, and this tool: https://www.pokecommunity.com/showthread.php?t=335308, and of course, a clean Emerald ROM.

Open your ROM with Complete Multichoice Box Editor and XSE. Copy this script in XSE. And, in CMBE, expand or edit one of the choices, to

Repel
Super Repel
Max Repel
Exit

Save it. And compile the script. Fire up your hex editor, and navigate to where you implemented your repel system, and copy it, then go to 2A4B2A, and paste it there.
And, if you have some questions, or you found some bugs, just PM or VM me.

PS: Here's a pic:
[PokeCommunity.com] Port of the BW2 Repel system to GBA...


edit: btw, I copied some parts from Dark Sneasel's script. So, some of this, is to him.
 
Last edited:
HxD (the hex editor i use) Says it cant find any of those offsets, even if though i tried searching it using hex, dec, and oct. (e.g. it says The file does not contain that offset when i search 080830CA)
 
Any chance this could work on Sapphire as well?
 
HxD (the hex editor i use) Says it cant find any of those offsets, even if though i tried searching it using hex, dec, and oct. (e.g. it says The file does not contain that offset when i search 080830CA)

In HxD press CTRL + G and then type in that offset minus the 080 at the beginning.

Any chance this could work on Sapphire as well?

Nope.
 
Can anyone confirm if the compiled script in the first post actually works? No matter how many times I do this, following every step to a tee, I get a gibberish string of "qAF" that freezes the game.


EDIT: Ok, compiled my own script and the proper message comes up, but clicking "yes" freezes the game. For simple hex edits, this feature is obscenely annoying to get working. It's gotta be something with the "callASM" command right?
 
Last edited:
Can anyone confirm if the compiled script in the first post actually works? No matter how many times I do this, following every step to a tee, I get a gibberish string of "qAF" that freezes the game.


EDIT: Ok, compiled my own script and the proper message comes up, but clicking "yes" freezes the game. For simple hex edits, this feature is obscenely annoying to get working. It's gotta be something with the "callASM" command right?

I've never had any problems with it. Are you sure you repointed the script at 0x083100 correctly?
 
I've never had any problems with it. Are you sure you repointed the script at 0x083100 correctly?

I compiled the script to 74B8B4. I've tried every combination at 083100 to make sure (I've used 74 B8 B4 08, B4 B8 74 08, 75 B8 B4 08, B5 B8 74 08). What should go there?
 
I want to do this in a spanish ROM but I when the repel finishes, my game restart. I find my game offsets and I tried to modify the ASM routine, but it still no works, can anyone help me?
PD: can anyone give me the routines dissasebbled?
 
Back
Top