• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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...

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
Whoa... this is great... i never noticed this though. :P
I am going to make this scripts port to fire red so that it will ask for any repel to use after one expires..... gonna do some drastic changes to original by dartharon...
This is brilliant though :)

EDIT: with the help of your script and the original post by Darthatron i managed to get this script running when a repel expires
bXx3EwW.png
epumte5.png


Now can you tell me what exactly
Spoiler:

the highlighted portion do, and i think its not the same for fire red as well so can you tell me what should i replace it with to make working in fire red... thanks in advance though :)

It activates the repel for 250 steps. I don't know if it works for fire red.
 

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
well it is not working for fire red yet, do you know if there is any other way to do it....
like activating a repel with a script ???

You could try to callasm the item? Not sure if that would work, but worth a try.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
It would be worth a try,
But how actually to callasm an item....
Callasm command calls the asm value only.... getting confused about it
IIRC, you will have to do:
Code:
...
blah blah blah
callasm 0x(item effect offset)
blah blah blah
...

Happy hacking! :)
 

Froosty

The_Learner
535
Posts
9
Years
IIRC, you will have to do:
Code:
...
blah blah blah
callasm 0x(item effect offset)
blah blah blah
...

Happy hacking! :)

This word Item effect has been haunting me for a long time....
can you tell me if it is the item index number or something else,
and if it is something else then is there any list for it... because i wanted to know about it.... and you have written.... "item effect offset" do they have some offset also ???
???
???
.
.
thanks for the reply though :)
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
This word Item effect has been haunting me for a long time....
can you tell me if it is the item index number or something else,
and if it is something else then is there any list for it... because i wanted to know about it.... and you have written.... "item effect offset" do they have some offset also ???
???
???
.
.
thanks for the reply though :)
Well, if you use pokemontutorialtv's Advanced Item Editor, it is labeled as "fieldscript". :)
 

LCCoolJ95

Limited Capacity
638
Posts
14
Years
Spoiler:
I saw that you said you made this easier to read. Well:
1. When you mention "Follow the tutorial and do the Emerald part," where is that? I saw that Phenom and kleenexfeu made posts for Emerald, which one is that?
2. You do realize that can offset is required, right? The compiled version has an XX XX XX 08 at the end. If there is, are you talking about the scripts below the tutorial link, when you say: Once you have that done, you're going to have to make this script for all of them? If so, why aren't they listed first, and is it XX+1 XX XX 08 or XX XX XX 08?
3. Do I have to make three versions of the compiled version of the ASM code, one for each Repel? I don't have a problem with it, I'm just wondering.
4. Do I put the ASM code where the field usage is in Item Manager, as what the first post of the link said to do?
5. For the part about inserting the script at 0x2A4B2A, do you literally mean overwriting the bytes there, or you want to repoint the script at 0x2A4B2A to the offset of the giant script created? (i.e. changing all bytes of 2A 4B 2A 08 to XX XX XX 08, where XXXXXX is the offset of the giant script inserted)

I tried a shot at this, and when I selected any repel, the game transitioned to a black screen, freezing the game. So, what's the problem?
 
53
Posts
7
Years
How do I compile the script in XSE?
I think I did it right, I pasted the script in XSE and compiled it and i got: EAF660 as a result, is that what I need?

Darthatron's compiled script was so much longer:
6A 47 0E 80 01 00 21 0D 80 01 00 06 04 1C 00 80 08 0F 00 39 00 80 08 09 03 6C 02 FF 0F 00 54 00 80 08 09 05 68 21 0D 80 01 00 06 01 32 00 80 08 02 FF 23 69 FB 1B 08 02 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD FF 00 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD AD AD FE CF E7 D9 00 D5 E2 E3 E8 DC D9 E6 AC FF 00 FF FF FF FF

I tried using Darthatron's compiled script after I added all the bytes but when I use a Repel I never get any text indicating that it's no longer in effect. I think it's because i've already started working on my hack and added stuff so it's no longer a clean rom.

As you probably can tell i've never done this before and would like some help :3
 

Froosty

The_Learner
535
Posts
9
Years
How do I compile the script in XSE?
I think I did it right, I pasted the script in XSE and compiled it and i got: EAF660 as a result, is that what I need?

Darthatron's compiled script was so much longer:
6A 47 0E 80 01 00 21 0D 80 01 00 06 04 1C 00 80 08 0F 00 39 00 80 08 09 03 6C 02 FF 0F 00 54 00 80 08 09 05 68 21 0D 80 01 00 06 01 32 00 80 08 02 FF 23 69 FB 1B 08 02 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD FF 00 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD AD AD FE CF E7 D9 00 D5 E2 E3 E8 DC D9 E6 AC FF 00 FF FF FF FF

I tried using Darthatron's compiled script after I added all the bytes but when I use a Repel I never get any text indicating that it's no longer in effect. I think it's because i've already started working on my hack and added stuff so it's no longer a clean rom.

As you probably can tell i've never done this before and would like some help :3

Well if you got te result "EAF660" then as Darthatron said goto offset 83100 and start typing 60 F6 EA 08... And your work will be done... if it still doesnt happen then make a reply :)
 
53
Posts
7
Years
So then I should put in: 60 F6 EA 80 01 00 21 0D 80 01 00 06 04 1C 00 80 08 0F 00 39 00 80 08 09 03 6C 02 FF 0F 00 54 00 80 08 09 05 68 21 0D 80 01 00 06 01 32 00 80 08 02 FF 23 69 FB 1B 08 02 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD FF 00 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD AD AD FE CF E7 D9 00 D5 E2 E3 E8 DC D9 E6 AC FF 00 FF FF FF FF
In the offset 83100?
 

Froosty

The_Learner
535
Posts
9
Years
So then I should put in: 60 F6 EA 80 01 00 21 0D 80 01 00 06 04 1C 00 80 08 0F 00 39 00 80 08 09 03 6C 02 FF 0F 00 54 00 80 08 09 05 68 21 0D 80 01 00 06 01 32 00 80 08 02 FF 23 69 FB 1B 08 02 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD FF 00 FF CC D9 E4 D9 E0 B4 E7 00 D9 DA DA D9 D7 E8 00 EB E3 E6 D9 00 E3 DA DA AD AD AD FE CF E7 D9 00 D5 E2 E3 E8 DC D9 E6 AC FF 00 FF FF FF FF
In the offset 83100?

no not all that, but only 60 F6 EA 08(not 80)
 
53
Posts
7
Years
I can't get it to fully work, although it's a step closer.
When I use a Repel it works fine, when i've walked 100 steps the text box pops up and ask me if i want to use another one.
If i say no, nothing happens and I can continue to play.
If i say yes, the game freezes and I can't move, the music however continues to play like normal.

I replaced everything Darthatron said on on Page 1 in HxD, and my complied script 3 times.

Any ideas?
 

Froosty

The_Learner
535
Posts
9
Years
I can't get it to fully work, although it's a step closer.
When I use a Repel it works fine, when i've walked 100 steps the text box pops up and ask me if i want to use another one.
If i say no, nothing happens and I can continue to play.
If i say yes, the game freezes and I can't move, the music however continues to play like normal.

I replaced everything Darthatron said on on Page 1 in HxD, and my complied script 3 times.

Any ideas?

If it freeze after selecting yes then possibly you have done something with hex-editing.
try inserting all the hex codes again....
while inserting

goto that pointer (Press "CTRL+G) paste that pointer

then copy the codes for the specified pointer in the first post....
and goto hex editor and press (CTRL+B) it avoids any other data error....

try it once again and tell me if you still get the problem.. but one thing dont edit anything at 83100 this time :)
 
53
Posts
7
Years
I pasted everything into the pointer's specified in the first post except 03100 and when the repel runs out I just get the standard text-box stating ''REPEL'S effect wore off''.
 
53
Posts
7
Years
Shall I replace the 3 first lines?

Edit: I tried but it's the same thing happening, the game freezes :/

Can it be something with save compatibility?
Nope, tried with a fresh start and still the same freeze.
 
Last edited:
Back
Top