[Tutorial] Marker Orientation

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Chad
level3
level3
Posts: 255
Joined: Wed Sep 26, 2012 8:00 pm

[Tutorial] Marker Orientation

Postby Chad » Sun Mar 08, 2015 12:04 pm

Hey everyone!

Today I want to explain how the orientation of markers work.
The markers on the sprites define where the slots of the object are. With orientation.x and orientation.y the orientation of the object in that slot can be defined. This comes handy when a slot will be occupied by an entity which should face the right direction.

My research found, that the orientation can be set with the values -1, 0 and 1 in both orientation.x and orientation.y.

Basically there are 4 possible orientations: facing north, south, west and east, but there are 9 (3x3) possible combinations of orientation.x and orientation.y with values -1, 0 and 1. My question was how those properties have to be used to get the right result. So I tried each combination and the results are shown in the image below. As the image shows, the orientation.y property is dominant and changing orientation.x when orientation.y is not 0 doesn't have any effect. Also, as orientation.x 0 and orientation.y 0 force the entity to face south, orientation.y 1 is not necessary. With that in mind we get 4 usable combinations (bordered red) to get the four directions an entity can face.

Conclusion
The original spritebank file uses floating point numbers between 0 and 1 to define the orientation. It's not clear why there are floats for the orientation. But most markers just face south. Floating point numbers are not necessary to define the direction. Also only four of nine combinations are actually needed to get entities properly aligned.

Image

Acknowledgement
I want to thank Mr. Peter Green and his family for participating in this experiment.

Original post:
I'm wondering how the orientation of markers works. My initial idea was that the orientation goes from -1 to 1. Like -1 on the x axis for left facing, 1 for right facing and the same for the y axis.
But in the original spritebank file, the marker orientation for x and y axis are float point numbers between 0 and 1. Does anyone know what exactly those values do?
Thx in advance!
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: [Tutorial] Marker Orientation

Postby xander » Sun Mar 08, 2015 4:55 pm

Chad wrote:But in the original spritebank file, the marker orientation for x and y axis are float point numbers between 0 and 1. Does anyone know what exactly those values do?
Thx in advance!

May it have something to do with, for instance, CCTV cameras? They may actually require more flexibility in terms of orientation, and there is no reason not to recycle code when possible.

xander
User avatar
Chad
level3
level3
Posts: 255
Joined: Wed Sep 26, 2012 8:00 pm

Re: [Tutorial] Marker Orientation

Postby Chad » Mon Mar 09, 2015 7:30 am

xander wrote:
Chad wrote:But in the original spritebank file, the marker orientation for x and y axis are float point numbers between 0 and 1. Does anyone know what exactly those values do?
Thx in advance!

May it have something to do with, for instance, CCTV cameras? They may actually require more flexibility in terms of orientation, and there is no reason not to recycle code when possible.

xander


That may be possible, yes. But for cctv cameras, it's more a scripted thing (like rotate until angle x, than change sprite etc.). And there are no other objects that support all 9 directions (as far as I know).

The most common case should be slots for materials, wich should only have 1 possible orientation, and entities with 4 possible orientations.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Tutorial] Marker Orientation

Postby aubergine18 » Wed Sep 30, 2015 10:02 pm

bumping for great justice

took me a while to find this post - any chance it can be sticked in the forum?
murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Re: [Tutorial] Marker Orientation

Postby murgh » Sat Feb 20, 2016 12:09 pm

*Bump* I'm trying to have the prisoners face for example the workshop saw in the correct way, but seem to fail miserably, any idea how to do this? I was hoping I could fiddle around with the middle slot and orientation.x / y values, but that only seems to turn around the stack on the workshop bench, not the position of the worker behind it. How to alter the workers orientation? Or is this not possible?

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 6 guests