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: The website has switched hosts and now has the domain zeldahacking.net!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Out of Date - Your first script in ZOSE: Version 1.01 - 1.04  (Read 666 times)
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« on: November 13, 2010, 08:12:51 PM »

ZOSE has been updated to 1.05, with this update things have changed. This tutorial is out of date and some things no longer apply. This tutorial will stay online, and the new tutorial will have its own page. It is highly, highly recommended you update to 1.05.

To view the new ZOSE tutorial go to: http://zeldahacking.ulmb.com/index.php?topic=274.0

Before you read this guide, please make sure you've read the ZOSE documentation that comes with ZOSE. With that being said, hopefully this helps a lot of people with ZOSE and get a lot of people using ZOSE.

Lets get started, to start your script you'll first need to open ZOSE. Afterwards you'll be left with a blank screen and you will need to open your ROM. To do so, click "File" in the upper left corner and then click Open ROM. (Ctrl+O if you're lazy)



Once you load your ROM, you will be left with the same blank screen as when you opened ZOSE, but don't worry you can now start you scripting.

What you need to do before you start scripting is find some free space in bank OC, which you can do by going to "File" and then Find Free Space. (Ctrl+F) Once you do you, a window will pop up asking what bank you want to search, and how much space you want to search for. Leave it as it is, and click the search button. A whole bunch of addresses will appear below, choose one. For the sake of this tutorial I have chosen "33FF8".



You will get a piece of code in ZOSE that should look like "writelocation (x)" The X being the address you chose. What we need to do now is set our script to compile to an interaction we can use in ZOLE. To do this we use the code "setinteraction72 (x)" What you use as the X is completely up to you, but I will use 0. (setinteraction72 0) This will make my interaction ID 7200 in ZOLE.

We now need to find free memory for our script, so again go to "File - Find Free Space" but this time click the anywhere box and then click search. I'll be using 1FEC5, but choose one and click ok and you'll get something like "writelocation (x)" Change the writelocation to jump3byte. "jump3byte (x)" Now all we need to do before we can write our actual script is one last line of code. That is "writelocation (x)" Use the same value that you had chose for the previous line of code. You should now have something that looks like this.



Now we are ready to make our script Cheesy In this tutorial I'll discuss some commands that you will use a lot in a script.

One of the first things we do is decide if we want the script repeating over and over again. If we dont, then we will want to use the "checkspecialflag" command. This will check to see if if room flag is set or not. If it is set, the script will not run, if not it will. At the end of your script you will add "setroomflag 80" which will set the room flag so your script no longer runs.

Now you should decide if you want the script to activate at a certain spot rather then immediately upon entering the room. We can use the code "checkmemory" along with D00B (Links Y-Axis) or D00D (Links X-Axis) followed by the position.
An example would be: "checkmemory D00B 96"

Now again, we must decide, do we want the player to be able to control Link while the script is running? You most likely don't, so to stop the player from moving Link, we would use the "disableinput" command. Just make sure to use the command "enableinput" once you want the player to be able to control Link again.

Here are some commands that you will probably use when making a script:

setdelay(x) - Delays the script so not everything happens at once. X changes how long the delay is.

playsound (x) or setmusic (X) - Plays a sound/music depending on what value you choose. Check out the sound/music lists to learn the values.

setcoords (Y) (X) - Sets the coords of the actual interaction. You use for stuff such as the "createpuff" command, or when moving the interaction out of the map when the script is done. Look below to figure out how to get the values.

spawnenemy (ID1) (ID2) (Y) (X) - This will spawn an enemy. To get the first two values go to the enemy list and find the enemy you want to use. (3001 - Blue Tektite in my case) Now take first 2 digits and use it as the ID1, and then the last two digits as ID2. Mine would look like " spawnenemy 30 1 (Y) (X)"  The last two values are just the Y, and X positions you want the enemy to spawn at. You can use the "checkenemycount" command which will make the script see if the enemy count is 0 before it continues.

settile (x) - This will change whatever tile the interaction is over top. To get the value just go to the map with the interaction in ZOLE, select a tile and down below where it says "Selected Tile : (x)" Just take the value.

Make sure to check the ZOSE Documentation for more commands.

When trying to find Y, X, values for commands such as setcoords, go into ZOLE and hover over the tile you want it to be set to, then add the number 8 after both values. Example: Y: 9 X: 1 would become 98, 18.

When you are finished your script, go to "build" and then compile. (Found up top) Then go into ZOLE and create a type 2 Interaction with the ID 72xx, the last two digits depending on what you set it to in your script. (7200 in my example) Go play the game, test your script and fix any issues you may have.

If you want to see a sample script, then you can see one that I made here:
http://zeldahacking.ulmb.com/index.php?topic=189.msg747#msg747
« Last Edit: May 01, 2011, 03:34:59 PM by Fatories » 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!