I'm trying to create a hud but idk what to do whay i have coded in it this
obj
hud
icon='turf.dmi'
icon_state="grass"
screen_loc="2,2"
layer= MOB_LAYER+1
ID:159276
![]() Apr 10 2009, 10:39 am
|
|
![]() Apr 10 2009, 10:43 am
|
|
can you show me how... like whats the coding for it?
|
you need to add the hud object to the users client screen.
this is done by :
usr.client.screen += new/obj/hud
If you add this code to your character creation or wherever you feel for it, the hud will show on the screen. im sure there are other, better ways to do this. but this is the way that i used. example: obj Hope this helps |
obj HMmmm Nomatter what the layer is if u want to put this in the hud just put as this obj correct me I may be wrong |
Be careful when messing around with atom/New(). (In this case obj/New()) The first variable should always be the location. In this case, that may lead to something unexpected, like the HUB item appearing in the inventory.
If you're going to change New() like that, I'd define it as obj I may be wrong too, but it's given me trouble in the past. |
you could also do it like this
client/New() this is a demo by flame sage |
Chessmaster_19 wrote:
Be careful when messing around with atom/New(). (In this case obj/New()) The first variable should always be the location. In this case, that may lead to something unexpected, like the HU<s>B</s>D item appearing in the inventory. You're correct. With atoms, new() will automatically put the object in the first argument - it's used for the object's location, so if you put a mob there, the object will end up inside the mob's contents. Most people just directly use the client instead as the mob isn't needed, and if you pass something that isn't a location (like a client) as the first argument, it won't put the object anywhere and will essentially do nothing in that regard. |