ID:263243
 
Code:
client
var
ScreenBuilder/screen_area = /ScreenBuilder/Screen1
proc
SetScreenArea(new_screen)

client/New()
. = ..()
usr = .
SetScreenArea(screen_area)


ScreenBuilder/GetScreenList()
if(!screen)
screen = list()

var
max_inner_x = 0
max_inner_y = 0

inner_x = world.maxx
inner_y = world.maxy

for(var/turf/T in contents)
if(T.type == /ScreenBuilder/InnerMap)
if(T.x < inner_x) inner_x = T.x
if(T.y < inner_y) inner_y = T.y
if(T.x > max_inner_x) max_inner_x = T.x
if(T.y > max_inner_y) max_inner_y = T.y

for(var/atom/movable/O in T)
screen += O

inner_width = max_inner_x - inner_x + 1
inner_height = max_inner_y - inner_y + 1
if(inner_height < 0) inner_height = 0
if(inner_width < 0) inner_width = 0

for(var/atom/movable/O in screen)
O.screen_loc = "[O.x-inner_x+1],[O.y-inner_y+1]"

return screen

ScreenBuilder/Entered(atom/movable/O)
O.screen_loc = "[O.x-inner_x+1],[O.y-inner_y+1]"

ScreenBuilder/InnerMap/Entered(O)
var/ScreenBuilder/screen_area = loc
if(istype(screen_area)) screen_area.Entered(O)

ScreenBuilder/MapBorder/Entered(O)
var/ScreenBuilder/screen_area = loc
if(istype(screen_area)) screen_area.Entered(O)


client/SetScreenArea(ScreenBuilder/new_screen)
if(!isloc(new_screen)) new_screen = locate(new_screen)
if(new_screen == screen_area) return
if(isloc(screen_area))
screen -= screen_area.GetScreenList()
if(new_screen)
screen += new_screen.GetScreenList()
view = "[new_screen.inner_width]x[new_screen.inner_height]"
screen_area = new_screen


Problem description: Ok thats my current screen code and my problem is that I have objects on it which i change and if i change them they change for every user so im assuming the problem is that i need a seperate screen to be generated for each player so if anyone knows how to change the above code to do that it would be helpful.

That's probably because you didn't make it. It looks like that's Dantom's screen builder, which probably isn't the best for what you're looking for.

-Exophus
In response to Exophus
well what is the best then? I chose it because I understood more of it than the others >.< lol
In response to Dragon-wars
Your own HUD system.

-Exophus
In response to Exophus
iF its fotr an HUD, Shadowdarkes is really good. Easy and very effective, I use it myself. Love it.

Look for Shadowdarkes HUDMeter
In response to Pyro_dragons
kk ty
In response to Exophus
Why don't you try saying something actually helpful instead like if you want to develop your own this is a good place to look to find otu what type of coding is required eg...

HUD coding is different to coding you use everywhere else in the game how am i expected to magically know it?
In response to Dragon-wars
I am saying something helpful. Programming a HUD is NOT different than anything else you might program in your game. There aren't any sub-types of programming in DM, so I don't even know what you're talking about there. There also isn't a specific code for programming a HUD. What I said was very helpful because if you program your own HUD, you actually understand it and can possibly make bug fixes on your own, you can tweak it and add things to it easier, and you can actually make it look the way you want it to look.

-Exophus
In response to Dragon-wars
Dragon-wars wrote:
Why don't you try saying something actually helpful instead like if you want to develop your own this is a good place to look to find otu what type of coding is required eg...

HUD coding is different to coding you use everywhere else in the game how am i expected to magically know it?

He's right, its nothing different. Although its more complicated (assuming you talking about HP meters), it's no different.
In response to Pyro_dragons
HP meters is a simple equation turned into an icon state.

...
var/meter=round((src.HP/src.MHP)*30)//30=number of icon_state's
var/obj/meter/M=new()
M.icon_state="[meter]"
...


It's that simple. All you need to do is know how to add them to the screen. If you want multi-tiled bars, then it's just a tiny bit harder, but shouldn't be considered intermediate or hard in my opinion.

-Exophus
In response to Exophus
Exophus wrote:
I am saying something helpful. Programming a HUD is NOT different than anything else you might program in your game. There aren't any sub-types of programming in DM, so I don't even know what you're talking about there. There also isn't a specific code for programming a HUD. What I said was very helpful because if you program your own HUD, you actually understand it and can possibly make bug fixes on your own, you can tweak it and add things to it easier, and you can actually make it look the way you want it to look.

-Exophus

Yeh I was just annoyed because no-one ever seems to actually know how to help with problems when i post or just ignore me of maybe 10 questions ive asked here maybe 1 actually helped me fix the problems although i normally found another way to do it myself after a few months :P. I figured out how to make the HUD myself it's just that it's not really helpful to say just do it yourself because I havn't used screen a great deal or the coding you use for a hud anywhere else even if it could sometimes be used for that. I managed to get it working in the end thanks to sum1 on msn and understand it now so problem solved :P
In response to Dragon-wars
You have to keep in mind people do have other things to program. You also have to keep in mind that some of us programmers do, in fact, have lives. You ALSO have to keep in mind that most programmers could be doing other things, so whatever help you recieve, you should appreciate rather than complain about how little help you've been recieving.

-Exophus
In response to Exophus
Exactly. People aren't always going to answer your questions, nor are people always on the forums. I've waited at least a week before to get an answer to my question, so deal with the fact the people have other things to do. Some people get tired of all of the help vampires and stop helping completely (Mysame alot lol j/k).

Be patient unlike most people for once please. You question will be answered in due time.