Primary Zelda Hacking
April 21, 2014, 09:38:02 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: Tombstone Ghini  (Read 470 times)
Radz
Newcomer
*
Offline Offline

Posts: 39



View Profile
« on: May 16, 2013, 03:07:02 PM »

I'm trying to create a script to replicate the Ghini that come up from tombstones when touched like in Link's Awakening, but I have several screens where this will happen and I do not want to create a seperate script for each one (possibly each tombstone if I cannot figure out a way to loop properly while still checking Link's XY coordinates).

Is there any way to simply check in Link is simply touching a certain tile and can I write it in such a way that it is generic and can be used as a Type 2 pulling coordinates from that in order to spawn the Ghini on the tombstone tile?  I currently wrote it to check if pushing, then check Link's X position, then his Y position, and if those passed it would spawn the Ghini.  Now, if I touch anything else in the map and then simply walk by that particular tombstone it will spawn regardless of it Link actually touches it.
Logged

Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« Reply #1 on: May 16, 2013, 07:36:22 PM »

The way a script works, if you do "checkmemory" it will only pause the script until the condition is met. This means as soon as you push anything, the script continues forward and will never go back. The way you could solve it is to put the position check first (also, there is a memory address dedicated to the tile the player is currently on). At the end of the script, check to see if link is NOT pushing and jump back to the beginning where the position check happens. This way it loops indefinitely without freezing the game.
Logged
Radz
Newcomer
*
Offline Offline

Posts: 39



View Profile
« Reply #2 on: May 17, 2013, 01:06:04 PM »

Okay, the tile position is actually a much better way of doing it since it covers a much larger area.  Here's an example of what I'm thinking:
Code:
checkmemory CC99 44
checkmemory D033 C0

I've tested it and it works, but the problem is that it is localized to a particular tombstone as the trigger.  I can spawn as many different Ghini as I want, but they all appear if I step on 44.  Is there any way to use the interaction's coordinates to check the tile position?
Logged

Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« Reply #3 on: May 18, 2013, 04:36:58 AM »

You can access the interaction's position, but only to write it. Unfortunately, you'll have to create a separate condition in your script. So you don't have to have multiple types of 72s, you can do a jump3bytemc for each gravestone position. If it is possible to check the interaction's position, I don't have the opcode covered.
Logged
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« Reply #4 on: May 23, 2013, 05:02:21 AM »

The memory address FF8B can serve as the address for the tile that Link is currently pushing up against. If you check it to be the tombstone tile (02) then you will be good in that regard; however if you want all the ghinis to be handled through one script then you have a real challenge. Checking what tombstone link is pressing up against to figure out where to spawn the ghini would require extensive and painful jump3bytemc CC99 xx yyyyy, where xx is the YX position of one of the sides of the tombstone. Of course you would need to do this for all sides of every single tombstone.
Logged

The force of a true man can penetrate all. Nothing is safe.
Radz
Newcomer
*
Offline Offline

Posts: 39



View Profile
« Reply #5 on: May 23, 2013, 12:10:15 PM »

Yeah, it's a pretty basic scripting though so making something generic or abstract really doesn't work.  I may actually put this off for some time to see what else I have to script and see if I will have the spare space to script each one individually.  If that turns out to be the case (likely I suspect since Link's Awakening didn't seem to have as many of these  type of situations so most scripts will be for anything I add specifically), I'll just script each one individually with what I currently have in terms of spawning (I spawn the Ghini a half tile above link's position...makes it look right to me), but I will likely use FF8B to check the tile as you suggested in order to get it to react on all sides.
Logged

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!