In any case, I'm trying to work smarter, not harder, and if I can pull this off it would be awesome as it would save a lot of content generation work. Here's the code:
/* RebuildIcon()
Created in mind of actually dynamically creating a character icon reflecting
various directions and equipment states. */
proc/RebuildIcon()
var/icon/baseIcon = icon('imgMobPlayer.dmi',"default")
var/icon/changeIcon
// baseIcon.Turn(45) // This works - my eventual goal is to make an 8-directional icon
// Unfortunately, I can't seem to make even a four-directional icon
changeIcon = new('imgMobPlayer.dmi',"default")
baseIcon.Insert(changeIcon,"default",dir=EAST)
changeIcon.Turn(90)
baseIcon.Insert(changeIcon,"default",dir=SOUTH)
changeIcon = new('imgMobPlayer.dmi',"default")
changeIcon.Turn(180)
baseIcon.Insert(changeIcon,"default",dir=WEST)
changeIcon = new('imgMobPlayer.dmi',"default")
changeIcon.Turn(270)
baseIcon.Insert(changeIcon,"default",dir=NORTH)
icon = baseIcon
What I want it to do: Take a single frame, single-directional icon (with only one facing) and, from this, use code to generate an 8 directional icon, then assign it to the mob under a the single icon variable.
What I seem to be getting: the single frame, single directional icon I started with.
My question: what mistake am I making that is preventing this code from creating four directions in a dynamically created icon?
Seeing how that baseIcon.Turn seems to work just fine, there are workarounds - such as having 8 variables for each direction or just reassigning the icon and turning it each time the character moves - but they're bloaty. A single icon variable with working directions is my goal.
Yes, I've seen the reference and ran a search over existing resources with "icon" as a keyword (and was predictably flooded).
The following was not tested, may require a bit of tweaking.