ID:146230
 
I have this problem with my hud system and i heres my hud coding

client/New()//When a client connects to a mob
..()
new/obj/hud/menus/move(src)//Creates a new move menu in the client which also calls the object's New() proc
new/obj/hud/menus/main(src)
new/obj/PL(src)
new/obj/auraoffhud(src)
new/obj/auraonhud(src)
new/obj/combathud(src)
new/obj/bukujitsuhud(src)
new/obj/poweruphud(src)
new/obj/trainhud(src)
new/obj/dualhud(src)
new/obj/resthud(src)
new/obj/noticehud(src)
new/obj/savehud(src)
new/obj/followhud(src)
new/obj/enragehud(src)
obj
black
layer = 21
name = "Dragon Ball Z: Majins and Mystics"
icon = 'turfs.dmi'
icon_state = "hudthing"
New()
src.screen_loc = "1,1 to 13,1"
usr.client.screen+=src
black2
layer = 21
name = "Dragon Ball Z: Majins and Mystics"
icon = 'turfs.dmi'
icon_state = "hudthing2"
New()
src.screen_loc = "1,2 to 13,2"
usr.client.screen+=src
PL
layer = 22
icon = 'hud2.dmi'
icon_state = "pl"
New()
src.screen_loc = "1,2"
usr.client.screen+=src
// Gold
// layer = 22
// icon = 'hud2.dmi'
// icon_state = "gold"
// New()
// src.screen_loc = "7,2"
// usr.client.screen+=src
Logo
layer = 22
icon = 'MMlogo.dmi'
New()
src.screen_loc = "1,1"
usr.client.screen+=src



obj/auraoffhud
icon='HUD.dmi'
name = "Aura Off"
icon_state = "auraoff"
layer=22
New()
src.screen_loc="2,1"
usr.client.screen+=src
Click()
usr.auraoffproc()


obj/auraonhud
icon='HUD.dmi'
name = "Aura On"
icon_state = "auraon"
layer=22
New()
src.screen_loc="3,1"
usr.client.screen+=src
Click()
usr.auraonproc()

obj/combathud
icon='HUD.dmi'
name = "Attack"
icon_state = "fight"
layer=22
New()
src.screen_loc="4,1"
usr.client.screen+=src
Click()
for(var/mob/M in oview(1))
if(usr.stopper == 1)
usr << "You stop attacking [M.name]"
usr.stopper = 0
usr.stopper = 0
else
if(usr.incombat == 1)
usr.incombat = 0
M.incombat = 0
usr.incombat = 0
M.incombat = 0
usr.incombat = 0
// usr.stopper = 1
// usr.stopper = 1
// usr.stopper = 1
M.incombat = 0
usr.move = 1
M.move = 1
usr.incombat = 0
usr.incombat = 0

if(usr.incombat == 0||usr.incombat == null)
if(usr.fuseturd == 1)
usr << "<b><font color=red>You try to attack, but you are not in control!</font></b>"
else
if(usr.race == "Bidi")
usr << "<b><font color=red>You are too feeble to attack!</font></b>"
else

if(usr.majinmaster == "[M]")
M << "<b>You try to attack [usr], but he has control of your body!!."
else
if(usr.maxpowerlevel <= 1500)
usr << "<b>You are a newbie, don't screw with people until you have a powerlevel of at least 1500! Jeez!."
else
if(usr.alignment == "Good")
if(M.alignment == "Good")
usr << "<b>You cannot attack a fellow good-hearted person."
else
if(M.npc == 1)
usr << "They are an NPC"
if(M.npc == 0||M.npc == null)
if(usr.npp == 1)
usr << "Not while being an NPC."
if(usr.npp == 0)
if(M.npp == 1)
usr << "They are an NPC."
if(M.npp == 0)
if(M.ko == 1)
usr << "<b>You need to finish him for that."
if(M.ko == 0)
if(usr.ko == 1)
usr << "<b>Not while you are knocked out."
if(usr.ko == 0)
if(usr.safe == 1)
usr << "<b>Not while in a safe area."
if(usr.safe == 0)
if(M.safe == 1)
usr << "<b>They are in a safe area."
if(M.safe == 0)
usr.incombat = 1
usr.stopper = 1





else
if(usr.alignment == "Evil")
if(M.npc == 1)
usr << "They are an NPC"
if(M.npc == 0||M.npc == null)
if(usr.npp == 1)
usr << "Not while being an NPC."
if(usr.npp == 0)
if(M.npp == 1)
usr << "They are an NPC."
if(M.npp == 0)
if(M.ko == 1)
usr << "<b>You need to finish him for that."
if(M.ko == 0)
if(usr.ko == 1)
usr << "<b>Not while you are knocked out."
if(usr.ko == 0)
if(usr.safe == 1)
usr << "<b>Not while in a safe area."
if(usr.safe == 0)
if(M.safe == 1)
usr << "<b>They are in a safe area."





