ID:2924125
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Follow up post of https://www.byond.com/forum/post/2919636
I figured transform might be what we want eventually.

----------------------------------------


client_transform is something like a datum, and it has 4 variables:
* client_transform.south
* client_transform.north
* client_transform.east
* client_transform.west
(There is no southwest, or northeast thing because client sees only one direction.)

4 variables are exactly the same to `transform`, but one of those will be used to a viewer based on their client dir.
For example, if a client.dir = SOUTH, they'll use `client_transform.south`

client_transform takes the same procs as Matrix does, but it works different a bit.

client_transform = matrix()

This initializes everything. This is the same to:
client_transform.south = matrix()
client_transform.north = matrix()
client_transform.east = matrix()
client_transform.west = matrix()

Without initializing, "client_transform" will be considered to be empty.

client_transform.Turn(90)

All directions will do Turn(90)
This is the same to:
client_transform.south.Turn(90)
client_transform.north.Turn(90)
client_transform.east.Turn(90)
client_transform.west.Turn(90)


otherwise, if you do that to a single direction, then just do:
client_transform.south.Turn(90)

Only south transform will do Turn(90)



If a thing has
* transform (x 32, y 0)
* client_transform.north (x 32, y 0 - but Turn(90))
If your client dir is NORTH, transform+client_transform.north both will be applied.
If your client dir is not NORTH, only transform will be applied (because there is no additional client_transform for other directions for this one.)




Q. My character need to Translate to north 32 pixel for every client view.
A. "client_transform.Translate(0, 32)"
This will do Translate() to 4 directions.
Calling a proc from "client_transform" will store the result of 4 direction transforms to 4 variables, so it doesn't have to do like "transform = transform.Translate(0, 32)"

Q. A thing should be located to north regardless client dir.
A. "transform = transform.Translate(32, 0)"

Q. I need to make all tiles to be rotated.
A. a bit tricky...
client_transform = matrix()
// client_transform.north.Turn(90) // no need
client_transform.west.Turn(90)
client_transform.south.Turn(180)
client_transform.east.Turn(270)
// Maybe we'd want to have something to initialize that in this manner..?


and then, if you do "Translate(32, 0)", these will move to where it should go based on their skew value.
This is ugly.
yeah ugly, but this would be simpler than having something new transform matrix like 5x5 size