Is there any way to manipulate icon state names on an icon dynamically?
Like if an icon has an icon state named "XXX", is there a way to take that icon and change that state name to "YYY"?
Likewise... is there a way to remove an icon state from an icon dynamically?
Like if I have an icon with 2 states, "Walking" and "Flight" is there a way to trim out the player's "Flight" icon state from their icon?
For both of these I'm not looking for the "Oh just open the icon file up in dreammaker and delete/rename the state". I want to do this in code.
proc/export_custom() The code you suggested has worked nearly ideally for me. I also had to include a crop into it to fix some minor issues but your code works great here except for 1 minor issue. It strips out the unwanted icon state no problem. But when it creates the new icon with the renamed state, it strips out the Movement flag on the state. I looked into the Insert() proc a bit and was able to get the movement flag back on the state like this... Insert(new_icon,icon_state,dir,frame,moving,delay) new_icon.Insert(icon(my_icon, state), state == "XXX" ? "YYY" : state,,,1) But that only works obviously if the icon is suppose to be a movement state. Is there a way to return if a state is a movement state or not so I can assign them correctly? |
In response to IceFire2050
|
|
Can't check stuff like that in DM unfortunately.
There is a library that uses a .dll to do that, though: http://www.byond.com/developer/DarkCampainger/DMIIconInfo |
Of course, you can still make an icon with every state other than a particular state, like so:
So if you want to remove the "blah" state from some icon "Stuff.dmi", you could do this:
And with that, you can also make a ReplaceState() by adding the state with a different name from the original.