ID:161710
 
Applicable Configuration:Dream Seeker
BYOND Version: 4.0 and up
Operating System: Win XP
Web Browser: Firefox though n/a
Game/Hub(s): hub://www.byond.com/games/Dpheonix7/ Dragon_Warrior_Heros_Destiny
Video Card (for graphics bugs): dont know

Descriptive Problem Summary:I have player icons that players can change the colors too. If they choose their own colors the icons work fine in text, but if they don't, it only shows the first icon in the player.dmi file containing all the player icons.

Numbered Steps to Reproduce Problem:Make a character and don't select custom colors.

Code Snippet (if applicable) to Reproduce Problem:
world << "[src] says: \icon[src.icon] [message]."


Expected Results:To have the correct icon state show in text

Actual Results:The wrong icon state shows in text

Does the problem occur:
Every time? Or how often?everytime
In other games?yes
On other computers?yes
In other user accounts?yes

When does the problem NOT occur?it always accurs

Workarounds:using [src] after icon instead of [src.icon] will show the icon properly in chat, but then custom colored icons don't show at all.

This isn't a bug. If you look up the \icon macro in the reference, you'll see that to specify the icon_state, you should not use that macro. Instead you should use the <img> tag directly:

world << "&lt;img class=icon src=\ref[src.icon] iconstate=\"[src.icon_state]\"&gt;"


Lummox JR
In response to Lummox JR
Thanks. The way I was doing it worked in 3.5, but guess there was a bit of a change for 4.0
In response to Dpheonix7
Dpheonix7 wrote:
Thanks. The way I was doing it worked in 3.5, but guess there was a bit of a change for 4.0

Nope, it shouldn't have changed. If you don't specify an icon_state it's going to default to the first one in the file. Your colored icons are apparently not just coloring the icon, but extracting just that specific state. So you're seeing different behavior between the icons because the two icons don't have the same states.

Lummox JR
In response to Lummox JR
Ok I have tried and it still is not working. Both ways are defined in the same way for icon states. I have icon A for non colored and icon B for colored, same icon states each. I do know that if I use this system in 3.5 it works perfect.