Primary Zelda Hacking
April 21, 2014, 09:24:44 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: There is now an official Primary Zelda Hacking Press!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tile Specific Puzzles: Script Tutorial  (Read 266 times)
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« on: December 13, 2011, 02:12:15 AM »

Here is a little mini-tutorial on making a puzzle that involves having certain places on the map being a certain tile. Examples could include tile jumping puzzles like the ones in level 2 B1, map 2E or level 4 1F, map 79. This could also be used for statue moving puzzles like the puzzle on level 2 1F, map 42.

When making a puzzle like this, the general layout will resemble (keep in mind this script is for 3 specific tiles, you may have only 1 tile used or more):
Code:
writelocation Z
checktile YX (1) //Checks first tile to see if it is the one wanted
checktile YX (2) //Checks second tile to see if it is the one wanted
checktile YX (3) //Checks third tile to see if it is the one wanted
jumptilecheck YX (tile) Z //If first tile is a tile that isn't correct, restart script
jumptilecheck YX (tile) Z //If first tile is tile that isn't correct, restart script
jumptilecheck YX (tile) Z //If second tile is tile that isn't correct, restart script
jumptilecheck YX (tile) Z //If second tile is tile that isn't correct, restart script
jumptilecheck YX (tile) Z //If third tile is tile that isn't correct, restart script
jumptilecheck YX (tile) Z //If third tile is tile that isn't correct, restart script
setmemory CCA0 1 // If all tiles are correct, set switch value to open door (interchangeable).

It should be mentioned that this example script is actually for a tile jumping puzzle, where there are 3 colours (red, yellow and blue). Because of this I doubled up the jumptilechecks because you would have to check the tile to see if it was one of the two colours you don't want. If you were doing a statue puzzle there would be no need for two jumptilechecks for one location.

~~~~~~~~~~~

Breaking this down let's start with the 'Z' value. The 'Z' in the script refers to the memory you chose to be your writelocation address. Wherever you see the letter 'Z' in the code, you would replace it with the free memory you chose.

Next is the 'YX' values that are seen in almost every command. This just refers to the location of the tile you want to have a specific tile as. Obviously, this is in YX format so if you want a tile at X: 5 and Y: 4 to be checked; then the value would be 45.

The (1),(2) and (3) values are values that would be substituted with the actual tile you want to be at the location you chose. When writing the value you would NOT use parentheses around it. To get the value of the tile you want, open up ZOLE and hover over the tile; the value will show right below the tileset.
**You don't have to have 3 checktiles, I just used 3 as an example. You would use one checktile per tile you want to check. IF you only have 1, then only use 1.

Now the (tile) values shown in the jumptilecheck would be substituted with the value of the tile you do NOT want to have. Generally this would be the floor or a special tile chosen. What this does is it prevents the script from finishing if someone were to move a statue over the tile location then move it off it. The tile value is NOT inside parentheses.

The last line of the script is interchangeable. You could switch this out for spawning a chest or key. Possibly revealing stairs. In this case I use it to open a door. The memory adresss CCA0 is where the value for the switch bit is stored. Meaning by setting it to  1, a door that is designed to open via a switch will then open because the bit is set.
Logged

The force of a true man can penetrate all. Nothing is safe.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!