ID:1762135
 
(See the best response by Multiverse7.)
this works
P << "<img src=\"Puar Face.dmi\">(NPC)Puar: hey [P] you finally arrived"

this does not exactly same code i just copied and pasted it so why would this not work?

and to test if the output wast working i added the text "test" after the chikorita face part AND the text "test" would be displayed

so while this seems minor, any thought on this or why this would happen? to me this makes no sense, how can i start 2 open projects, both with no code in them to have one output something different and the other not even work?
(and what i mean by this does not work is that no image is displayed or outputted)
src << "<img src=\"chikorita face.dmi\">"


Problem description:

two games and i wonder why byond keeps doing this to me

multiple games have i had this happen or similar situations so here is the most simple code and i wonder why this would not work this way

two games with the exactly same code

i just started a new project

and the FIRST line of code i do to test is this piece of code right here

i want to display a 32x32 icon image in the text chat box, this works in one project does not in the other?

EDIT
another note is i had the icon image file in a folder, do i need to define that the icon image file is in a folder?

because i just tested this by creating a new icon outside of the folder and renaming the icon, actually using a icon i already had besides the chikorita face icon file and the image was displayed, just as i would assume it should be or that it should be

EDIT2

now i am wondering what is up with byond
byond will output one image icon file and will not display another, perhaps based on the file name?

i attempted to output "trainermaler.dmi" in the text chat output box, and it displays it is displayed correctly, the image is displayed

i change the file name directory to "chickoritaface.dmi" outside of the folder, and nothing is displayed...with both of the icons being exactly the same, having exactly the same graphic file image within it?

any thoughts..kind of annoying?
Best response
You are just writing it out wrong.

There is an easy way and a harder way.

You can just write it like this:
usr << "\icon['myicon.dmi']"

or like this, which is really the same thing:
usr << "<img class=icon src=\ref['myicon.dmi']>"

Just look at the reference page for the Icon Text Macro.
oh thank you, that sure saves my life and solves my problem, honestly i think i just used my method for so long i never looked into another method, thank you very much.
No problem. You have to always keep an open mind when programming, because the chances are high that you will do something wrong.

Anyway, you made it sound like your method was kind of working, even though it was broken. Is this true? I'm not sure, but it's possible that you were using an older format that is no longer supported or broke with an update at some point. I'm not really sure, but I'm curious about something.
Actually, the format you are using appears to work fine, as long as an actual reference to the icon exists.

My guess is that the icons you are trying to output, do not have an actual reference in your code, so it isn't being loaded as a resource for use. The icon simply isn't there. The difference with the \icon text macro is that it can use an embedded text reference to the icon. The \ref text macro can embed a reference to just about anything in the game, allowing it to be locate()d.