ID:146366
 
Code:
client/New()//When a client connects to a mob
..()
new/obj/empty1(src)
new/obj/empty2(src)
new/obj/empty3(src)


    empty1
name = "pocket"
icon = 'Inventory.dmi'
icon_state = "empty"
New(client/C)//When created
src.screen_loc = "1,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
empty2
name = "pocket"
icon = 'Inventory.dmi'
icon_state = "empty"
New(client/C)//When created
src.screen_loc = "2,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
empty3
name = "pocket"
icon = 'Inventory.dmi'
icon_state = "empty"
New(client/C)//When created
src.screen_loc = "3,19"//Locates it on the screen
C.screen += src//Adds it to client's screen
layer = MOB_LAYER + 1

i also have items that go in the emptys
    boatinv
name = "boat"
icon = 'Inventory.dmi'
icon_state = "boat"
New(client/C)//When created
src.screen_loc = "1,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
flyinv
name = "fly"
icon = 'Inventory.dmi'
icon_state = "ufo"
New(client/C)//When created
src.screen_loc = "2,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
spaceinv
name = "UFO"
icon = 'Inventory.dmi'
icon_state = "fly"
New(client/C)//When created
src.screen_loc = "3,19"//Locates it on the screen
C.screen += src//Adds it to client's screen
layer = MOB_LAYER + 1

Problem description:

When i login i get this runtime:
runtime error: Cannot read null.screen
proc name: New (/obj/empty1/New)
usr: (Owner) Tabu (/mob)
src: the pocket (/obj/empty1)
call stack:
the pocket (/obj/empty1): New(null)
(Owner) Tabu (/mob): Login()
Tabu34 (/client): New()

for all three empty's

also, when i talk to the people, such as the alien, i get a runtime trying to make the items show up in the little squares:

runtime error: undefined variable /mob/var/screen
proc name: New (/obj/spaceinv/New)
usr: (Owner) Tabu (/mob)
src: UFO (/obj/spaceinv)
call stack:
UFO (/obj/spaceinv): New((Owner) Tabu (/mob))
Alien (/mob/alien): Talk()


I cannot understand why this does not work. HELP!

Call new with a /client
In response to Ol' Yeller
Umm could you elaborate please. I do not quite understand how to do what you are suggesting. Could you please post a code snippet or something to demonstrate?
In response to Tabu34
When you're calling the obj's new, you're not putting a client in its args.
In response to Ol' Yeller
I have New(client/C)
isnt that right?
I tried New(/client/C)
but that gave me errors.
In response to Tabu34
Call its new proc with a client in its args. :/
ie:
mob/Login()
..()
new /hud (client)
In response to Ol' Yeller
Thank you. Now i have another problem. When i talk to specific people, i want something else to show up there also. I am using this as the item code:

        boatinv
name = "boat"
icon = 'Inventory.dmi'
icon_state = "boat"
New(client/C)//When created
src.screen_loc = "1,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
flyinv
name = "fly"
icon = 'Inventory.dmi'
icon_state = "ufo"
New(client/C)//When created
src.screen_loc = "2,19"//Locates it on the screen
C.screen+=src//Adds it to client's screen
layer = MOB_LAYER + 1
spaceinv
name = "UFO"
icon = 'Inventory.dmi'
icon_state = "fly"
New(client/C)//When created
src.screen_loc = "3,19"//Locates it on the screen
C.screen += src//Adds it to client's screen
layer = MOB_LAYER + 1


And this as the code for when i talk to the person

        boatguy
name = "Boat Donator"
icon = 'fairyguy.dmi'
icon_state = "no"
density = 1
verb/Talk()
set src in oview(1)
if(usr.boat == 0)
usr << "Here, have a boat."
usr.boat = 1
new/obj/inventory/boatinv(usr)
else
usr << "I gave you a boat already!"
alien
name = "Alien"
icon = 'Alien.dmi'
density = 1
verb/Talk()
set src in oview(1)
if(usr.ufo == 0)
usr << "Greetings earthling. I have decided to live here now. I have no use for my UFO. Here, take it!"
new/obj/inventory/spaceinv(usr)
usr.ufo = 1
else
usr << "Earthling, i gave you the UFO already. Leave me in peace before i leave you in PIECES!!"
goku
name = "Goku"
icon = 'Goku.dmi'
density = 1
verb/Talk()
set src in oview(1)
if(usr.fly == 0)
usr << "Hi [usr]! I'll teach you how to fly!"
usr << "You learned how to fly!"
new/obj/inventory/flyinv(usr)
usr.fly = 1
else
usr << "You know how to fly already!"
yardrat
name = "Elder"
icon = 'fairyguy.dmi'
icon_state = "yardrat guy"
density = 1
verb/Talk()
set src in oview(1)
if(usr.IT == 0)
usr << "Hi [usr]! I'll teach you how to uses Instant Transmission!"
usr << "You learned Instant Transmission!"
usr.IT += 1
else
usr << "You have this skill already!"


When i talk to one of them, i get the skill, but it doesnt show up in the inventory. I just get this runtime:

runtime error: undefined variable /mob/var/screen
proc name: New (/obj/inventory/flyinv/New)
usr: (Owner) Tabu (/mob)
src: the fly (/obj/inventory/flyinv)
call stack:
the fly (/obj/inventory/flyinv): New((Owner) Tabu (/mob))
Goku (/mob/people/goku): Talk()


This happens to all of the poeple that i talk to. I thought that screen was a variable already defined because i use it elseware, but i suppose i am incorrect. Please Help.
In response to Tabu34
new/obj/inventory/boatinv(usr)
Make everything similar to that:
new/obj/inventory/boatinv(usr.client)
In response to Ol' Yeller
Yes! It worked!
Thanks dude, You really helped me out there.