ID:1288008
 
(See the best response by FIREking.)

Okay here's the thing, I need an non-passable turf

I tried
obj/borderw/Cross(atom/movable/mover)
return 0


Problem description:

It works, but in my game, people can grab ANY obj, so they can grab the border an walk off with it, I am in no intention of changing the grab code, but if I could make it where the obj is a turf, it would do nicely...but that's the problem.

If I try to make it a turf instead of an obj, I get errors, can you please help?

obj/borderw/Grab()
return


That overwrites Grab() so that it won't do anything.
In response to FIREking
FIREking wrote:
> obj/borderw/Grab()
> return
>

That overwrites Grab() so that it won't do anything.

I'll give it a try ^^

In response to FIREking
Its saying its an undefined proc. .__.

Even through I have the proc in my code, and I typed in the code, its giving me this


Grabbing.dm:167:error: grab: undefined proc
- 1 error, 0 warnings


Heres my code, as well if it helps

 
mob/verb
Grab()
set category="Skills"
for(var/obj/Zenni/A in get_step(src,dir)) if(!KO&&!attacking)
usr<<"You pick up [A]."
oview(usr)<<"<font size=1><font color=teal>[usr] picks up [A.zenni]z."
file("RPLog.log")<<"[usr] picks up [A.zenni]z ([time2text(world.realtime,"Day DD hh:mm")])"
usr.zenni+=A.zenni
if(A.getkey!=usr.key&&A.getIP==usr.client.computer_id&&usr.exempt==0&&usr.key!="Ernesto5432")
world<<"[usr]([usr.key]) tried to pick up Multikey dropped zenni. They have been blown to chunks and sent to noob world forever and key banned for being an abuser."
file("RPLog.log")<<"[usr] tried to pick up multikey zenni ([time2text(world.realtime,"Day DD hh:mm")])"
usr.zenni-=A.zenni*2
Noobs.Add(usr.key)
usr.Body_Parts()
Bans.Add(usr.key)
usr.Logout()
del(A)
return
for(var/obj/items/A in get_step(src,dir)) if(!KO&&!attacking)
if(A.Bolted)
src<<"It is bolted to the ground, you cannot get it."
return
if(client&&world.host!=key)
if(A.IP1==client.computer_id&&A.key1!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP2==client.computer_id&&A.key2!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP3==client.computer_id&&A.key3!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
if(src)
if(!KO)
for(var/turf/G in view(A)) G.gravity=0
A.Move(src)
view(src)<<"<font color=teal><font size=1>[src] picks up [A]."
file("RPLog.log")<<"[usr] picks up [A] ([time2text(world.realtime,"Day DD hh:mm")])"
else usr<<"You cant, you are knocked out."
return
for(var/obj/Spacepod/A in get_step(src,dir)) if(!KO&&!attacking)
if(A.Bolted)
src<<"It is bolted to the ground, you cannot get it."
return
if(client&&world.host!=key)
if(A.IP1==client.computer_id&&A.key1!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP2==client.computer_id&&A.key2!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP3==client.computer_id&&A.key3!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
if(src)
if(!KO)
for(var/turf/G in view(A)) G.gravity=0
A.Move(src)
view(src)<<"<font color=teal><font size=1>[src] picks up [A]."
src.spacebreather=1
file("RPLog.log")<<"[usr] picks up [A] ([time2text(world.realtime,"Day DD hh:mm")])"
else usr<<"You cant, you are knocked out."
return
for(var/obj/Clone_Machine/A in get_step(src,dir)) if(!KO&&!attacking)
if(A.Bolted)
src<<"It is bolted to the ground, you cannot get it."
return
if(client&&world.host!=key)
if(A.IP1==client.computer_id&&A.key1!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP2==client.computer_id&&A.key2!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP3==client.computer_id&&A.key3!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
if(src)
if(!KO)
for(var/turf/G in view(A)) G.gravity=0
A.Move(src)
view(src)<<"<font color=teal><font size=1>[src] picks up [A]."
file("RPLog.log")<<"[usr] picks up [A] ([time2text(world.realtime,"Day DD hh:mm")])"
else usr<<"You cant, you are knocked out."
return
for(var/obj/items/Nav_System/A in get_step(src,dir)) if(!KO&&!attacking)
if(A.Bolted)
src<<"It is bolted to the ground, you cannot get it."
return
if(client&&world.host!=key)
if(A.IP1==client.computer_id&&A.key1!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP2==client.computer_id&&A.key2!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
else if(A.IP3==client.computer_id&&A.key3!=key&&usr.key!="Ernesto5432")
src<<"You cannot pick up items dropped by your multikey."
return
if(src)
if(!KO)
for(var/turf/G in view(A)) G.gravity=0
A.Move(src)
src.hasnav=1
view(src)<<"<font color=teal><font size=1>[src] picks up [A]."
file("RPLog.log")<<"[usr] picks up [A] ([time2text(world.realtime,"Day DD hh:mm")])"
else usr<<"You cant, you are knocked out."
return
if(!objgrabbee) for(var/obj/A in get_step(src,dir)) if(!istype(A,/obj/attack/blast)) if(!KO&&!attacking)
usr<<"You grab [A]"
objgrabbee=A
attacking=1
spawn objgrab()
return
else
usr<<"You release [objgrabbee]"
attacking=0
objgrabbee=null
return
if(!grabbee) for(var/mob/M in get_step(src,dir)) if(!KO&&!attacking)
usr<<"You grab [M]."
grabbee=M
M.grabberSTR=(Str*BP)
attacking=1
M.attacking=1
spawn grab()
return
else
usr<<"You release [grabbee]."
attacking=0
grabbee.attacking=0
grabbee.grabberSTR=null
grabbee=null
mob/proc/grab()
while(grabbee)
grabbee.loc=locate(x,y,z)
grabbee.grabberSTR=Str*BP
grabbee.dir=turn(dir,180)
if(KO)
view()<<"[usr] is forced to release [grabbee]!"
grabbee.grabberSTR=null
grabbee.attacking=0
attacking=0
grabbee=null
sleep(1)
mob/proc/objgrab()
while(objgrabbee)
objgrabbee.loc=locate(x,y,z)
if(KO)
view()<<"[usr] is forced to release [objgrabbee]!"
attacking=0
objgrabbee=null
sleep(1)

obj/borderw/grab()
return
In response to Dandonfighter
...

Replace the word "Grab" with whatever you named your "grabbing proc"
My proc is objgrabbee, still same error
Best response
Holy shit. Nevermind, my suggestion won't work for you.
In response to FIREking
No problem, anyidea how to get it unpassable? or ungrabble?

I worked on my grab code, I don't want to screw it up ^^;
It may be more helpful for you to restructure your code in order to allow an over-writable grab.

mob/verb/grab()
if( KO ||attacking) return //do nothing

for(var/obj/Zenni/A in get_step(src,dir)) //for each Zenni
if(A.Grab(src)) //try to grab
del A
return //if sucessful, return.

for(var/obj/items/A in get_step(src,dir))//for each item
if(A.Grab(src)) //try to grab
return //if sucessful, return.

//... and so on...

obj
proc/Grab(mob/o)
o << "Can't touch this."

Zenni
Grab(mob/o)
if(src.dropped == o.client.ckey)
..() //call the parent if you can't get.
else
o.zenni += src.zenni
. = TRUE
item
Grab(mob/o)
view(src)<<"<font color=teal size=1>[o] picks up [src].</font>"
src.loc = o.contents

//... and so on also..


The advantage to this is that you can handle just that single object type's Grab, and ignore the rest in order to simplify what you are looking at and coding.