Users browsing this thread: 2 Guest(s)
Need help to create a custom event

#4
Posts: 2,551
Threads: 98
Thanks Received: 149
Thanks Given: 163
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
I don't have much time to answer today as well as I'd like, but here is something:

1 - Well, it is your choice and preference where exactly you want to place your new event code, but basically if you do not have any space left to use where you are working, you should go ahead and do the B2 jump command to F1 (or wherever there is free space). If done right, the code will just continue to flow and be read wherever you've jumped to. If it does not and/or crashes, then you're not executing the jump right, or jumping to some unfinished/bad code.

If you do decide to jump in the middle of an event, like the Intro scene for instance, you must make sure to jump back to any unfinished code that needs to be still be read when you are done. The alternative to this is relocating the rest of the code to the new spot as well. Nowadays I tend to opt for the later.

2 - To place the character/NPC(s) inside the map via an event or move them around to different locations at times, you need to set the vehicle/entity's position inside the character queue.
(D5 XX YY). If you are fading in a map, you would want to do this before the map fades in. Use the Level Editor to locate the exact location coordinates of where you want to place the object, and convert the X & Y coordinates to hex, to use for the D5 XX YY command, in order to make it accurate.

Example:
CB/7B54: 10 Begin action queue for character $10 *(NPC $10), 4 bytes long (Wait until complete)
CB/7B56: D5 Set vehicle/entity's position to **(29, 14)
CB/7B59: FF End queue

*Note that NPC $10 is actually NPC #1 on the map in the Level editor.

**These are the coordinates you will see in the Level editor, they must be converted to hex for your code.

You can also create characters to use in events sometimes without putting them on the map via the Level Editor, but that's slightly more advanced - basically you create (3D XX) a playable character that is not being used, and assign graphics (37 XX YY) and a palette (43 XX YY) to it. Just make sure to delete the object (3E XX) after you do this. This is done to save NPC spots in the Level Editor. I can elaborate on this further if need be.

3 - To change tile(s) of the map in an event, you use the replace current map's Layer command. (73 &/or 74.) 73 refreshes the tile change(s) automatically, and 74 needs to be refreshed manually with 75.

Example:
CB/79FF: 73 Replace current map's Layer 1 at (43, 10) with the following (2 x 1) chunk, refresh immediately
CB/7A04: $92, $34 (the tiles to replace)

Example:
CB/7996: 74 Replace current map's Layer 2 at (43, 10) with the following (2 x 1) chunk
CB/799B: $92, $34 (the tiles to replace)
CB/799D: 75 Refresh map after alteration

The higher bits of the X/Y coordinates hold which layer to do the tile replacement on. This is something I just learned how to do recently myself, thanks to Madsiur. I can expand more on this later as well if you'd like.

Event editing requires working with the Level Editor in tandem a lot of the time, so you can look at the map and specific coordinates, help locate and choose tiles to replace, place npcs, find out entrance events & NPC events, etc.


We are born, live, die and then do the same thing over again.
Quote  
[-] The following 1 user says Thank You to Gi Nattak for this post:
  • Astaroth_ (08-29-2013)



Messages In This Thread
Need help to create a custom event - by Astaroth_ - 08-29-2013, 12:11 AM
RE: Need help to create a custom event - by Gi Nattak - 08-29-2013, 05:03 PM
RE: Need help to create a custom event - by B-Run - 08-31-2013, 10:22 AM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite