fixed by changing paths to obj/Wooden/items and etc. Man.. Im having alot of slow moments. (im coding on my tablet atm. grammar=bad and response ti me will be slow. im testing the code thru teamviewer now.)
Okay. in the code I put a debugging line. It successfully outputs usr << "k" but doesn't do a thing for anything after it... God I wish I had continuously coded since 2007.. Why is this so bothersome?
As you have the variables value and equipped under obj/Wooden instead of just obj, you will need to ammend your for loop accordingly.
for(var/obj/Wooden/items in itemlist)


However, I reccomend something more along the lines of:
obj/Item    //Create the Item object
var //And give all Item objects these two variables
value
equipped
Wooden
Sword

Stone //This will prevent errors when you add things like
Axe //Stone, Steel versions of items.

//Then ammend your for loops appropriately
for(var/obj/Item/I in whatever_list)
I just recently changed it to that. Still not working. Errors are gone though.
Don't worry about it. I'll wake up rested tomorrow and look at it and have an easy fix and I'll post it for people who pass by this post. Thanks for your help.
Here's the solution:

                    if("Sell")
sell
var/tmp/itemlist = list()
var/tmp/storedsuffix

for(var/obj/Items/storedItems in usr.contents)
storedsuffix=storedItems.name
storedItems.name+=" ([storedItems.value] Xal)"
itemlist+=storedItems
storedItems.name = "[storedsuffix]"
if(length(itemlist)==0)
usr << "You have nothing to sell."
return
else
var/item = input("What would you like to sell?", "Weapons Shop") as null | anything in itemlist
for(var/obj/Items/selling in usr.contents)
if(item == selling)
var/bool = alert("Are you sure you would like to sell your [selling.name] for [selling.value] Xal?", "Confirm", "Yes", "No")
if(bool == "Yes")
usr.xal += selling.value
usr << "You have sold your [selling.name] for [selling.value] Xal."
usr.contents -= selling
goto sell
if("Cancel")
return
In response to Xirre
if(item == selling)

Why are you doing this?

If you're already doing this:
var obj/Items/item = input(...

And you know that "item == selling", then why don't you just use "item"? It seems to me that "selling" is a redundant variable, as you already have a reference to something usable.

var obj/Items/item = input(...
// item at this point is either
// null if the player hit cancel, or
// an /obj/Items object.
// It's safest to check again that item is in usr, though.
if(item in usr)
// etc.
In response to Kaiochao
I'll be giving the "item" a different name so it shows the price as well in the selection list. That defeats the purpose of telling the user "You have sold your [selling.name] for [selling.value] Xal." It's show up as "You have sold your Wooden Sword (175) for 175 Xal" If I replaced selling with item.
In response to Xirre
But... item == selling. Whatever you do to "selling" is done to "item" because they are the same, just like how every "item" was a "sortedItems". I'm missing something.
In response to Kaiochao
I think maybe he's trying to check to see if it's not null. Sometimes when you use input to get items if you don't check to see if the item is actually there, weird things happen.
In response to Dariuc
I don't think contents can contain any nulls, but it would still only take an if(item) to check.
I meant more of, from the contents list, the item goes into var when you use input--unless you choose cancel, then it's null.

It's a bit of a stretch but that's the only reason I could see why he would have it placed there or coded like that.
I'll look over the code when I finish these last few updates and see what can be removed. As of right now, I'm just trying to push forward. lol. If I find any way to condense the code and remove unnecessary lines then I'll post it here once again for future references.
Page: 1 2