//edit //
I figured most of it out, but I'd show how many people are in it. This is what I got...
List_Guilds()
var/t
for(t in guilds)
src << "[t][guilds[t]]"
ID:174264
Sep 6 2003, 3:48 pm (Edited on Sep 6 2003, 3:59 pm)
|
|
I'm almost done making my guild system, but I'd like to create a 'List Guild' verb. How would I go about doing this?
//edit // I figured most of it out, but I'd show how many people are in it. This is what I got... List_Guilds() |
In response to SSJ2GohanDBGT
|
|
SSJ2GohanDBGT wrote:
So instead of this(once again assuming guilds is your var, and you used src.guild = "Guild Name" ..) This is a non-solution, though. It's redundant information and it's not at all what he's looking for: He wants a list of guilds, not a list of players. Besides, not only is the approach wrong, but you've got at least 4 serious syntax errors in there. Lummox JR |
In response to Lummox JR
|
|
List_Guilds()
usr << "Guilds:" for(var/t in guilds) usr << "- [t]" If you want them numbered. List_Guilds() var/n=1 usr << "Guilds:" for(var/t in guilds) usr << "[n]. [t]" n++ |
Rocker121 wrote:
I'm almost done making my guild system, but I'd like to create a 'List Guild' verb. How would I go about doing this? List_Guilds() Well, some information is missing here, like what's in the guilds list: Are they just names, or are they lists of players, or are they datums (the best solution) like /guild? How are your guilds organized? One thing I can tell you off the bat is that when you loop through using for(t in guilds), t is not a list index; it's the actual item in the list. Therefore guilds[t] would be a value associated with that. Here's a simple example of how you'd handle this using the datum approach: var/list/guilds = list() Lummox JR |
In response to Lummox JR
|
|
Lummox, that's exactly what I was looking for =D. Thanks a bunch.
|
List_Guilds()
var/t
for(t in guilds)
src << "[t][guilds[t]]"
var/t = nothing, and in guilds makes it think guilds is a list of a kind, which I assume it isnt.
So instead of this(once again assuming guilds is your var, and you used src.guild = "Guild Name" ..)
Mob/verb()
List_Guilds()
for(var/mobs/P in world)
src << "[P.name] [P.guild]
That loops through all the mobs in world, and displays their name, and guild.
James