I have code in my game that affects the color of turfs upon their creation, based upon the area that the turfs occupy.
For me when I'm playing locally on my desktop and testing they work fine, but when I host the game and allow others to play, they login and see nothing but black space where the grass should be.
Upon having this pointed out to me I tested it, and it seems that it only occurs when connecting using Dream Daemon. It's rather inconvenient since I have one grass turf that the colors get changed to 5-6 times throughout my project for different areas of the game.
Logging out and logging back in seems to fix this problem, but after posting on the forum to no avail and asking around I can't really track down an issue or way to fix this. Thus I'm thinking it may be something that might need to be fixed by the Byond Gurus.
Numbered Steps to Reproduce Problem:
Code Snippet (if applicable) to Reproduce Problem:
ChangeC(var/seccolor,var/xx,var/yy)
var/icon/hx=new(icon)
var/currcolor=hx.GetPixel(xx,yy,icon_state,0,1,0)
hx.SwapColor(currcolor,seccolor)
src.icon=hx
grass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")//20,186,82-12,110,48
ChangeC(rgb(30,104,0),1,1)//dark
ChangeC(rgb(39,125,0),2,2)//med
ChangeC(rgb(57,181,0),5,6)//light
if("volcano")
ChangeC(rgb(84,87,34),1,1)//dark
ChangeC(rgb(106,117,43),2,2)//med
ChangeC(rgb(120,156,99),5,6)//light
if("swamp")
ChangeC(rgb(72,110,85),1,1)//dark
ChangeC(rgb(113,150,126),2,2)//med
ChangeC(rgb(140,186,156),5,6)//light
..()
icon_state="grass"
densegrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(46,54,0),1,1)//light
ChangeC(rgb(55,79,0),2,2)//med
ChangeC(rgb(56,105,0),5,6)//dark
if("volcano")
ChangeC(rgb(84,87,34),1,1)//dark
ChangeC(rgb(106,117,43),2,2)//med
ChangeC(rgb(120,156,99),5,6)//light
if("swamp")
ChangeC(rgb(72,110,85),1,1)//light
ChangeC(rgb(113,150,126),2,2)//med
ChangeC(rgb(140,186,156),5,6)//dark
..()
icon_state="grass"
density=1
stillgrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(46,54,0),1,1)//light
ChangeC(rgb(55,79,0),2,2)//med
ChangeC(rgb(56,105,0),5,6)//dark
if("volcano")
ChangeC(rgb(84,87,34),1,1)//dark
ChangeC(rgb(106,117,43),2,2)//med
ChangeC(rgb(120,156,99),5,6)//light
if("swamp")
ChangeC(rgb(72,110,85),1,1)//light
ChangeC(rgb(113,150,126),2,2)//med
ChangeC(rgb(140,186,156),5,6)//dark
..()
icon_state="stillgrass"
//---
medgrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(30,104,0),1,1)//dark
ChangeC(rgb(39,125,0),4,3)//med
ChangeC(rgb(57,181,0),4,10)//light
if("volcano")
ChangeC(rgb(84,87,34),1,1)//dark
ChangeC(rgb(106,117,43),4,3)//med
ChangeC(rgb(120,156,99),4,10)//light
if("swamp")
ChangeC(rgb(140,186,156),4,10)//light
ChangeC(rgb(113,150,126),4,3)//med
ChangeC(rgb(72,110,85),1,1)//dark
..()
icon='Props.dmi'
icon_state="medgrass"
medstillgrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(30,104,0),1,1)//dark
ChangeC(rgb(39,125,0),4,3)//med
ChangeC(rgb(57,181,0),4,10)//light
if("volcano")
ChangeC(rgb(84,87,34),1,1)//dark
ChangeC(rgb(106,117,43),4,3)//med
ChangeC(rgb(120,156,99),4,10)//light
if("swamp")
ChangeC(rgb(140,186,156),4,10)//light
ChangeC(rgb(113,150,126),4,3)//med
ChangeC(rgb(72,110,85),1,1)//dark
..()
icon='Props.dmi'
icon_state="medstillgrass"
//---
tallgrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(30,104,0),1,13)//dark
ChangeC(rgb(39,125,0),5,16)//med
ChangeC(rgb(57,181,0),2,37)//light
//----------
if("volcano")
ChangeC(rgb(84,87,34),1,13)//dark
ChangeC(rgb(106,117,43),5,16)//med
ChangeC(rgb(120,156,99),2,37)//light
if("swamp")
ChangeC(rgb(140,186,156),2,37)//light
ChangeC(rgb(113,150,126),5,16)//med
ChangeC(rgb(72,110,85),1,13)//dark
..()
icon='Props.dmi'
icon_state="tallgrass"
tallstillgrass
New()//,,
var/area/A=src.loc
if(A)
switch(A.bgset)
if("cave")
ChangeC(rgb(30,104,0),1,13)//dark
ChangeC(rgb(39,125,0),5,16)//med
ChangeC(rgb(57,181,0),2,37)//light
if("volcano")
ChangeC(rgb(84,87,34),1,13)//dark
ChangeC(rgb(106,117,43),5,16)//med
ChangeC(rgb(120,156,99),2,37)//light
if("swamp")
ChangeC(rgb(140,186,156),2,37)//light
ChangeC(rgb(113,150,126),5,16)//med
ChangeC(rgb(72,110,85),1,13)//dark
..()
icon='Props.dmi'
icon_state="tallstillgrass"
/*since the problem seems to be fixed by the player logging in or out, I included code for the login and logout.*/
Login()
..()
if(copytext(key,1,6) == "Guest")
alert("This game cannot be played as a Guest. Please Login with your pager active.","Ok")
Logout()
else
saveable=0
world<<"[src.ckey] has logged in."
world<<sound('loginsound.ogg',0,0,0,25)
spawn(30)
winset(usr,"CoverWindow","pos=200x50")
OpenNewWindow(usr,"CoverWindow")
usr << sound('startscreentheme.ogg',1,0,0,50)
winset(usr,"StartScreen","pos=200x50")
OpenNewWindow(usr,"StartScreen")
var/obj/HUD/CherryBlossoms/b=new
client.screen+=b
Logout()
if(!CheckSafeArea())
src << "Logging out -- You may lose unsaved data."
spawn(30)
icon_state="idle"
src << "Thanks for playing."
world<<"[src.ckey] has logged out."
del(src)
..()
else
spawn(30)
icon_state="idle"
RecordProgress()
src << "Logging out. Thanks for playing."
world<<"[src.ckey] has logged out."
world<<sound('logoutsound.ogg',0,0,0,25)
del(src)
..()
Expected Results:
The turf "grass" and all of its forms would change a different color, based on the area type.
Actual Results:
It does work, but will only show up if other players logout, then log back in to the game.
Does the problem occur:
Every time. In other games and only on maps where the turf's color is changed/affected.
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
It's been a persistent problem.
Workarounds:
Logout/Login
While this may be a bug, I would still suggest you cache the icons so you don't have to create 10000 of them (for a 100x100 map)