runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 18, 17)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Unit Bay (/obj/Unitbaymake), null, 17, 22)
runtime error: Cannot read null.x
proc name: dd get dist (/proc/dd_get_dist)
usr: Unit (/mob/Unit)
src: null
call stack:
dd get dist(Default (3,7,1) (/turf/Default), null)
/BaseCamp/PathController (/BaseCamp/PathController): Path(10)
/BaseCamp/PathController (/BaseCamp/PathController): Path(10)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base EventCycle(448)
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
runtime error: Cannot read null.x
proc name: search (/BaseCamp/PathController/proc/_search)
usr: Unit (/mob/Unit)
src: /BaseCamp/PathController (/BaseCamp/PathController)
call stack:
/BaseCamp/PathController (/BaseCamp/PathController): search()
/BaseCamp/PathController (/BaseCamp/PathController): search()
/BaseCamp/PathController (/BaseCamp/PathController): Path(10)
/BaseCamp/PathController (/BaseCamp/PathController): Path(10)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base EventCycle(448)
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
runtime error: Cannot read null.x
proc name: dd get dist (/proc/dd_get_dist)
usr: Unit (/mob/Unit)
src: null
call stack:
dd get dist(Unit (/mob/Unit), null)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
/BaseCamp/PathController (/BaseCamp/PathController): StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base StepTowards(Unit Bay (/obj/Unitbaymake), 0, 10)
Unit (/mob/Unit): base EventCycle(448)
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
GameController (/BaseCamp/GameController): EventCycle()
Reconnecting...
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Unit Bay (/obj/Unitbaymake), null, 19, 10)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Unit Bay (/obj/Unitbaymake), null, 10, 10)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Unit Bay (/obj/Unitbaymake), null, 7, 10)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 13, 11)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 13, 11)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 13, 3)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 13, 15)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
Reconnecting...
runtime error: Cannot read null.x
proc name: Draw Grid (/client/proc/Draw_Grid)
source file: RTS.dm,215
usr: Kablez (/mob/You)
src: Kablez (/client)
call stack:
Kablez (/client): Draw Grid(null, null)
Kablez (/client): MouseDown(Net make (/obj/Netmake), null, 21, 4)
Undefined variable /obj/net/var/owner.
proc name: Click (/obj/Netmake/Click)
source file: RTS.dm,308
usr: Kablez (/mob/You)
src: Net make (/obj/Netmake)
call stack:
Net make (/obj/Netmake): Click(null)
Kablez (/client): Click(Net make (/obj/Netmake), null)
everything works fine it just spamms me with this ill show u code next :
/*
This is just an example of how mouse selection can work in BYOND
Feel free to make changes, test it out, or figure out how it works
Run it to test
*/
// Two very usefull libraries made by Deadron are included to help the demo
#include
#include
world
view = 6
turf = /turf/Default
mob = /mob/You
turf
icon='Turf.dmi'
Default
obj
net
icon = 'Turf.dmi'
icon_state="net"
layer = 2354
mob
// The following variables are used in movement of the units
var/tmp
destination // The destination to try to reach
next_walk_time // When is the next time for us to walk?
walking_delay = 5 // How long between movement?
try_distance = 5 // How close will we keep trying for?
trys = 20 // How many times will we try for try_distance?
You // Player's mob
density = 0
Login()
src.loc = locate(12,9,1)
return ..()
Unit // Units players can control
var/owner = ""
icon='Unit.dmi'
// Taken from the pathfinding demo but with a few extras that help with mobs
// blocking paths to a destination.
base_EventCycle()
// This gets called once each tick.
if (next_walk_time <= world.time)
// It's time for us to walk if given an order
if (destination)
var/reached_dest = base_StepTowards(destination)
if (reached_dest)
// We reached the destination or got as close as we could
trys -= 1
// Try to get closer if not within try_distance
if(get_dist(src.loc,destination) < try_distance || !trys)
destination = null
trys = initial(trys)
// Set the next walk time.
next_walk_time = world.time + walking_delay
return
Mech // Units players can control
var/owner = ""
icon='Mech.dmi'
// Taken from the pathfinding demo but with a few extras that help with mobs
// blocking paths to a destination.
base_EventCycle()
// This gets called once each tick.
if (next_walk_time <= world.time)
// It's time for us to walk if given an order
if (destination)
var/reached_dest = base_StepTowards(destination)
if (reached_dest)
// We reached the destination or got as close as we could
trys -= 1
// Try to get closer if not within try_distance
if(get_dist(src.loc,destination) < try_distance || !trys)
destination = null
trys = initial(trys)
// Set the next walk time.
next_walk_time = world.time + walking_delay
return
client
var/tmp
Select[]=list() // list of selected units
imageslist[]=list() // list of selection images
turf/start // grid start
turf/end //grid end
verb/Deselect()
// if something is selected
if(Select.len)
// deselect it/them
for(var/mob/Unit/U in Select)
Select -= U
for(var/mob/Mech/M in Select)
Select -= M
for(var/i in src.imageslist)
del(i)
Click(atom/movable/object, location)
// if something is selected
if(Select.len)
// give it/them a destination
for(var/mob/Unit/U in Select)
U.destination = object
for(var/mob/Mech/M in Select)
M.destination = object
return ..()
DblClick(atom/movable/object, location)
// an order is given on the first click
src.Deselect() // now deselect units
MouseDown(object,location)
// if nothing is selected, draw the grid
if(!length(Select))
src.Draw_Grid(location,location)
..()
MouseUp(object,location)
// if there is a selection box, select!
if(start)
End_Grid()
..()
MouseDrag(src_object,over_object,src_location,over_location)
// if there is a grid started, expand it
if(start)
Draw_Grid(start,over_location)
..()
proc/Draw_Grid(S,E)
// if there is no start location, set it
if(!start)
start = S
end = E // current mouse location
// delete old grid
for(var/image/I in src.imageslist)
del(I)
// vars set to the difference between 2 corners of box
var/xd = end.x-start.x
var/yd = end.y-start.y
// 4 corners of grid are given are displayed to the user
src.imageslist += new/image ('Selecting.dmi',locate(start.x,start.y,start.z),"2")
src.imageslist += new/image ('Selecting.dmi',end,"2")
src.imageslist += new/image ('Selecting.dmi',locate(start.x,start.y+yd,start.z),"2")
src.imageslist += new/image ('Selecting.dmi',locate(start.x+xd,start.y,start.z),"2")
for(var/image/I in src.imageslist)
src << I
proc/End_Grid()
var
// variables used to determine selection area
max_X=max(start.x,end.x)
min_X=min(start.x,end.x)
max_Y=max(start.y,end.y)
min_Y=min(start.y,end.y)
// selection box is deleted
for(var/image/I in src.imageslist)
del(I)
// turfs in box are checked for units
for(var/turf/T in block(locate(min_X,min_Y,1),locate(max_X,max_Y,1)))
// if you want to enable selecting more then one unit per turf, use a for() loop
var/mob/Unit/M = locate() in T
if(M)
if(M.owner == usr.key)
// a unit was found at this location, select it
var/image/I = new('Selecting.dmi',M,"1")
Select+=M
src.imageslist+=I
src << I
var/mob/Mech/U = locate() in T
if(U)
if(U.owner == usr.key)
// a unit was found at this location, select it
var/image/I = new('Selecting.dmi',U,"1")
Select+=U
src.imageslist+=I
src << I
start = null
end = null
obj
Unitbay
var/owner = ""
var/mob/Unit/S
name = "Unit Bay"
icon = 'Bays.dmi'
icon_state="Unit"
Click()
switch(input("What do you want to train?") in list("Man","Mech"))
if("Man")
sleep(45)
S = new/mob/Unit(src.loc)
S.owner = usr.key
if("Mech")
sleep(45)
S = new/mob/Mech(src.loc)
S.owner = usr.key
Unitbaymake
var/obj/Unitbay/R
name = "Unit Bay"
icon = 'Bays.dmi'
icon_state="Unit"
layer = 233
Click()
R = new/obj/Unitbay(usr.loc)
R.owner = usr.key
New(client/C)
screen_loc = "1,1"
C.screen+=src
Netmake
var/obj/Unitbay/R
name = "Net make"
icon = 'hud.dmi'
icon_state="net"
layer = 233
Click()
R = new/obj/net(usr.loc)
R.owner = usr.key
New(client/C)
screen_loc = "1,2"
C.screen+=src
client/New()//When a client connects to a mob
..()
new/obj/Unitbaymake(src)
new/obj/Netmake(src)
#define DEBUG
(using wall04's RTS selection demo
ID:147934
Sep 19 2003, 12:13 pm
|
|
Sep 19 2003, 4:41 pm
|
|
All of those errors are null.something errors, which are extremely easy to fix compared to most runtime errors. I suggest you check out this article, especially the last two sections.
|