var/list/MartialPassives=list()
mob
proc
ListPassives(var/ClassType="")
src << output(null,"Passive.Passive2")//clears it
if(ClassType=="Martial Artist")
if(!locate(/obj/Passives/Martial_Artist/Full_Force) in MartialPassives)
var/obj/Passives/Martial_Artist/Full_Force/A=new
MartialPassives+=A
if(!locate(/obj/Passives/Martial_Artist/Full_Force2) in MartialPassives)
var/obj/Passives/Martial_Artist/Full_Force2/D=new
MartialPassives+=D
if(!locate(/obj/Passives/BuySkills/MartialArtist/Heavy_Strike) in MartialPassives)
var/obj/Passives/BuySkills/MartialArtist/Heavy_Strike/B=new
MartialPassives+=B
for(var/obj/C in MartialPassives)
usr << "[C.name] (\ref[C])"
usr << output(C,"Passive.Passive2")
Problem description:
The issue is, it's building the list just fine, but it only displays the final item in that list on my grid element(passive.passive2). I think it's a problem with my grid? The settings have it set as a flexible list of entries, starting cell is 1,1.. Not sure what could be the issue. Any help would really be appreciated!
Here's the reason you're only seeing one item: You don't specify a grid cell. You need to choose a cell number for the item to go in. Since this grid is in list format, the cell is just one number instead of two.
The locate/new code above all that is kind of disturbing, though. Seems like you could save yourself a crapload of time this way:
You can probably do even better by having a quick way to get those two type paths (the regular and buyable passives) from the string without a lot of if/else checks. For instance, if your class naming scheme is consistent where the name always stays the same and spaces are replaced by underscores: