This was my first attempt, but it just doesnt look right:
var/list/witches = list(src.race = "Witches")
Can anyone help?
ID:156189
Dec 11 2010, 9:53 am
|
|
Alrighty, Im trying to make a verb that searches for players who have a certain race in view. I figure I have to use list, but I dont know ho to set it up?
This was my first attempt, but it just doesnt look right: var/list/witches = list(src.race = "Witches") Can anyone help? |
In response to Rapmaster
|
|
Like I have one verb that "hides" your race from others, so when a mob uses a verb that searches for a particular race within view or an area, then user of the hiding verb would be undetected. I have no idea how how to make the verb to search, and thought I would need a list, do I need one?
|
In response to HaffCaff
|
|
mob/var/race=""
mob/var/canbesearched now you still use oview() as before but this time modify it to check if the mob can be searched. and then u get your list of mobs which you can add to a list if you wanted. list.Add(M) |
In response to Rapmaster
|
|
Ok, I think I did a bad job explaining. Ill show you my code so it makes more sense:
mob/var See? Now I dont know what to do? |
In response to HaffCaff
|
|
mob/var/tmp/list/souls=list()//define the list seeing as this is not compiled by me, i am not sure whether there are bugs in it so use at your own peril aha |
In response to Rapmaster
|
|
Alright, compiled that code and got this:
mob/var/tmp/list/souls=list()//define the list loading Soul Eater.dme SoulSystem.dm:91:error: mob/var/tmp/list/souls: duplicate definition SoulSystem.dm:91:error: list: instruction not allowed here SoulSystem.dm:91:error: : duplicate definition SoulSystem.dm:91:error: ==: instruction not allowed here SoulSystem.dm:98:error: s: undefined var SoulSystem.dm:92:error: : empty type name (indentation error?) SoulSystem.dm:98:error: src.souls.Add: undefined var SoulSystem.dm:106:error: src.souls: undefined var SoulSystem.dm:110:error: src.souls.len: undefined var SoulSystem.dm:113:error: src.souls: undefined var SoulSystem.dm:114:error: src.souls.Remove: undefined var Any Ideas? Im sorry about the wholelist thing, If you know a way I can do it without them then please let me know, I just thought I needed one. EDIT** Ok, I looked at the errors and changed a few things, and it worked, this is the working compiled code mob/var/tmp/list/souls=list()//define the list |
In response to HaffCaff
|
|
seperate mob/var... and the mob/proc into two seperate lines. also by the looks of things you might have to rename the list to like soulssearch? up to you, it says you have a list called souls already.
|
var/mob/M
for(M in oview(6)); if(M.race==x); M.money+=100 ...