ID:264325
 
Applicable Configuration:
BYOND Version: 434
Operating System: XP Pro (32 bit)
Web Browser: Firefox
Game/Hub(s): http://www.byond.com/games/MizukoukenKetsu/NarutoADHD
Video Card (for graphics bugs): ASUS AH3450 256MB AGP 8x graphics card

Descriptive Problem Summary: In my character creation coding, the player picks a skin tone he/she wants by pressing the button. (coding below) However, when they're done, they have no icon. Any reason for that? I think it's a bug because when I test the game (not hosted), it all works perfectly fine. I tested this with other people while the I had it hosted. Could it be that the *.rsc file is being corrupted or whatever upon using Build -> Package Files ?

Numbered Steps to Reproduce Problem:
1. Click on hub link above
2. Join
3. Click the New button once finished loading
4. Create a character of your choice
5. When done, observe if you have an icon base or not

Code Snippet (if applicable) to Reproduce Problem:
//When you pick a gender, it gives you an icon to start with, thought you can't see it until you finish.
genderPick(sex as text)
set hidden = 1
Gender = "[sex]"
usr<<output("Gender: <b>[sex]</b>","newOutput")
icon=file("[Gender]BaseWhite.dmi")

//Now for the actual skin tone chooser
skinPick(tone as text)
set hidden = 1
icon= file("[Gender]Base[tone].dmi")
src<<output("Skin Color: <b>[tone]</b>","newOutput")


Expected Results:
The player to have an icon base

Actual Results:
Null icon

Does the problem occur:
Every time? Or how often? Everytime
In other games? Nope
On other computers? Yes
In other user accounts? Yes

When does the problem NOT occur?
It doesn't not occur

Workarounds:
Don't know of any unfortunately :\
Most likely the various .dmi files are not being included in your .rsc file because they aren't listed in single quotes anywhere. Only single-quoted files get automatically included in the .rsc, so if you want to make sure all icons are used, you have to either include them in the game's package when you create the .zip or you have to include them in the .rsc like so:

var/list/needed_files = list(\
'MaleBaseWhite.dmi',
'FemaleBaseWhite.dmi',
...
)


If you do something like that, does it solve the problem?

Lummox JR
In response to Lummox JR (#1)
No, it didn't do anything unfortunately :(
In response to Mizukouken Ketsu (#2)
I'm still quite sure this is a code problem and not a bug, but to rule this out I'll need to see what you tried in your code to fix this.

Lummox JR
In response to Lummox JR (#3)
That's the thing though, it works perfectly fine when I boot up the game from the .dme file. If it didn't work from the .dme file, I wouldn't be reporting a bug; I'd be in the code problems section. It doesn't work ONLY on the hosted version of the world. The one on the hub.

I added the list var like you said and it didn't do anything. Do I need to do something else with it? I've never had this issue before honestly. Everything just... worked o.O

Could there possibly be something preventing the *.rsc file from compiling those specific icons, because as you saw, everything else loaded perfectly fine. It's just the base icons that didn't make the trip. :(
In response to Mizukouken Ketsu (#4)
Mizukouken Ketsu wrote:
That's the thing though, it works perfectly fine when I boot up the game from the .dme file. If it didn't work from the .dme file, I wouldn't be reporting a bug; I'd be in the code problems section. It doesn't work ONLY on the hosted version of the world. The one on the hub.

Having the icon available to the game when it's played on your local machine or hosted from there, but not when it's hosted from another machine, is a strong indicator of a file not being included in the .rsc.

I added the list var like you said and it didn't do anything. Do I need to do something else with it? I've never had this issue before honestly. Everything just... worked o.O

I was asking to see the exact var list you used. I'm curious to know in particular if you did include all the relevant icon files in that list.

Could there possibly be something preventing the *.rsc file from compiling those specific icons, because as you saw, everything else loaded perfectly fine. It's just the base icons that didn't make the trip. :(

No. The only thing that would prevent them from being compiled in would be if they didn't appear in single quotes anywhere in your code.

Lummox JR
In response to Lummox JR (#5)
The game is hosted on a (Unix?) server (yes, an actual server, not a PC) that I have access to through a program.

var/list/needed_icons = list(\
'MaleBaseWhite.dmi',\
'FemaleBaseWhite.dmi')

Pretty much the same you provided, only a different name for the list :)
In response to Mizukouken Ketsu (#6)
Apparently, you forgot to include the different tones for each icon. Which I'm assuming from your first post, should be something like MaleBaseTan etc.
In response to Andre-g1 (#7)
I didn't include them all because I didn't think I'd have to, to test whether it would work or not. I simply added in the 2 base icons that are given when you select your gender. And if no base icon appears, then I can say the snippet doesn't help any. Should I go back and add all the different tones?
In response to Mizukouken Ketsu (#8)
Yes, worth a try.

Right now people that have no icon are probably trying to choose a Tan base which isn't included in the rsc, only the white one is.
In response to Andre-g1 (#9)
Well it doesn't matter because the white one won't even show. >_> No use updating to include unincluded resources
In response to Mizukouken Ketsu (#8)
It occurs to me that including the files in the resource might not actually be enough, now that I think about it. file("...") is always going to fail if the file is not in the game's working directory. I recommend this approach:

var/list/needed_icons = list(\
"base_male_white" = 'MaleBaseWhite.dmi',
"base_female_white" = 'FemaleBaseWhite.dmi',
...
)


And then when you're looking up the base you need, instead of file("[gender]Base[tone].dmi"), you could use needed_icons[lowertext("base_[gender]_[tone]")] instead.

Lummox JR
In response to Lummox JR (#11)
That did the trick! Thanks! :D Oh, and I just realized it's not a bug xD. file() proc looks for a specific file in the game's folder. Since it couldn't find the icon file, it turned out null. That was probably stated in it's definition, but whatever xD