obj/bukujitsuhud
icon='HUD.dmi'
name = "Bukujitsu"
icon_state = "buku"
layer=22
New()
src.screen_loc="5,1"
usr.client.screen+=src
Click()
usr.flight()

obj/poweruphud
icon='HUD.dmi'
name = "Powerup"
icon_state = "powerup"
layer=22
New()
src.screen_loc="6,1"
usr.client.screen+=src
Click()
usr.pwr()

obj/trainhud
icon='HUD.dmi'
name = "Train"
icon_state = "train"
layer=22
New()
src.screen_loc="7,1"
usr.client.screen+=src
Click()
if(usr.flight == 1)
usr << "Not while flying."
if(usr.rest == 1)
usr << "Not while resting."
if(usr.flight == 0)
if(usr.rest == 0||usr.rest == null)
if(usr.fused == 0||usr.fused == null)
if(usr.meditate == 1)
if(usr.medtime == 1)
usr << "You need to wait 10 seconds before continuing training."
if(usr.medtime == 0||usr.medtime == null)
usr << "<b>You stop training..."
usr.meditate = 0
src.meditate = 0
usr.medtime = 1
usr.rest = 0
usr.move = 1
usr.icon_state = ""
sleep(100)
usr.meditate = 0
usr.medtime = 0
else
usr << "<b>You begin training..."
usr.icon_state = "train"
usr.move = 0
usr.meditate = 1
usr.meditate()
else
usr << "Fused characters and character that have been majined cannot train!"
obj/dualhud
icon='HUD.dmi'
name = "Dual-Train"
icon_state = "dualtrain"
layer=22
New()
src.screen_loc="8,1"
usr.client.screen+=src
Click()
for(var/mob/characters/M in oview(1))
if(usr.flight == 1)
usr << "Not while flying."
if(M.flight == 1)
usr << "[M] is flying; not while flying!"
if(usr.rest == 1)
usr << "Not while resting."
if(M.meditate == 1)
usr << "[M] is already training!"
if(M.rest == 1)
usr << "[M.name]'s character is resting; wait 'till he is done!"
if(M.race == "Bidi"||M.race == "Shin")
usr << "[M.name]'s race doesn't know how to train this way!"
if(usr.race == "Bidi"||usr.race == "Shin")
usr << "Your race doesn't know how to train this way!"
if(usr.flight == 0)
if(M.flight == 0)
if(usr.fused == null||usr.fused == 0)
if(usr.race != "Shin"||usr.race != "Bidi")
if(M.race != "Shin"||M.race != "Bidi")
if(usr.rest == 0||usr.rest == null)
if(M.rest == 0||M.rest == null)
if(M.meditate == 0)
if(usr.dualmeditate == 1||M.dualmeditate == 1)
usr << "<b>You or [M] stopped the training..."
M << "<b>You or [usr] stopped the training..."
usr.meditate = 0
src.meditate = 0
M.meditate = 0
usr.medtime = 1
M.dualmeditate = 0
usr.dualmeditate = 0
usr.move = 1
M.move = 1
usr.icon_state = ""
M.icon_state = ""
sleep(100)
usr.dualmeditate = 0
usr.medtime = 0
M.medtime = 0
M.dualmeditate = 0
else
usr << "<b>Asking [M] if he wants to train with you..."
switch(alert(M,"[usr] wants to Dual-Train with you! You want to train with him?","Dual-Train","Yes","No"))
if("Yes")
usr << "<b>Click Dual-Train again to stop training with [M]"
M << "<b>Click Dual-Train to stop training with [usr]"
usr.move = 0
M.move = 0
M:loc = usr.loc
M:x -= 1
M.dir = EAST
usr.dir = WEST
usr.icon_state = "sparfury"
M.icon_state = "sparfury"
usr.meditate = 1
M.meditate = 1
M.dualmeditate = 1
usr.dualmeditate = 1
call(/mob/proc/dualmeditate)(M,usr)
if("No")
usr.move = 1
M.move = 1
usr << "<b>[M.name] doesn't want to train with you right now."

else
usr << "Fused characters and character that have been majined cannot train!"

obj/resthud
icon='HUD.dmi'
name = "Rest"
icon_state = "rest"
layer=22
New()
src.screen_loc="9,1"
usr.client.screen+=src
Click()
usr.restproc()
obj/noticehud
icon='HUD.dmi'
icon_state = "save"
name = "Town Notice"
layer=22
New()
src.screen_loc="10,1"
usr.client.screen+=src
Click()
usr.townnotice()

obj/savehud
icon='HUD.dmi'
icon_state = "save2"
name = "Save Character"
layer=22
New()
src.screen_loc="11,1"
usr.client.screen+=src
Click()
if(usr.fused == 0||usr.fused == null)
usr.client.Save()
else
usr << "Cannot save a fused or majined character!"

