PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Hacking Suite > Resources and Tutorials > Generation 3 (Traditional)

Notices

Generation 3 (Traditional) Traditionally, Generation 3 is hacked using tools, hex editors and patches. This is for you if you do that.

User Tag List

Reply
 
Thread Tools Display Modes
Old 2nd March 2018, 02:03 PM   #21
Avara
Mirage Of Tales Creator
 
Join Date: Nov 2013
Posts: 33
Avara
Default

Changing Map Tiles

The "setmaptile" command, as you could probably guess, allows you to change a map's tiles. This is commonly used in the canon games for puzzles - such as Cinnabar's mansion where you interact with statues to open doors - but it can be used for anything, really.
Quote:
Originally Posted by Avara
setmaptile 0x[X-Coordinate] 0x[Y-Coordinate] 0x[Block Number] 0x[Passable? - 0x0 = Passable, 0x1 = Not Passable]
Your map editor should show the X and Y co-ordinates of the tile you want to change when you hover over it, same with the block number when selecting from the block palette. If you're using AdvanceMap, this data is shown at the bottom of the screen.
In this example, I'm just going to make some flowers appear when you talk to someone in an unedited Emerald ROM. Nothing too fancy!
Quote:
Originally Posted by Avara
#org @main
lock
faceplayer
checkflag 0x250
if 0x1 goto @done
msgbox @msg1 0x6
setmaptile 0x08 0x08 0x04 0x0
setmaptile 0x09 0x08 0x04 0x0
setmaptile 0x0A 0x08 0x04 0x0
setmaptile 0x0B 0x08 0x04 0x0
special 0x91
setflag 0x250
release
end

#org @done
msgbox @msg2 0x6
release
end

#org @msg1
= Bellsprout, use Growth!

#org @msg2
= Aren't Grass-type Pokémon great?
These X and Y co-ordinates are for the tiles between Brendan & May's homes in Littleroot Town. In vanilla Emerald, block number 0x04 is the one containing default flowers. I used 0x0 for the last bit, so that the flowers don't block the player's path. What's the special 0x91 for? This refreshes the map so that we can see the changes we've made. If you're hacking FR, you'll need special 0x8E to refresh the map instead of 0x91. I've also setflag 0x250 so that the script doesn't repeat itself - although you could use a var instead if you wanted.


Yay, it works! But what about when we exit the map? The flowers are gone! We used a flag, so the player can't talk to the NPC to make the flowers grow again. How do we make this a permanent change? We need a second script for the map header.
Quote:
Originally Posted by Avara
#org @start
checkflag 0x250
if 0x1 call @pointer
end

#org @pointer
setmaptile 0x08 0x08 0x04 0x0
setmaptile 0x09 0x08 0x04 0x0
setmaptile 0x0A 0x08 0x04 0x0
setmaptile 0x0B 0x08 0x04 0x0
return
All this does is call @pointer which shows our flower tiles if flag 0x250 is set. We want to add this to the map's header so that the script runs immediately upon entering the map.
To do this, first compile a similar script to the one above and take a note of its offset. Add a "setmaptile" script as shown then paste your offset in the "Script Offset" box if you're using AdvanceMap:


Test again, and this time when you talk to the NPC to make the flowers grow, the map will be changed permanently.

Avara is offline   Reply With Quote
Likes Lunos liked this post
Sponsored Links
Reply

Tags
scripting, tutorial, xse, [Document], [Tutorial]

Thread Tools
Display Modes

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 GMT. The time now is 06:05 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts