This is an entire world I made to test the client.screen variable. The problem is, that the obj I add to the screen list doesn't appear on the client's screen. What am I doing wronge? [This code returns no errors at compile or runtime. Also, the placement of ..() in the client.New() proc doesn't seem to effect the result of this test.]
world
maxx=21
maxy=21
maxz=1
client/New()
var/obj/temp1=new()
screen.Add(temp1)
..()
obj/icon='test.dmi'
ID:171703
Aug 19 2004, 11:29 pm
|
|
In response to PKB
|
|
PKB wrote:
var/obj/temp1=new obj() That code returns errors at compile. When I added the missing / so that the first line read "var/obj/temp1=new /obj()" the compiler no longer returned an error, but the code still does not display the icon on the user's screen. Did you test compile and run the code yourself? |
You have to specify a screen location for the object with the screen_loc variable.
|
In response to YMIHere
|
|
Thank you, it works fine.
On a side note, is there anyway to add an image directly to the client.screen variable, instead of having to make a place holder obj to attach the image to? It seems a custom Datom would be better for the system than all the baggage that comes along with instances of the atomic types. |
In response to Elshender
|
|
I don't believe that is possible considering screen_loc is an /atom/movable variable, but I could be wrong. It's been known to happen. =)
|
In response to Elshender
|
|
The whole idea behind putting objects of type /atom/movable into the screen is so you can have an object in your screen that is also on the map for you to see. This setup makes it all the more useful.
For instance, you could put the objects of type /obj/item that are in your contents directly onto the screen so that you can click them there to use them. You would not be able to do that if things were the way you specified, in fact it would be more difficult to get a graphic in the screen at all. You can attach image objects to objects that are in the client's screen list. Perhaps that can help you out. |
var/obj/temp1=new obj()
src.screen+=temp1