obj/followhud
icon='HUD.dmi'
icon_state = "follow"
name = "Follow"
layer=22
New()
src.screen_loc="12,1"
usr.client.screen+=src
Click()
for(var/mob/characters/M in oview(1))
switch(alert(usr,"I want to....","Follow [usr]","Follow him","Stop Following him", "Nevermind!"))
if("Follow him")
usr.followmob = 1
usr << "You follow [M.name]!"
M << "[usr.name] started following you!"
M.follow()
if("Stop Following him")
usr.followmob = 0
usr.move = 1
M << "[usr.name] quit following you!"
usr << "You quit following [M.name]!"
if("Nevermind!")
usr << "Ok!"

obj/enragehud
icon='HUD.dmi'
icon_state = "enrage"
name = "Enrage"
layer=22
New()
src.screen_loc="13,1"
usr.client.screen+=src
Click()
usr.enrageproc()

mob/proc/auraoffproc()
mob/proc/auraonproc()
mob/proc/flight()
mob/proc/pwr()
mob/proc/restproc()
mob/proc/townnotice()
mob/proc/follow()
mob/proc/enrageproc()

mob/var
stopper
mob/var
incombat
mob/var
fuseturd
mob/var
followmob


Here is my error

PL (/obj/PL): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/auraoffhud/New)
source file: hud2.dm,65
usr: null
src: Aura Off (/obj/auraoffhud)
call stack:
Aura Off (/obj/auraoffhud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/auraonhud/New)
source file: hud2.dm,77
usr: null
src: Aura On (/obj/auraonhud)
call stack:
Aura On (/obj/auraonhud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/combathud/New)
source file: hud2.dm,88
usr: null
src: Attack (/obj/combathud)
call stack:
Attack (/obj/combathud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/bukujitsuhud/New)
source file: hud2.dm,191
usr: null
src: Bukujitsu (/obj/bukujitsuhud)
call stack:
Bukujitsu (/obj/bukujitsuhud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/poweruphud/New)
source file: hud2.dm,202
usr: null
src: Powerup (/obj/poweruphud)
call stack:
Powerup (/obj/poweruphud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/trainhud/New)
source file: hud2.dm,213
usr: null
src: Train (/obj/trainhud)
call stack:
Train (/obj/trainhud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/dualhud/New)
source file: hud2.dm,251
usr: null
src: Dual-Train (/obj/dualhud)
call stack:
Dual-Train (/obj/dualhud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/resthud/New)
source file: hud2.dm,328
usr: null
src: Rest (/obj/resthud)
call stack:
Rest (/obj/resthud): New(Govegtos (/client))
Govegtos (/client): New()
Govegtos (/client): New()
Govegtos (/client): New()
runtime error: Cannot read null.client
proc name: New (/obj/noticehud/New)
source file: hud2.dm,338
runtime error: Cannot read null.client
proc name: New (/obj/savehud/New)
source file: hud2.dm,349
runtime error: Cannot read null.client
proc name: New (/obj/followhud/New)
source file: hud2.dm,363
runtime error: Cannot read null.client
proc name: New (/obj/enragehud/New)
source file: hud2.dm,387

How do i fix this?
You're using usr in lots of procs. That's bad. Find some way to use something other than usr.
In response to Jon88
if you didnt know, under client/ , if you want something to be referred to the character (usually which is a mob), use mob. not usr. or src. (mob. will refer to the client's mob character)...
In response to GhostAnime
Why are we ripping DBZ: Majin and Mystics? Check some HUD Demos..There are way better ways to go about programming a HUD.
In response to Jon88
In the words of Xooxer!!!

In response to Cheetoz
So you mean

client/New()//When a client connects to a mob
mob


is that what you meant?
In response to Govegtos
You sir phail at liphe. Go read the DM guide or some tutorials and come back when you actually know what indentations do, I'm getting sick of you not learning. =/
Govegtos wrote:
I have this problem with my hud system and i heres my hud coding

>   black
> layer = 21
> name = "Dragon Ball Z: Majins and Mystics"
> icon = 'turfs.dmi'
> icon_state = "hudthing"
> New()
> src.screen_loc = "1,1 to 13,1"
> usr.client.screen+=src

Isn't there a dbz game that already has that name?
In response to Xeal
it was but not currently
In response to Sharpner
hi old dbz majins and mjystics dev hear hes not ripping we relesed mm source for anyone to use. but there right mm is pretty outdated most demos have more power then mm does these days.
In response to Sharpner
Ohhhh yes indeedy.

I modified Zeta into DBZ:MM about as efficiently as a turd on wheels.

I had no idea what I was doing and the entire game was a bumbling piece of poo waiting to collapse.

From my website regarding MM:

<code> Please note that I had no idea what I was doing when creating/modifying these DM programs, and I was young and inexperienced in programmer etiquette. These are poorly documented and poorly programmed heaps of scrap. Do what you will with them.</code>

~Kujila
In response to Cheetoz
You mean Lummox JR, not Xooxer.
Ahhh..So much code..