![]() Apr 2 2013, 6:33 pm
|
|
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 |
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") |
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(... |
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.
|
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.
|
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.
|
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. |