ID:169219
 
Player picks up a block of wood, which has the verb "craft_lumber". This creates a board and some wood scraps in player's inventory, then destroys the block of wood.

Player then decides to use the wood scraps to make some paper. Wood scraps have the verb "craft_paper", which is supposed to:
See if the player has bleach
If he has bleach
Create a sheet of paper in his inventory
Destroy the wood scraps
Destroy the bleach
If he does not have bleach
Tell him to go to Wal Mart

Not going to waste time pasting my malfunctioning code in here (considering I still suck at writing it with out good examples I dont have to track down), so I hope that the duty diagram above will help someone lay it out for me so I can understand.

And before Crashed yells at me, I have downloaded many well comment demos and have found nothing that covers my specific issues that will work. As I search through the code with all its surrounding functionalities and technical tidbits, my eyes water and the screen goes wavy. 8P
obj
wood
verb
Craft_Board()
set src in oview(1)
if(!(src in usr.contents)) return
usr << "You craft a board!"
new/obj/board(usr)
new/obj/Wood_Scraps(usr)
del(src)
board
Wood_Scraps
verb
Craft_Paper()
set src in oview(1)
if(!(src in usr.contents)) return
if(/obj/bleach in usr.contents)
usr << "You craft Paper!"
new/obj/paper(usr)
del(/obj/bleach) in usr.contents
del(src)
else usr << "Go to Wal-Mart!"
bleach
paper

Should work, but is not tested


--Vito
In response to Vito Stolidus
There are no object types in the contents list. What you want to do is
var/obj/bleach/O = locate()in contents
if(!O)return
In response to Loduwijk
Thanks for your invaluable assistance. With your examples and my limited knowledge of coding (I cannot find my copy of the Blue Book), I managed to rearrange the code to fit with the way I need it to work. Thank you again Stolidus and Loduwijk!!

*******************SOLUTION********************

obj
blockofwood
name = "block of wood"
icon = 'block of wood.dmi'
verb
craft_board()
set src in usr
if(!(src in usr.contents)) return
usr << "You cut the block of wood."
usr << "You have made a board!"
new/obj/board(usr)
new/obj/woodscraps(usr)
del src
woodscraps
name = "wood scraps"
icon = 'wood scraps.dmi'
verb
craft_paper()
set src in usr
var/obj/bleach/O = locate()in usr.contents
if(O in usr.contents)
usr << "You craft paper!"
new/obj/paper(usr)
del(O)
del(src)
if(!O) usr << "You need bleach."; return