ID:990978
 
I have two problems that I would be grateful if anyone could provide an answer to.

The first is how do i make a list show every element in it, even if the 2 elements are the same type. Example:
mob
Login()
var/obj/TestOBJ/O = new(src.contents)
O.stat1=1
O.stat2=1
var/obj/TestOBJ/O2 = new(src.contents)
O2.stat1=1
O2.stat2=0
verb
TestVerb()
var/list/choicelist = list()
for(var/obj/O in usr.contents)
if(O.addtolist==1)
choicelist += O
choicelist+="Cancel"
var/obj/Choice = input("Select One","Test")in choicelist
if(Choice=="Cancel")
return
else
usr << "[Choice]:"
usr << "[Choice.stat1]"
usr << "[Choice.stat2]"
obj
var
stat1 = 0
stat2 = 0
TestOBJ

In the above example, there are 2 TestOBJs in the inventory when you login, one with stat1=1 stat2=1 and the other with stat1=1 stat2=0, the TestVerbs will make you pick one and display the stats as outputs. The problem here is the test verb will only have 1 TestOBJ in it, not both, and will always pick the one first in usr.contents... How can I get it to show both objects while still being able to reference them?

The second problem is more of a straight question really. How can I get an Obj verb to appear in the pop-up menu of a mob in a list other than usr.contents.
Example:
obj/Hammer
verb
Use(mob/Enemy/M)
set category = null
set src in oview()
var/mob/Player/P = src.owner
P << "You hit [M] on head with hammer!"

In the above example, the verb Use will only appear in the pop-up menu when you right click, the problems however, is that it will appear in the pop-up menu for all mobs (and return an error if you select a non-enemy) where I just want it to appear for mobs of type /mob/Enemy and secondly it doesn't show up in the pop-up menu for mobs that are in a statpanel.

Any ideas on any of these problems would be a great help to me,

Thank You,
Kozar's Friend
1. Make TestObj have different names
2. Verb doesn't appear for mobs in contents because you have set src in oview(), don't know how to fix your problem though. Verbs were good in BYOND 3.0 or 3.5, but now there's interface and it's better to use it.
Thank you for the reply.

I should have mentioned for problem 1 that they cant have separate names due to the fact that in the game this problem occurs when having to items the same (IE 2 Ice Swords) I was hoping for a solution other than changing the the name, but what I am going to do for now is use an item slot number to separate them "Ice Sword [1]" for slot 1 item and "Ice Sword [3]" for slot 3 item.

As for problem 2 I had a feeling that would be the case. In which I'll keep it as it is for now, since it isn't a major problem for the players.

Thanks Again,
Kozar's Friend
As alternative solution to problem 1 you could make custom interface that would display all items and you'd choose them by clicking, double clicking or right click.
As I'm sure you'll notice; when selecting from a list via input, it'll only name everything once. The only way I know to get around that is to give the two objs a different name, or to manualy display the list to the player(like is a stat tab).
Just out of curiosity will this be a Mario RPG game?
Yeah, for problem 2, the best solution would be to use skin grids.
Thanks to all of you, I'll see what I can do with the interface idea for problem 2, and people are preferring the "Name [number]" method so I will stick with that for now.

ImmeasurableHate, no this isn't going to be a Mario RPG I'm afraid :)

Thanks again to all you're replies.
Kozar's Friend