ID:263349
 
Code:
<html>
<body LINK="#ffffff" VLINK="#ffffff"><STYLE>BODY {background: #666666; color: white}</STYLE>
<center>
<center><b>???</b><br><b>???</b></center>
<hr>
<table width = "100%" style="border: 2px outset #dddddd;">
<tr BGCOLOR="#777777">
<td frame="above"><div align="center">\icon[usr.icon]</A></div></td>
</tr>
</table>


Problem description:
I am trying to get the image of the players icon to appear where the \icon[I] is, but it never comes up just a spot with an X on it. How do I fix it.
If this is part of browse(), than it will not work. You need to send the icon via browse_rsc() and than have the nicknamed file img'd into the browse... eg:
mob/verb/Yay()
browse_rsc(icon('Mob.dmi',"nude"),"NudeMob.png")//exports the icon_state "nude" in the icon Mob.dmi to the usr, the file is named as NudeMob.dmi
usr<<browse("Please wear clothes! <img src=NudeMob.png>!!")


- GhostAnime
In response to GhostAnime (#1)
5.0 System\Character Creation\Main Menu.dm:7::warning: statement has no effect
5.0 System\Character Creation\Main Menu.dm:7:"Mob.png":warning: statement has no effect
5.0 System\Character Creation\Main Menu.dm:7:browse_rsc :warning: unused label

I need the usr current icon there with all the overlas etc
In response to Stephen-San (#2)
I deliberately left some things out in hopes that you would look up the procedures mentioned before using them, and it looks like you didn't. So look it up in DM Reference/F1 and you'll see what is missing.

- GhostAnime
In response to GhostAnime (#3)
Sorry lol. To tell you the truth i did look it up, but i wasn't paying attention. src<< was missing. Thanks.
In response to Stephen-San (#4)
You're welcome >_>

- GhostAnime
In response to GhostAnime (#5)
Well anyways... It was right to a certain extent. When you display he browser again... The icon dosen't update so in other words the image stays the same :(

How do I fix this?
In response to Stephen-San (#6)
I don't think you can send an animated ICON via the method I showed. You need to send an actual animated IMAGE (which is usually .gif if I assume correctly... and I am not talking about /image), otherwise I think it remains on a stand-still...

Someone please correct me if I am wrong.

- GhostAnime
In response to GhostAnime (#7)
No I don't want an animated image. It's just when I open the page again and say I added an overlay hair the hair will not appear. the image just remains the same.
In response to Stephen-San (#8)
Ah, you see, when you "chose" the icon [icon(..) or src.icon, etc etc etc], it does not take overlays/underlays into account, you have to icon.Blend (or something similar) in.

You can not diretly access icons in overlays so you have to pretty much make a proc or something to contain the overlay'd object/icon

An example would be:
mob/proc/overlay(var/atom/A)
...lazy to safety check if it's an icon, an atom [which you have to "convert" to an image and stuff], etc...
src.overlay+=I//Keeps hold of the item, self-defined variable [not built-in]
src.overlays+=I


...The browse() icon thing..
var/icon/I=new//So we can make icon.Blend work
I.icon=src.icon
for(var/icon/A in src.overlay)I.Blend(A,ICON_OVERLAY)//Note this is overlay not overlayS, it won't work with it.
for(var/icon/A in src.underlay)I.Blend(A,ICON_UNDERLAY)
usr<<browse_rsc(I,"Mob.png")//Sends the icon formed, which includes the overlays/underlays from the procedures above


There might be a better way that I do not know of though *shrugs*

- GhostAnime
In response to GhostAnime (#9)
Does it have to be mob.png??

because when I used mob.png it worked ok but when i used

src << browse_rsc(icon(usr.icon),"User Icon.png")

it never worked?
In response to Stephen-San (#10)
You can have it as any extension I think, I am just used to .PNG >.>

The reason why it didn't worked is because you might have referenced to that icon wrong, it would be:

<img src=User%20Icon.png> not <img src=User Icon.png>

" " => %20 in html conversion... or you could of done <img src=[html_encode("User Icon.png")]> but that's a tad bit longer neh?

- GhostAnime
In response to GhostAnime (#3)
GhostAnime wrote:
I deliberately left some things out in hopes that you would look up the procedures mentioned before using them, and it looks like you didn't. So look it up in DM Reference/F1 and you'll see what is missing.

- GhostAnime

Then you should tell them to see the reference, don't bug codes in hopes he'll fix them. If you're giving a code, give a working one. It's okay if you used errors such as identation errors, but this is merely confusing. :p @ u
In response to DivineO'peanut (#12)
Okay, fine, the truth was I forgot to put the src<<browse_rsc(... >_>''

But hey, atleast I made him look into it XD

- GhostAnime
In response to GhostAnime (#13)
runtime error: bad icon operation
proc name: New (/icon/New)
usr: Choose (/mob/player)
src: /icon (/icon)
call stack:
/icon (/icon): New(/icon (/icon), null, null, null, null)
Stephen-San (/client): Topic("Create", /list (/list))


thats what comes up
In response to Stephen-San (#14)
Bump It doesnt work

var/icon/I
I.icon = usr.icon
for(var/icon/A in usr.overlays)
I.Blend(A,ICON_OVERLAY)
src << browse_rsc(icon(usr.icon),"User Icon.png")
src << browse({"
<html>
<body LINK="#ffffff" VLINK="#ffffff">&lt;STYLE&gt;BODY {background: #666666; color: white}&lt;/STYLE&gt;
<center>
<center><b></b><br><b>Creating A New Character</b></center>
<hr>
Preview
<table width = "100%" style="border: 2px outset #dddddd;">
<tr BGCOLOR="#777777">
<td frame="above"><div align="center"><img src=User%20Icon.png></A></div></td>
</tr>
</table>



I have described the problem and Ghost anime has tired to help me but failed.

There is a runetime error
#
runtime error: Cannot modify null.icon.
proc name: Topic (/client/Topic)
usr: Choose (/mob/player)
src: Stephen-San (/client)
call stack:
Stephen-San (/client): Topic("Create", /list (/list))
In response to Stephen-San (#15)
There's a reason why I showed "var/icon/I=new" in [link], so do the same to yours. As for why it needs new to work even if you assigned the icon, I have no idea but I do know it needs it >_>

Also, as I mentioned in the same post, you can not directly access the icons in the overlays list as it contains no actual objects (I forgot what type of special format it has >_<).

- GhostAnime
In response to Stephen-San (#15)
var/icon/I=new('blank.dmi') //a blank icon
for(var/icon/A in underlays) I.Blend(icon(A:icon,A:icon_state,dir,1),ICON_OVERLAY)
I.Blend(icon(icon,icon_state,dir,1),ICON_OVERLAY)
for(var/icon/A in overlays) I.Blend(icon(A:icon,A:icon_state,dir,1),ICON_OVERLAY)
src<<browse_rsc(I,"User Icon.png")
src<<browse({"
<html>
<body LINK="#ffffff" VLINK="#ffffff">&lt;STYLE&gt;BODY {background: #666666; color: white}&lt;/STYLE&gt;
<center>
<center><b></b><br><b>Creating A New Character</b></center>
<hr>
Preview
<table width = "100%" style="border: 2px outset #dddddd;">
<tr BGCOLOR="#777777">
<td frame="above"><div align="center"><img src=User%20Icon.png></A></div></td>
</tr>
</table>"}
,"window=something;size=300x300")


Something like that should work.
In response to Android Data (#17)
I tried it and well it dosent work... The overlays are still not visable
In response to Stephen-San (#18)
Hello
Page: 1 2