Setmaptile commands involve changing the map temporarily . This allows you to suddenly create new obstacles, or to clear paths. There is something similar to setmaptile I did before. If you recall in the 'Custom Requested Scripts' section, I showed you how to remove a bolder blocking your path. The difference between setmaptile and removing the boulder is that the boulder is technically an "NPC". You can 'create' boulders by adding more person events, but you can't temporarily change the map tiles without setmaptile.
grow_a_tree.pks | |
File Size: | 0 kb |
File Type: | pks |
In the example above, I use setmaptile to replace a 2 X 3 dimension with a tree. If you open the code, you will see this.
#dyn 0x740000
#org @main
lock
faceplayer
message @checkout
callstd MSG_NORMAL
setmaptile 0xA 0x7 0xE 0x1
setmaptile 0xB 0x7 0xF 0x1
setmaptile 0xA 0x8 0x1E 0x1
setmaptile 0xB 0x8 0x1F 0x1
setmaptile 0xA 0x9 0x26 0x1
setmaptile 0xB 0x9 0x27 0x1
special 0x8E
message @done
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
disappear 0x4
setflag 0xAADC
fadescreen FADEIN_BLACK
release
end
#org @checkout
= I'm going to grow a tree!
#org @done
= Okay, I'm done. Bye!
The new lines here is setmaptile, and a special. I will explain the special command first. I don't really know much about this, but this is what I think. There are certain situations where you must declare a 'special event' to occur. You use the 'special' commands. Another special command is 'CAMERA_START' and 'CAMERA_END' (or STOP, I forget). These special commands tell the script to allow the camera to move around the screen. So 0x8E will state that we finished our setmaptiles.
Setmaptile is formatted like this.
setmaptile 0x(X position) 0x(Y position) 0x(hex number of the tile to use) 0x(movement permission change).
To find your X and Y position, when you hover your mouse over a tile on an opened map, the bottom left corner will display the grid coordinate.
#dyn 0x740000
#org @main
lock
faceplayer
message @checkout
callstd MSG_NORMAL
setmaptile 0xA 0x7 0xE 0x1
setmaptile 0xB 0x7 0xF 0x1
setmaptile 0xA 0x8 0x1E 0x1
setmaptile 0xB 0x8 0x1F 0x1
setmaptile 0xA 0x9 0x26 0x1
setmaptile 0xB 0x9 0x27 0x1
special 0x8E
message @done
callstd MSG_NORMAL
fadescreen FADEOUT_BLACK
disappear 0x4
setflag 0xAADC
fadescreen FADEIN_BLACK
release
end
#org @checkout
= I'm going to grow a tree!
#org @done
= Okay, I'm done. Bye!
The new lines here is setmaptile, and a special. I will explain the special command first. I don't really know much about this, but this is what I think. There are certain situations where you must declare a 'special event' to occur. You use the 'special' commands. Another special command is 'CAMERA_START' and 'CAMERA_END' (or STOP, I forget). These special commands tell the script to allow the camera to move around the screen. So 0x8E will state that we finished our setmaptiles.
Setmaptile is formatted like this.
setmaptile 0x(X position) 0x(Y position) 0x(hex number of the tile to use) 0x(movement permission change).
To find your X and Y position, when you hover your mouse over a tile on an opened map, the bottom left corner will display the grid coordinate.
You can also find the tile (or block) values by looking here as well (see picture above). Go to the 'Map' header, hover your mouse on one of the tiles, and see the value.
For movement permission, if you select the tab, your map changes to a bunch of colored boxes with a letter or number in them. The basic ones are these:
0x0 will change the movement permission at the location to 'passable'.
0x1 will change the movement permission at the location to 'impassible'.
So, in my example, since I wanted to grow a tree, I made the tiles impassible after setting the new map tiles. I also used 2 commands involving 'fadescreen'. This is very straightforward. It simply allows your game to change into a black screen with FADEOUT_BLACK, and come back to the regular screen at FADEIN_BLACK. As we have defined the 'FADEOUT', you can use other colors as well. Play around and find out the colors you can use!
Okay, lets create a setmaptile script.
Goal: Allow the change of some flowers into grass, or into signs.
I'm going to create a custom map for this event. You don't have to do this though.
For movement permission, if you select the tab, your map changes to a bunch of colored boxes with a letter or number in them. The basic ones are these:
0x0 will change the movement permission at the location to 'passable'.
0x1 will change the movement permission at the location to 'impassible'.
So, in my example, since I wanted to grow a tree, I made the tiles impassible after setting the new map tiles. I also used 2 commands involving 'fadescreen'. This is very straightforward. It simply allows your game to change into a black screen with FADEOUT_BLACK, and come back to the regular screen at FADEIN_BLACK. As we have defined the 'FADEOUT', you can use other colors as well. Play around and find out the colors you can use!
Okay, lets create a setmaptile script.
Goal: Allow the change of some flowers into grass, or into signs.
I'm going to create a custom map for this event. You don't have to do this though.
setmaptile.pks | |
File Size: | 3 kb |
File Type: | pks |
As you can see above, all I did was change some of the grass tiles to flowers, and some flowers to grass. This is essentially what setmaptile does. Note that the changes are not permanent. After you exit the map, the map will return to it's original state. The only possible way to keep it permanent (I haven't checked this yet), might be to tamper with the map scripts. This lesson is very short, so I don't really have much to say anymore.
What we learned today:
setmaptile (highlight)
special commands
Setmaptile is a very useful tool to help reformat the map after we already created it in game. However, the changes are not permanent. When you enter a map, special events trigger that allow stuff to always happen. Possibly, you can use this feature for setmaptile to permanently change a map. This is the 'Map Script'. Go on to the next lesson to find out more about this nifty feature.
setmaptile (highlight)
special commands
Setmaptile is a very useful tool to help reformat the map after we already created it in game. However, the changes are not permanent. When you enter a map, special events trigger that allow stuff to always happen. Possibly, you can use this feature for setmaptile to permanently change a map. This is the 'Map Script'. Go on to the next lesson to find out more about this nifty feature.