ID:269000
 
How do I make an image overlay for all objects of type obj/Red be the icon RedUnknown.dmi if a player is of blue, and vice versa for red?
The way you know if they are red or blue...
var/tmp/red=null
var/tmp/blue=null
mob/Login()
if(!red)
red=src
src << "You are now Red."
else
if(!blue)
blue=src
src << "You are now Blue."

else
src << "Sorry, all player slots are already full."
del src
..()
var/tmp/red=null
var/tmp/blue=null
mob/Login()
if(!red)
red=src
src << "You are now Red."
src.overlays += new/obj/overlays/red()
else
if(!blue)
blue=src
src << "You are now Blue."
src.overlays += new/obj/overlays/blue()
else
src << "Sorry, all player slots are already full."
del(src)
..()

obj
overlays
red
icon = 'image.png'
blue
icon = 'image2.png'

lol to much phpbb


i dont know why you want to use images for this ...

the code i added is UNtested and some of it maybe wrong (if not all of it)

you will also need to sort the tabing out
In response to Zmadpeter
Use <code>
</code> tags, not [dm][/dm] tags. :p
You know, if you're making some kind of 2 player red vs. blue game, as it seems like you are, why don't you make them mobs?

mob/Player
Red
New()
..()
overlays+='Red.dmi'
Blue
New()
..()
overlays+='Blue.dmi'


Then, you would do this:

var/mob/Player
redMob
blueMob

world/mob=/mob/logging

mob/logging/Login()
if(!redMob)
var/mob/Player/Red=new()
Red.client=src.client
redMob=src
src << "You are now Red."
else
if(!blueMob)
var/mob/Player/Blue=new()
Blue.client=src.client
blueMob=src
src << "You are now Blue."

else
src << "Sorry, all player slots are already full."
del(src)
..()
In response to Zmadpeter
That isnt what I wanted, regular icons cant do this, it needs to be images, like Kajikas chest demo, the image appears closed to people who havnt opened it, and opened to people who have opened it.