Page 1 of 1

Is it possible to create a thing that doesn't rotate?

PostPosted: Wed Mar 17, 2021 5:28 pm
by foul_owl
I've followed the decorate tutorials and have made some basic decorations.

I was wondering, is it possible to make a thing that doesn't always face the player?

If so, what would I add to the thing definition to accomplish this?

I realize the thing would have a thickness of zero, but it could work nicely for some small decorations.

Re: Is it possible to create a thing that doesn't rotate?

PostPosted: Thu Mar 18, 2021 2:33 am
by Lagi
if you have 8 sprites that end with 1,2,3,4,5,6,7,8 it has rotation

if your sprite end with 0 it always face player

check this monster. His frame A has 8 direction, but his ice corpse has only 1 direction and always face player.

for engine the code is absolutely the same, you need only to add more sprites and end their name with numbers 1 to 8 instead 0.

so if you have Decoration0 sprite, just rename it to Decoration1, and draw Decoration 2... Decoration8.


Re: Is it possible to create a thing that doesn't rotate?

PostPosted: Thu Mar 18, 2021 4:57 am
by Jarewill
Alternatively, you could add the FLATSPRITE / WALLSPRITE flag to your actor.
WALLSPRITES will always stand straight, but still will need to be rotated properly, meanwhile FLATSPRITES will lay on the ground and will have to be tilted using the pitch property.

Re: Is it possible to create a thing that doesn't rotate?

PostPosted: Thu Mar 18, 2021 4:06 pm
by foul_owl
Lagi wrote:so if you have Decoration0 sprite, just rename it to Decoration1, and draw Decoration 2... Decoration8.


Thank you! I really just need a "side view".

So I can just make a sprite 3 and 7 and it will work?

Re: Is it possible to create a thing that doesn't rotate?

PostPosted: Fri Mar 19, 2021 1:04 am
by Jarewill
foul_owl wrote:So I can just make a sprite 3 and 7 and it will work?

Not possible, the game will error out if there's not enough rotations.
There has to be either 0 or all 8 rotations for it to work.

However you could copy the 3 and 7 rotations and rename them to the rest.
For example: Rot3 would be copied and named rot1, rot2 and rot4, meanwhile rot7 would be copied and named rot5, rot6 and rot8.

Re: Is it possible to create a thing that doesn't rotate?

PostPosted: Fri Mar 19, 2021 2:01 am
by Lagi
I would draw 2 sprites (front back / and side), call them

BOXXA1A2A8A5A4A6
BOXXA3A7

not sure if 1st naming will work (never use that), but second name BOXXA3A7 (for both side direction) work for sure