Primary Zelda Hacking
April 21, 2014, 09:24:43 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: Creating your first script in ZOSE - 1.05  (Read 614 times)
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« on: May 01, 2011, 03:31:16 PM »

Welcome to a beginners guide on using ZOSE (Zelda Oracles Script Editor). In this guide I will be covering the basic skeleton of your script, and getting your script started. I will not be teaching you how to make any scripts. Should you wish to look of a script for help, there are examples all over the forum for you to feed off of, just be careful and make sure they are for 1.05.

To work with ZOSE we first need to open ZOSE, and there are two ways to go about doing this. There is the most obvious way that I hope to god you'd know how to do, and that is to just run the ZOSE.exe that comes with ZOLE. The other, recommended way of loading ZOSE is by launching it via the launch feature in ZOLE itself. By launching it inside ZOLE it prevents data you dont want to be overwritten, from being overwritten.

Explanation: If you open your ROM in ZOSE then open it in ZOLE, or vise-versa, the programs will only load the data once. What this means is if you go into ZOLE, edit some overworld tiles, then go into ZOSE and make a script, compile it, once you go into game all the changes made into ZOLE will have been overwritten because they were not in the ROM at the time you loaded it into ZOSE.

Once you have ZOSE open you'll see the main ZOSE interface, which is where you will write all of your script. If you didn't open ZOSE by launching it via ZOLE, then you will need to load your ROM by going file, open ROM (Ctrl+O). If you launched ZOSE with ZOLE then your ROM will have already been loaded into ZOSE.

Before we can write our script, we will need to find some free space in the ROM, and to do this we will have to go to the upper left corner and click on the file menu and click the find free space button (Ctrl+F). You should have a screen similar to this one pop up:



Just leave the values the same (both boxes at 100) and click search. A bunch of values will have popped up, they are free space in the ROM that we can use for our script. Go ahead and select a value, for this demonstration I've went ahead and just chosen 17DDB. Once you select a value and click the ok button, you will be taken back to the main interface but this time a line of code will have appeared: writelocation (x), where (x) is the value you chose.

All thats left for us to do now is define our interaction value. With scripts your interaction will always be 72xx, and to set the xx and make our interaction unique and placeable in ZOLE we will use this line of code: setinteraction72 (xx), where (xx) is the value you want. The value can range from 00-FF. So if you wanted to the interaction to be 7201 you would type: setinteraction72 1 (you could also type setinteraction72 01, it does not matter).

You should now have the start of your script finished, and it should look something like this:



With that you are now ready to write your actual script. Your actual script comes right after the setinteraction72 line.

When you are finished your script, go to "build" and then "compile". (Found up top) Then go into ZOLE (make sure to reload your ROM if you didn't use the launch feature in ZOLE) and on the map you want your script, create a type 2 Interaction with the ID 72xx, the last two digits depending on what you set it to in your script. (7201 in my example) Go play the game, test your script and fix any issues you may have.

To view your script after you've closed ZOSE or have started a new script, simply go to the decompile menu then click on Decompile 72 Interaction. A window will pop up asking for the ID. The Id is the last two digits of the 72xx you set for your script. So if you wanted to view 7201, you'd enter 1 in the box.

Check the ZOSE Documentation for an extensive list of memory addresses, commands, etc.

I will now go over some basic commands to help get you started in making your first simple script, whether it's something that spawns enemies onto the map or just a script that changes some tiles.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The "checkspecialflag" command, checks to see if the roomflag 80 (7th bit) has been set. If it has been set then it will halt the scripts progress. This is helpful when you don't want a script to always run when you enter the room, but rather just run one time.

The "setroomflag" command, sets the specified roomflag for the room the script is in. It has one argument and that is the roomflag value. You would most likely use this at the end of your script to set the roomflag 80 so that the checkspecialflag command will halt your script. The final line of code would look like setroomflag 80.

The "spawnenemy" command, allows you to spawn an enemy into your room. It has 4 arguments which are the enemies ID1, and ID2 as well as the Y position and the X position you want it to spawn at. To get the enemy IDs go to the enemy list in the list section on the forums 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. In the end you'll probably have something that looks like this: spawnenemy 30 1 58 78.

The "checkenemycount" command, checks to see if there are 0 enemies in the room. If the room does not have 0 enemies then the script will stop until it does. This is useful for when you would want to spawn a chest after all enemies are defeated.

The "settilepos" command, will set a tile to a different, specified tile. It has 2 arguments, the YX position of the tile you are setting and the tile valie that you want it to change to. If I wanted to change the tile at X: 6 and Y: 5 to a chest, I would then have this line of code: settilepos 56 F0, because F0 is the chest tile vale and 56 is the YX position I wanted to set it at. To find the tile values, just hover over the tile you want in ZOLE and look towards the bottom, it says the value.

The "setcoords" command, sets the coordinates of the actual script interaction (72xx). This is useful because some commands such as the createpuff command activate where the interaction is located. It has 2 arguments which are the Y position and the X position. The final line of code would look something like: setcoords 58 38, where 58 is the Y and 38 is the X.

The "playsound or setmusic" commands, play a sound/music depending on what value you choose. Check out the sound/music lists to learn the values.

The "checkmemory command, will check a specified memory address (check the ZOSE documentation for a list of addresses) and check to see its value. If the value matches the script will continue, if it doesn't match the script will stop until it matches. It has 2 arguments, the memory address and the value. An example would be: checkmemory D00B 58. This example would check to see if Link's Y position matched, if it did then it would continue on with the script, if it didn't the script would wait until it did.

The "setmemory" command, will set a memory addresses value. It has 2 arguments, the address and the value. An example would be: setmemory C6AA 40, which would heal Link back to full hearts.

These are just a few commands you will be using while making your script, make sure to check the ZOSE documentation for more commands, memory addresses and good stuff. I hope this small tutorial helped you get started on your way to becoming a scripter, thanks for reading.
« Last Edit: May 01, 2011, 07:27:49 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!