ID:1871773
 
Redundant
Applies to:Dream Seeker
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
Hi there again everyone.

Now I've been toying with an implementation of client.dir within a game and a method to allow players to rotate it at will.

Ultimately the challenge has boiled down to giving many objects directional icon states with simply rotated versions of the same icon ad nauseam. As well as fixing multitile objects, which is another can of worms entirely.

In projects with many many icons converting single icons to directional states becomes unfeasible. Therefore if the rendering engine could automatically orient these specific icons by turning them with direction when say a byond variable is enabled, it would save countless duplicated effort in recreating icon states.

I have no idea how simple/feasible this is as I have no personal experience with renderers.
On a side note, overlays aren't rotated with client.dir. I assume that is primarily related to the way appearances are generated. So perhaps I should make another request that when an icon state is added as an overlay it gets added according to directional state?
Overlays definitely should be rotating with client.dir. The same code governs them as the parent atom. If you have an example project I'll take a look.
Thanks ill be sure to link it and post some code next time I have access to my repository.
The issue I described earlier came from a function to 'smooth' carpets together so that they have an outer border on edge tiles, and if they are in a configuration like below (C is carpet, O is not)
C O
C C
the bottom left carpet will have a diagonal connecting the top left and bottom right carpet. In my code there is a 4 directional icon_state for the carpet diagonals, which are applied as an overlay. The four diagonals are applied from a global list containing each of the 4 directions as an image going each cardinal direction (because this seems to be more efficient in the case that an icon state can be altered rapidly and overlays need to be reapplied)

if(diagonals["[name]"] == null)
diagonals["[name]"] = new /list(4)
diagonals["[name]"][1] = image("floors.dmi", "carpet-d", dir = 1)
diagonals["[name]"][2] = image("floors.dmi", "carpet-d", dir = 2)
diagonals["[name]"][3] = image("floors.dmi", "carpet-d", dir = 4)
diagonals["[name]"][4] = image("floors.dmi", "carpet-d", dir = 8)


When a carpet is first made this list is created, and it does work it shows all the correct images. However, it does not seem to rotate with direction, which is strange because the same method is applied elsewhere without this issue. Perhaps because I explicitly defined dir in its creation?
With dir set explicitly on an overlay, it should have a flag that says the dir is fixed and does not change with the parent atom's dir. However, it should still be sensitive to changes in client.dir.

The dir rotation for client.dir is done at the level where the individual icon is grabbed, so it's agnostic as to whether it's dealing with an overlay or the main atom.
How strange, I suppose that means it should be rotating normally? Here are some images of this seeming bug in action

1. From the normal south orientation
http://puu.sh/irCjp/92d6051884.png
2. From the eastward orientation
http://puu.sh/irClt/f6c2fea80c.png
3. The directional icon_state
http://puu.sh/irCos/a22fd1ef44.png
The problem is the corners and their rotational relationship with each other weren't designed to be rotated. Consider the following rotations of just the corners. If you flip SOUTH 90 degrees counterclockwise (client.dir = WEST) to make the corner face EAST, you go from the topleft corner to the bottomright corner, a 180 degree rotation. If you flip SOUTH 90 degrees clockwise (client.dir = EAST) to make the corner face WEST, you go from the topleft corner to the bottomleft corner, a 90 degree rotation in the wrong direction.

I believe it would work right if south and west were switched becase north and east are fine. You can tell because there's an east-north rotation in the picture that works fine.
Perhaps so, I'll have to try it. Well this whole topic really went off on a tangent didn't it.
Yep, the problem is definitely with that corner icon, nothing more.
Lummox JR resolved issue (Redundant)