this is part of my code that is the problem
var/obj/Items/Food/F = input(typesof(/obj/Items/Food/)) in usr
if(F == "Cancel")
return
usr << "[F]"
if(F.name == "Fish")
(This is where It does stuff btw)
Problem description:
it won't do anything...
ID:143358
Sep 30 2007, 12:55 am
|
|
Code:
this is part of my code that is the problem var/obj/Items/Food/F = input(typesof(/obj/Items/Food/)) in usr Problem description: it won't do anything... |
In response to Kakashi24142
|
|
Here is the full code. The thing you said to try just gave a runtime error called Bad Client.
obj/jobs/stove |
In response to Hellonagol
|
|
Look up "input" in the reference, you're using it wrong.
|
var/obj/Items/Food/F = input(usr,"pick a food item!")in typesof(/obj/Items/Food/))
|
In response to Masterdan
|
|
It seems he's trying to search for that object type in contents rather than in general, so I don't think that would achieve it.
|
In response to Keeth
|
|
Okay heres how it should be.
It should take an item from the usrs inventory that is the type obj/Items/Food and put it in a list. Then you choose from that list and if the name of the item = Fish. It will show an option of what to cook. A little help please. obj/jobs/stove |
Hellonagol wrote:
Code: > var/obj/Items/Food/F = input(typesof(/obj/Items/Food/)) in usr Well, there are more than a few problems there. The big one is that you're using input() completely wrong. If you look in the reference you'll see that's not how it's done. var/obj/Items/Food/F = input("Choose some food", "Choose food") as null|anything in usr But that won't restrict your list to just food, so you need to make a list just for this purpose: var/obj/Items/Food/F Then you need to change your cancel code, so instead of looking for F=="Cancel" it looks for null: if(!F) return // played canceled Lummox JR |
The "input(typesof(/obj/Items/Food/)) in usr" wont work because the input proc takes the source as the first argument, and then text strings and such. It should be like this: