Title: Most Common Dungeon Events Post by: Lin on June 21, 2010, 11:51:33 PM This is a tutorial on creating the most common dungeon events, such as opening doors when enemies are killed, creating a chest when a trigger is pushed, etc... The list will be updated from time to time.
Opening Doors when All Enemies are Killed Step 1: Create a Type 2 Interaction. Step 2: Set the X position to 0. The Y position is the YX location of the door. For example, 5E; 5 being the Y and E being the X. Step 3: Assign the first 2 digits of the ID to 1E (Always 1E when dealing with doors). Step 4: Open a calculator that can convert binary to hexadecimal (I recommend Windows Calculator in Scientific Mode). In binary mode, make the code '10', which results in decimal 2. The next 2 bits are the direction of the door to open. 00 is Down, 01 is Left, 10 is Up, 11 is Right (Note these are the directions of the doors, so 00 would end up being placed on the North wall, 01 on the East wall, etc...). So if we wanted our interaction to open up the right door at 5E, the right 2 digits of the ID would be 09 (The binary code we made would be 1001). The final ID of our interaction would be 1E09. ~Lin Title: Re: Most Common Dungeon Events Post by: Jigglysaint on June 23, 2010, 04:50:33 PM It appears as if your reasoning is a bit off for how door directions work. For one thing, it's not bitwise, but in fact an index that leads to events in back 0C. Second of all, index 04 is used for an up direction door for events that have a toggle, and 08 is for an up facing door that checks to see in all enemies are defeated. The information is within the index, and you could pretty much change it to some other event like make a key fall down. There is also an event in Seasons that closes a door when you trigger the room's trap. The door does not exist as 1E, but as part of the event code in that room.
Title: Re: Most Common Dungeon Events Post by: Lin on June 24, 2010, 05:32:55 AM Hmm... Are you sure it's not? I've tested and the 3rd bit (*xx) controls if the doors open from a trigger, block being pushed, or something else. The first two bits then control the direction again. The 4th bit (*xxx) should control enemies needed to be killed... I haven't actually looked at the code, but this is more from trial-and-error. I've tried other values that would resemble the door directions in the tileset, like using the boss key doors, but then I noticed it's two-bit-based (Or seems to be bit based. If you don't have the 4th bit set and kill all the enemies, the door won't open. If the 3rd bit is set, and you push a trigger, the direction from the two bits will open).
I've figured out a lot of other events, such as the key falling down method (Like re-created the LA Tail Cave room to the left of the entrance. That was a piece of cake to make the enemies, the key fall, and the door open). The key falling's ID was 1201. The door facing right's ID was 1E0B. 0B in binary translates to 1011, which is the all-enemies-killed bit set, and the 11 which is the right door. Another test I performed was creating a trigger with ID 900 (Aren't all triggers 900?), and set the door-opening interaction ID to 1E07. 07 in binary is 111, which is a trigger pushed and some other stuff and the right-direction door, and when pushed, the door facing right opened. Sorry, I'm just blabbing on, but 08 should be down opening up when all enemies are defeated (Which it is. Check room 25 of Level 1). And in binary that translates to 1000, which is the all-enemies-killed flag and the two bits represent the down-direction door, which is used. Who knows, maybe it's all a coincidence, but it makes sense. Title: Re: Most Common Dungeon Events Post by: Jigglysaint on June 24, 2010, 03:50:53 PM Room 25 in level 1 does not have a down facing door, it has an up facing door. I also tested with index 04 and changed it's pointer to 83 46, which is the key falling down event 12 01(or where it's data points to). It made the up facing door not work when I put the cube on the hole, but a key dropped when I beat all the monsters. I think where you are getting confused is that apparently index 0 - 03 don't seem to be used. The pattern is always up, right, down, left. 00 to 03 are not used, and might be ini data. 04 to 07 are for floor switches, 08 0B are for enemies, unsure what 0C to OF are for, and 10 to 13 are for one way doors.
Edit: I think I might have misunderstood your post. When you mean a down shutter that opens up, you basically are refering to tile 78, right? The way you wrote, it seemed you were saying that tile 7A direction was first, then the others. Basically everything in the game, if it's direction based, goes in a clockwise direction from up to left. The pushable blocks work like that too. Title: Re: Most Common Dungeon Events Post by: Lin on June 24, 2010, 05:51:08 PM When you put it that way, that makes a lot of sense, but really the binary way I explained it is really just a more complication explanation of that that just so happens to work. And yes, by down I meant tile 78, since the spikes were on the bottom. Also, 10-13 being one way doors; isn't that kind of useless? If you have a shutting door and nothing that opens it then it technically is a one way door and that's a waste of 4 bytes.
Personally I like explaining it the bit way since it's good practice (I'm going to imagine that a lot of people hacking these games are like people using Advance Map and other Pokemon tools) and makes a lot more sense, because notice how all of your numbers depended on the first 2 bits being the direction and other bits as "flags". Title: Re: Most Common Dungeon Events Post by: Jigglysaint on June 24, 2010, 10:00:28 PM The game does make use of one way doors, but I think somthing else might trigger it that isn't often used. It's like how event 2B in Link's Awakening is used for both one way doors and doors you smash a pot into to open it up.
Right now I'm trying to find the sprite data ASM pointers. I've discovered an interesting thing that sprite 2B, which is used in the Vire/Donkey Kong minigame to make the fireballs appear. Normally on a sideview map, you can't go up or down rooms unless you are on a ladder. For this room which contains that sprite, it allows you to fall off the edge of the platform to the floor below, but only in one particular spot. If I find out how this spot is added, I could create a custom interaction that could allow this for any sideview room I want. In short, it would allow for more complex sideview areas. Title: Re: Most Common Dungeon Events Post by: Gamma 31 on August 08, 2010, 01:16:26 AM How would you make a door open when a block is pushed?
Title: Re: Most Common Dungeon Events Post by: Jandazekon on August 08, 2010, 06:59:50 AM How would you make a door open when a block is pushed? Into a trigger??? Title: Re: Most Common Dungeon Events Post by: Jigglysaint on August 09, 2010, 01:16:35 AM How would you make a door open when a block is pushed? You need to use interaction 1301 and place it over the block. Note that what this does is when you enter the room, and monsters are still on screen, the block's ID turns to 1D, but the graphic is not updated. When you set the clear monster flag(by beating all monsters), it will revert the tile back to what it's supposed to(with no on screen cue). This means you can create a treasure chest that won't open when you defeat all enemies, or do other stuff. If on a screen with no monsters, you could even make a bush, when cut, open a door. Basically if the spot is distrubed, it will cause the doors to open. Also of note is 13 03 will set bit 7 in the room flag data when all monsters are killed, and 13 04 will locate on screen, the nearest from the top, a certain floor that will turn into stairs and stay that way. These certain tiles have one for acending stairs, one for decending stairs, and two wall tiles that become staircases. I forget what 13 00 and 13 02 do. Title: Re: Most Common Dungeon Events Post by: Gamma 31 on August 11, 2010, 11:59:10 PM OK. Thanks!
|