ID:149296
May 31 2002, 1:14 pm
|
|
I am trying to make a HUD for my game, however when I used WizDragon's code, and when I adapted it to my game settings, it won't show up. The first time, it claushed with my items, and I had to create an object directory for it. I fixed it from clausing, but it still does not show. Help?
|
May 31 2002, 3:45 pm
|
|
Why does no one respond!?
|
In response to Ryuo
|
|
Two reasons:
1) I'm not familiar with WizDragon's HUD system and you posted no code for me to examine. 2) I have no idea what you mean by "claushed". |
In response to Shadowdarke
|
|
Ok... >.<
I mean't clashed. Heres the code: new /obj/Meter/black(client) //create the hud objs so they are added to the screen new /obj/Meter/HP(client) new /obj/Meter/meter(client) var/num_position = 1 while(num_position <= 4) //quickly create 4 HUD numbers, each with positions of 1-4 new /obj/Meter/number(client,num_position) num_position += 1 HPRefresh() ..() proc/HPRefresh() //this will refresh the HP numbers var/text_HP = num2text(HP) //create a text string from your HP if(lentext(text_HP) == 1)text_HP = " [text_HP]" //the text string MUST have a length of at least 4 to work correctly if(lentext(text_HP) == 2)text_HP = " [text_HP]" if(lentext(text_HP) == 3)text_HP = " [text_HP]" for(var/obj/Meter/number/N in client.screen) //check for numbers in the screen var/new_icon_state = copytext(text_HP,N.position,N.position+1) if(N.icon_state != new_icon_state) //don't set the icon_state if unnecessary N.icon_state = new_icon_state //set the icon state obj Meter New(client/C) //define the New proc for objs C.screen += src //add the object to your screen ..() //perform default New stuff black layer = MOB_LAYER+1 //set the layer so that it appears over things icon = 'Icons.dmi' icon_state = "grey" screen_loc = "1,1 to 11,1" //when this is added to your screen, //it will appear from the first loc to the second loc HP layer = MOB_LAYER+2 icon = 'Icons.dmi' icon_state = "HP" screen_loc = "5,1:16" meter layer = MOB_LAYER+2 icon = 'Meter.dmi' screen_loc = "7,1" New(client/C) ..() //default action spawn()MeterRefresh(C.mob) //start the refreshing loop proc/MeterRefresh(mob/M) //this is used to refresh the meter var/icon_state_num = round(M.HP/M.HPMax*12) if(M.HP < M.HPMax/12&&M.HP != 0)icon_state_num = 1 icon_state = num2text(icon_state_num) //set the icon state accordingly spawn(2)MeterRefresh(M) //refresh every 2/10 of a second number layer = MOB_LAYER+2 icon = 'Numbers.dmi' screen_loc = "5,1" //the colon specifies pixel offsets pixel_y = 16 //put this at the top of the HUD display var/position = 0 //this will be used in refreshing the numbers New(client/C,num_position) ..() position = num_position screen_loc = "5:[(position-1)*8],1" //set X pixel offsets Please find whats wrong! Ryuo |
In response to Ryuo
|
|
oops.. on the top code, i forgot
mob Login() |
In response to Ryuo
|
|
Nothing wrong in that section. It works fine.
You may try changing the obj/Meter into atom/movable/Meter to see if that helps with the obj problem. |