I have been trying to get this to work for a couple days now. After reading and reading, I have tried various formats.
All I want to do is have the player click on a tile...if the tile is empty, it should display the tile name...if there is an object in the tile, it should display Move [object] and then will go into more code.
The following code is the best I've come up with so far (at least I don't get errors on compile) but now I get runtime errors as follows
runtime error: Cannot read null.contents
proc name: Click (/client/Click)
usr: AdminBiff (/mob)
src: AdminBiff (/client)
call stack:
AdminBiff (/client): Click(the grass (10,28,1) (/turf/floor), the grass (10,28,1) (/turf/floor))
Here is the code;
var/turf/T = locate(x,y,z)
client/Click(O)
if (locate(/obj) in T.contents)
usr << "Move [O]."
else
usr << "[O]."
// ..()
PLEASE, someone help...I am pulling out what little hair I have left. :)
Mark
Copyright © 2025 BYOND Software.
All rights reserved.
You can't expect locate() to work right at all outside of a proc; the var/turf/T line should be inside Click(), not outside. But then, that line won't be much good to you unless you change the x,y,z.
Lummox JR