Primary Zelda Hacking
April 21, 2014, 09:21:39 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: The Power of RAM Editing - Custom Bosses via Regular Enemies  (Read 948 times)
Lin
ZOLE Creator
Administrator
Hero Member
*****
Offline Offline

Posts: 580



View Profile
« on: October 30, 2010, 09:41:30 AM »

Well, I decided to take a brief 10 minutes and document the RAM that enemies take up, which is about 0x40 bytes at Dx80. Here's what I got:

Dx80 - In use byte
Dx81 - Main ID
Dx82 - Sub ID
Dx84 - Enemy stage (For example, 09 in a stalfos is walk, 0A is prepare jump, 0B is jumping)
Dx86 - Movement timer (How long to walk in a direction unless hits a collision)
Dx89 - Movement direction. 00 = up, 08 - right, 10 = down, 18 = left
Dx8B - Y
Dx8D - X
Dx9A - Not sure, but if < 80, enemy disappears
Dx9B - Palette echo
Dx9C - Palette
DxA1 - Sprite index (current step)
DxA2 - Lower byte of data
DxA3 - Upper byte of data
DxA4 - If bit 7 is set, the enemy is vulnerable
DxA6 - Collision height radius
DxA7 - Collision width radius
DxA8 - Damage that gets dealt (FF - [value])
DxA9 - Health - A level 1 sword deals 2 damage
DxAE - Frozen timer (boomerang hit)

Okay, so I just threw something at you that you probably have no idea about. What can we do with this? Why should you care? Because ZOSE is nearing its release, and the scripting engine can memory edit. Unless the spawning is changed, the enemies will end up placed in the same positions in RAM. Bosses take up this same space. Get where I'm going at? No? Well here's what. We can take ZOSE and using it alone, place 5 normal blue stalfos in a room and even control their movement patterns. Once you've killed 4, or all 5 and another one spawns, we can make the last one turn red. It will deal twice as much damage and require 5 times as many hits. Sounding familiar any LTTP fans? We could make it so you can't hurt it until you step on a trigger that freezes it for 3 seconds and you have that long to hit it. All this can be done with the power of ZOSE once I add a new opcode that will allow conditional jumps.

So how would we do all this? Simple. We'd take use of the spawnenemy command to firstly place the enemies, and once we killed em all by using the checkenemycount command, we spawn another one. If we want a trigger check, no problem, just use the checkmemorybit command. The enemy will be placed at D080 since it is the final one, so we know what to place in for x. Then, we can use the setmemory to set its health and how much damage it deals, only once. If we want the trigger to freeze the enemy, we set the boomerang freeze delay. With these kinds of things we can do stuff like make the monster auto heal, maybe steal Link's health, all that stuff, and simply with the power of ZOSE and a little imagination.

~Lin
« Last Edit: May 04, 2011, 08:11:10 PM by Fatories » Logged
RealLink
Newcomer
*
Offline Offline

Posts: 1


View Profile
« Reply #1 on: October 30, 2010, 10:49:19 AM »

Wow, that's really cool. And this is possible for every sprite in the game?
Logged
Jigglysaint
Hacking Guru
Full Member
*****
Offline Offline

Posts: 150


View Profile
« Reply #2 on: October 30, 2010, 04:41:31 PM »

Actually this is better off as a unique interaction for maximum control.

For one thing, the spawn enemy command can only spawn a certain type of enemy.  What if there was a custom enemy sprite that, when loaded, will check to see what the arguments of the interaction are and feed that data to the script?  For example, let's say that sprite 80(don't think it exists) is spawned by a script.  The sprite's sub ID will be any sprite of your choosing, and the new interaction will then read that sub ID, load it, then perform the spawn enemy subroutine.  What you can do with a script you can do with ASM.  The script could then handle the sprite locations, the puff of smoke, and the secondary conditions(if one left, turn it red and change stats).

Furthermore, there is really no difference between interactions, enemy sprites, and projectiles.  Code is code.  Perhaps it's possible to make certain enemies contain scripts.
Logged
Fatories
LALE Creator
Administrator
Full Member
*****
Offline Offline

Posts: 223



View Profile
« Reply #3 on: May 04, 2011, 08:10:40 PM »

I've actually added some stuff to the list and corrected some errors, as the values were missing, not that anybody other than my handsome self would have noticed.

Also a note about those hoping to use "DxA4" in there script I'll tell you right now the description is misleading of sorts. What happens is if you set DxA4 to anything under and including 80 (7th bit) the enemy basically becomes a ghost in the sense you can see them, they do their normal movement patterns and what not, but you cannot interact with them. You walk right over top of them. If set above 80 it basically becomes the regular enemy again, full interaction nothing changed at all (at least that I could tell).
Logged

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

Posts: 41



View Profile
« Reply #4 on: January 13, 2013, 06:43:53 PM »

... if you set DxA4 to anything under and including 80 (7th bit) the enemy basically becomes a ghost in the sense you can see them, they do their normal movement patterns and what not, but you cannot interact with them. You walk right over top of them. If set above 80 it basically becomes the regular enemy again, full interaction nothing changed at all (at least that I could tell).

So in a sence they kind of makes them like blue wisrobes who are able to become tranclucent (but without the change to gfx) in the sence you cant affect them during that period. I wonder if they do use that for when they go inv and phase through walls?
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!