tModLoader Has anyone made a custom trap?

mouseas

Steampunker
I'm working on my first mod. I'd like to make some new traps which are rotatable (1.3.1 made all 1-block traps so they can be rotated by hammering them). The example mod has some good examples and good starting points, but I'm having trouble with it.

In particular, I'm having trouble getting the graphics to work. I have a sprite image with 4 frames, each indicating the trap's direction. But when I place the traps, the game tries to tile them like a normal building block, which means a few angles get my graphics, but most of them are just the pink reference texture/color. How can I get the tile to display the correct frame based on its rotation, and how can I get the tile to remember its rotation between play sessions?

If anyone has successfully made a trap similar to the ones in vanilla, can I get a code + sprite sample to help me get started?
 
Back
Top Bottom