Thread: [Tutorial] Dive in FR, LG/BG
View Single Post
  #1    
Old March 17th, 2012 (04:25 AM). Edited March 18th, 2012 by Hackrex.
Hackrex
Unhatched Egg
 
Join Date: Aug 2007
Gender:
Dive in FR, LG/BG



At first I have to explain following....
FR is Firered and Feuerrot (Firered German)
LG is Leafgreen
BG is Blattgrün (Leafgreen German)

1. Content

- Foreword
- Knowledge and Tools
- Preparation
- Guide
- Offset for other Roms
- Result
- Conclusion

2. Forword
Hi, today I show you how you can dive in Pokémon Feuerrot/Firered and Blattgrün/Leafgreen.
A big special thanks goes to sonic1 and BattleChan. Without there help it couldn´t be possible for me to write this tutorial.

3. Knowledge and Tools
We need:
- XSE
- AM
- a Rom
- a Hex Editor
- VBA
- .... (a new Underwater Tileset and Map)

4. Preparation
The Script can only work when you have the 5. Badge which allows to surf and to dive. So you have to make a script or fix this, or a battle where you can win this badge, ....

5. Guide
I use a Firered Rom. The offset for the other roms you can find later.

At first we open Advance Map and change the map connections. We go to Tools-->Connections (in German Anbindungen) or press Ctrl+A and do the following.

Abtauchen means dive and Auftauchen means Emerge. Sorry for that but I am from Germany.


(Of course the connection to the map we will dive.)

Now we go to the map in which we want dive and make the same things with the emerge connection.

(Of course the conection to the map we will emerge.)

Now we have to change the mapsettings that a map can called overworld map and the other map can called underwater map. This step is important. Not only that you can call the maps overworld and underwater map. Also you need it that the script can work. We go into the Map Header. Header-->Map-Options. There we have to change it.
We change the Map-Typ to 06 at a overworld map. And 05 to a underwater map. This should look like this.


(Unterwasser is German for Underwater)

After we have done thiis we save all.

THen we open our Rom in a HexEditor. There we navigate to this to Offsets:0x06DF82 and 0x06DF9C and write to Bytes of 00 in it (0000) and save it.

The next thing we have to do are the scripts.
We open XSE and navigate to this offset: 0x1BE38B.
This is our basic-script. This should look like this. If not your rom must be wrong, crashed or ....
Spoiler:
'-----------------------
#org 0x1BE38B
lockall
checkattack 0x123
compare LASTRESULT 0x6
if 0x1 goto 0x81BE3CA
bufferpokemon2 0x0 LASTRESULT
setanimation 0x0 LASTRESULT
setanimation 0x1 0x1
msgbox 0x81BE469 '"The sea is deep here.\nWould you li..."
callstd 0x5
compare LASTRESULT 0x0
if 0x1 goto 0x81BE3D2
msgbox 0x81BE49B '"[buffer1] used DIVE."
callstd 0x4
doanimation 0x2C
goto 0x81BE3D2
lockall
msgbox 0x81BE42B '"The sea is deep here. A POKéMON\nma..."
callstd 0x4
releaseall
end

'-----------------------
#org 0x1BE3CA
msgbox 0x81BE42B '"The sea is deep here. A POKéMON\nma..."
callstd 0x4
releaseall
end

'-----------------------
#org 0x1BE3D2
releaseall
end


'---------
' Strings
'---------
#org 0x1BE469
= The sea is deep here.\nWould you like to use DIVE?

#org 0x1BE49B
= [buffer1] used DIVE.

#org 0x1BE42B
= The sea is deep here. A POKéMON\nmay be able to go underwater.



From this basic script we can make our dive and emerge scripts.
Our dive script:
Spoiler:
#dynamic 0x800000
#include stdattacks.rbh

#org @start
lockall
checkattack 0x123
compare LASTRESULT 0x6
if 0x1 goto @message1
bufferpartypokemon 0x0 LASTRESULT
setanimation 0x0 LASTRESULT
setanimation 0x1 0x1
msgbox @message2 MSG_YESNO
compare LASTRESULT 0x0
if 0x1 goto @buffer
msgbox @message3 MSG_KEEPOPEN
doanimation 0x2C
goto @buffer

#org @message1
msgbox 0x81BE42B MSG_KEEPOPEN
releaseall
end

#org @buffer
releaseall
end

#org @message2
= The sea is deep here.\nWould you like to use DIVE?

#org @message3
= [buffer1] used DIVE

#org 0x1BE42B
= The sea is deep here. A POKéMON\nmay be able to go underwater.


Our emerge script:
Spoiler:
#dynamic 0x800000
#include stdattacks.rbh

#org @start
lockall
checkattack 0x123
compare LASTRESULT 0x6
if 0x1 goto @snippet1
bufferpartypokemon 0x0 LASTRESULT
setanimation 0x0 LASTRESULT
setanimation 0x1 0x1
msgbox @string1 MSG_YESNO
compare LASTRESULT 0x0
if 0x1 goto @snippet2
msgbox @string2 MSG_KEEPOPEN
doanimation 0x2C
goto @snippet2

#org @snippet1
lockall
msgbox @string3 MSG_KEEPOPEN
goto @snippet2
#org @snippet2
releaseall
end

#org @string1
= Light is filtering down from above.\nWould you like to use DIVE?

#org @string2
= [buffer1] used DIVE.

#org @string3
= Light is filtering down from above.\nA POKéMON may be able to surface


If we have import both script we go back into AM. We make a tile with the behavior byte 19 which we need to dive.
This tile we put into our map. On this tile we put a signopost on which we have our script (the offset to our script).
Then it should work.

Our Test shows following. (okay, I have changed the dive connection. Forget my connection on my first picture. It´s the water labyrinth and not Eiland One)



Warning (xD): You don´t have a sprite for underwater. But you can maybe tricks like the gender change script where you can use an other sprite which you make to the underwater sprite or you have to use the surf sprite.
This is not in my tutorial.

6. Offset for other Roms
Offsets where you have to put the 0000´s.
Feuerrot: 0x06DEE6 und 0x06DF00
Blattgrün: 0x06DEE6 und 0x06DF00
Leafgreen: 0x06DF82 und 0x06DF9C

7. Result



8. Conclusion
This tutorial is Copyright by Hackrex and shouldn´t copied without my permission. Link to it is ok.
Again thank you sonic1 and BattleChan.

(DIG UP and DIG DOWN Scripts are possible, too):
There you have to change the text and copy the scripts. Then you need the 5. Badge, too. And you have the behavior 19 on a tile which you have on land and not on water.

Sorry for Bad English
__________________
Temporarily not available
Reply With Quote