turf/fire
verb
cook(obj/fish/fishie )
set src in view(1)
set category = "obj Commands"
for(var/obj/fish in usr)
if(what goes here to see if THE OBJ that was picked was only a fish!)
if(fishie.cooked == 0)
usr <<"You cook the fish.."
fishie.cooked = 1
fishie.name = "Cooked fish"
else
usr <<"Its cooked already!"
else
usr <<"You can't cook that!"
ID:178113
Jun 19 2002, 3:48 am
|
|
In response to Lummox JR
|
|
turf/fire
verb cook(obj/fish/fishie) set src in view(1) set category = "obj Commands" for(var/obj/fish/fishie=locate(/obj/fish) in usr) if(!fishie) usr <<"You can't cook that!" return else if(fishie.cooked == 0) usr <<"You cook the fish.." fishie.cooked = 1 fishie.name = "Cooked fish" else usr <<"Its cooked already!" errors: loading Life.dme turfs.dm:26:error:fishie :duplicate definition turfs.dm:23:error:fishie :previous definition Life.dmb - 2 errors, 0 warnings (double-click on an error to jump to it) |
In response to ShadowSiientx
|
|
cook() not cook(obj/fish/fishie) ... you're defining fishie twice.
|
In response to Garthor
|
|
turf/fire
verb cook() set src in view(1) set category = "Fire" for(var/obj/fish/fishie=locate(/obj/fish) in usr) if(!fishie) usr <<"You can't cook that!" return else if(fishie.cooked == 0) usr <<"You cook the fish.." fishie.cooked = 1 fishie.name = "Cooked fish" else usr <<"Its cooked already!" --------------------- loading Life.dme turfs.dm:27:error:fishie:undefined var turfs.dm:31:error:fishie.cooked:undefined var turfs.dm:33:error:fishie.cooked:undefined var turfs.dm:34:error:fishie.name:undefined var turfs.dm:26:fishie :warning: variable defined but not used Life.dmb - 4 errors, 1 warning (double-click on an error to jump to it) |
In response to ShadowSiientx
|
|
Gads, SS, if you're not going to pay attention to my post, don't bother complaining that your code still doesn't work.
I said you should take out obj/fish/fishie out of the arguments to the verb, which you didn't do; Garthor pointed that out. I also said the for() wasn't correct and you should replace it with a locate()--you're not supposed to just put the locate() line inside the for(). Lummox JR |
Your verb is screwed up on several counts here, and needs a rethink in how you're going to do it. You've got an argument to the verb that supplies the fish, but you're also looping through contents to look for a fish; it should do one or the other.
The verb takes a fish as an argument, for example; there's really no way to limit that to an /obj/fish, so you should probably ditch that argument.
In your for() loop, you've made two mistakes: The first is that everything under it is indented to the same level as the for(), so basically you have an empty for() loop. The second is that because you put var/obj/fish, not var/obj/fish/fishie, DM thinks you're looping through all objs in usr.contents, and each obj will go into a var called fish.
What you basically need here is a locate() call:
Lummox JR