ID:77536
 
Not a bug
BYOND Version:443
Operating System:Windows XP Home
Web Browser:Firefox 3.5.1
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:After taking a mobs icon through color swap you can not change it's icon_state.

Numbered Steps to Reproduce Problem:make a mob and run its icon through swap color and then have a process change the icon state

Code Snippet (if applicable) to Reproduce Problem:


Expected Results:Mobs icon changes state.

Actual Results:Mobs icon does not change state.

Does the problem occur:
Every time? Or how often?Every time
In other games?Maybe, other games we use swapcolor on dont change the players state.
In other user accounts?Yes
On other computers?Only one to test.

When does the problem NOT occur?When SwapColor has not been used.

Workarounds:
Really isnt a good workaround.
You need to post a code snippet with this issue. The steps to reproduce the problem are not clear without accompanying code.
Lummox JR wrote:
You need to post a code snippet with this issue. The steps to reproduce the problem are not clear without accompanying code.

You can just simply do something like

mob/proc/swap()
var/icon/I = new('player.dmi',"state 1")
I.SwapColor(10001,20002)
src.icon = I
mob/proc/change()
src.icon_state = "state 2"

after change is done with the swapcolor icon it will remain on state 1.
The result of new/icon(file,state) is an icon with only one icon_state. If you wanted to keep all icon states, you'd need to use new/icon(file) without specifying a state to extract.