0
Beantwortet

2d directional tiles / U- and L-type tiles

Lars Tremmel vor 8 Jahren aktualisiert von Daedalus vor 8 Jahren 8

Hi there


First: I love Daedalus, it´s a great asset!


I created a 2d dungeon with directional tiles and wanted to place sprites on the corner tiles by making the sprites children of the prefab tiles (which are U- and L-type tiles). Problem: The tiles are rotated by the generator depending on their direction, so the sprites attached to them get rotated, too. And that mustn´t happen, because my sprites have to always point at the same direction. Without directional tiles there´s no rotation, but then I wouldn´t know whether a tile is a corner or not (there´s only type "corridorfloor").


Is there a way to prevent rotation of directional tiles? Or is it somehow possible to mark non-directional tiles as corners, if they are corners?


I hope my explanation is understandable :-) I just don´t want a sprite attached as child to a 2d directional tile get rotated with the tile....


Regards

Antwort

Antwort

Yes, thank you.

You can have a look at Prefabs2DPhysicalMap.cs (it's inside Daedalus_Core/Scripts/PhysicalMap/Prefabs2D folder). There's a switch on the DirectionType where the rotation is calculated accordingly. You could add your custom code there.

Let me know if it helps!

Wird überprüft

Hi Lars!

I'm afraid there's no built-in way to avoid that; directional floor will rotate accordingly to the generation flow, no matter what.

What do you mean by "mark non-directional tiles as corners"?

Hi!


Thanks a lot for your fast response!


Concerning the directional floor:


I'd try the non-build in way for stopping the rotation :-) I already searched for it within the scripts but didn't find any rotation settings. Could you tell me where I can find it within the generator scripts? Then I'd try to alter it myself.


Concerning the non-directional floor:


There´s only one floor type, as far as I've noticed. But I need to have the information whether a tile is a corner-tile or not. By the tile's name, tag or some other property for e.g. In case of the directional floor the tiles are named like CorridorFloorL or CorridorFloorU and by this one knows those tiles are corners.


For placing my sprites I need to know whether a tile is a corner or not and that corner mustn't be rotated....


Regards

Lars


*bump*


Any ideas?


Regards

Lars

Hey Lars, what kind of map are you using?

Here´s the map I am using:


I hope this answers your question.

Antwort

Yes, thank you.

You can have a look at Prefabs2DPhysicalMap.cs (it's inside Daedalus_Core/Scripts/PhysicalMap/Prefabs2D folder). There's a switch on the DirectionType where the rotation is calculated accordingly. You could add your custom code there.

Let me know if it helps!

Perfect! I was able to change rotation for my needs now. Problem is solved! Thanks a lot, great support!

Beantwortet

Glad it helped! Please let us know if you need anything else.