ID:145159
 
Code:
var/obj/I = locate(/obj/Items/I) in usr.contents//searchs for the rod in your inventory
if(I.Poor_Fishing_Rod)//if you have a rod
///you can catch bad joo joo
if(I.Good_Fishing_Rod)//if you have a better rod
///you can catch good joo joo


Problem description:
Can someone tell me the prob of whats wrong here. I want to be able to locate an object in a user's inventory that provide different things that happen for whatever obj they have. This is sorta like what I mean.

Like this..
var/obj/thing = locate(/obj/Thing) in usr.contents
if(thing)
//stuff here
Drakiel wrote:
Code:
var/obj/I = locate(/obj/Items/I) in usr.contents//searchs for the rod in your inventory
> if(I.Poor_Fishing_Rod)//if you have a rod
> ///you can catch bad joo joo
> if(I.Good_Fishing_Rod)//if you have a better rod
> ///you can catch good joo joo
>

Problem description:
Can someone tell me the prob of whats wrong here. I want to be able to locate an object in a user's inventory that provide different things that happen for whatever obj they have. This is sorta like what I mean.


Are Poor_Fishing_Rod and Good_Fishing_Rod variables? Wouldn't it be easier to have them as objects?