Wednesday, April 30, 2014

Triggers

Moving triggers confirmed working.





You can see the green box outline where the trigger used to be.  This is a collision type that used to indicate a door.  You can still place them, but they don't do anything anymore.

Coincidentally, this also makes maps load a little faster (in-game) since they don't have to search through the whole fucking thing for certain tiles assigning x/y positions anymore .. the new (much simpler) code just pulls from a table of positions I added.

I really just need to support all the other weird trigger types still, and then maps will be .. much more editable.

4 comments:

DragonArk said...

Great work Mop! good to have you on board again! I'm excited to see what you will add :D

Anonymous said...

Good job.

Must be hard to keep track of all the things you have to change or incorporate into the editor.

RetroHelix said...

So you just searched once for all door triggers and put them in your table. The table must be quite big.
So whats left is to store the various flags of each trigger too and your good to go?

Mop said...

The table is an expansion of the existing one that already had the event/door reference for the triggers. It does have the side effect of expanding your rom by 10 or 20k if you change any maps, but that shouldn't really be a big deal.

What's left is two main things .. one, finding the code they use to process return-type tiles like on map 257. I already import these as triggers and write them out, but they are a special id that the game doesn't support yet. My new code will need to unlink the existing tile type to that functionality and instead link this new trigger type to it. That way, they are positionable without having to worry about tile types.

The second issue is figuring out how what I call the "special event" works for maps. I had thought that tiles of collision type 0x01 would simply execute it, and that seems to be the case for many maps (they use it for whip posts, for example) but it also appears as a door on certain maps (258) with seemingly no marker as to where the event should be executed. This is going to take some work to figure out still.