ID:2054169
 
BYOND Version:510.1331
Operating System:Windows 7 Pro 64-bit
Web Browser:
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

User-uploaded custom sprites will display properly in the web client, but will not display in Dream Seeker excepting for the person that uploaded the sprite.

Numbered Steps to Reproduce Problem:

1. Create a new sprite .DMI file
2. Connect to game using both DS and web client
3. Upload the sprite and switch to it when prompted.
4. Compare views between web client and DS.

Code Snippet (if applicable) to Reproduce Problem:
changeicon(i as icon)
set name = "Upload Custom Sprite"
set category = "Character Options"
var/d="[i]"
if(findtext(d,".dmi"))
switch(alert("Do you want to change your icon?","Confirm","Yes","No"))
if("Yes")
var/icon/arg = icon(i)
var/w = arg.Width()
var/h = arg.Height()
if(w>=33||h>=65)
arg.Scale(32,64)
usr.icon = arg
alert("You have successfully set your new icon.")
else
usr.icon = i
alert("You have successfully set your new icon.")
else
return
else
alert("You can only set a .dmi file as your icon.")
return


Expected Results:

DS and Web clients should see the new uploaded sprite.

Actual Results:

Only the sprite uploader and connected web clients receive the new sprite on-screen. All DS users (excepting the uploader if they are using DS) will not see the new sprite, instead they see the old sprite until they move, and then the sprite itself completely disappears.

Does the problem occur:

Every time, in my game only, across every account/username, across every computer I have.

When does the problem NOT occur?

When people are using the webclient to connect instead of DS.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

This issue was also present in 509, unknown if it persists in older versions.

Workarounds:

Unknown
That doesn't sound right. Uploaded icons have been used in games for a long, long time. And the fact that this is only your game is also strange.

Is there perhaps any weird setting of preload_rsc affecting this?
Addendum: This also applies to the \ICON usage for the chat/text window - the custom sprite will show up next to the user-specific text in the webclient, but not in DS - screenshot: http://i.imgur.com/f4HHsoK.png
In response to Lummox JR
Lummox JR wrote:
That doesn't sound right. Uploaded icons have been used in games for a long, long time. And the fact that this is only your game is also strange.

Is there perhaps any weird setting of preload_rsc affecting this?

AFAIK there is no preload_src in my code.
Upon checking, there is indeed no mention of preload_src in my code.
It's preload_rsc.
In response to Lummox JR
Lummox JR wrote:
It's preload_rsc.

Still nothing showing preload_rsc, either, that I can see.
If you send me your source I can try to take a look. It's likely to be really iffy because of the fact that a different player has to do the upload, but I'll see.

Also I recommend a change to your scaling to preserve aspect ratio.

if(w > 32 || h > 64)
var/s = max(w/32, h/64) // scale factor
arg.Scale(round(w/s,1), round(h/s,1))
usr.icon = arg

Beyond that, the alert() you're making is being done in both branches of your if/else, so you can do it after the if/else instead and and save some code. Also, make it an output instead of an alert, because info alerts are really nasty from a UI perspective.
Source - https://www.sendspace.com/file/tmmstv You may/may not have to open up the other .dm files inside the project as well to scan those.
I should clarify, this happens for any user on DS excepting for the user uploading the custom sprite if they are using DS. They will see everything they change, but not changes anyone else makes.