"set next_char room.people.vnum" does not do what you expect. This means, literally, "give me the vnum of the first char in the room", as a text string (1234). This is, generally - as I stated earlier - not what you want to store.
Instead, you will want to use this formula:
Code:
* it doesn't matter what the variable is called. We use iterator here to make it obvious.
set people_iterator %room.people%
* check that there is actually a person in the variable at this point
while %people_iterator%
* since we are not purging the current person (or killing them in the loop), just work with the var
* otherwise, store a "next_in_room" variable here.
* increase our counter (why are you adding the people to a list? this seems overly complicated)
eval num %num% + 1
* now STUFF all of the people into a list, 1 to n!
* this stores a fully-fledged character variable at victim[X].
* This is useful for dg commands like %force%, %kill%, etc.
set victim[%num%] %people_iterator%
* if you just want their ID (not that I see that as useful), use this:
set victim[%num%] %people_iterator.id%
* if the vnum is what you want to store, you could do it like this:
set victim[%num%] %people_iterator.vnum%
* now, we move our iterator to the next character in the room
set people_iterator %people_iterator.next_in_room%
* and complete the loop
end
But, will you PLEASE enlighten me about what you need the victim-array for? The only reason I can see would be to store the list for later use. And that seems, as I mention in the code above, somewhat convoluted and complicating. I mean, you'll have too loop over the array afterwards to make any use of it. I'd have gone with the more tried and tested solution here:
Code:
* obtain first char in room - adjust to %actor.room.people%, %self.room.people%, etc.
set person %room.people%
* as before, check if the loop is done
while %person%
* because this loop is generic, we might destroy the character and thus move it out of the room. Save the next-value.
set next %person.next_in_room%
* do bad, bad stuff to the person if they are not fidos
if %person.vnum% != 3001
%echo% %person.name% is KILLED!
%kill% %person%
end
* now, go to next person. Use the stored value from above. Perhaps the person no longer exist at this point.
set person %next%
* and loop
end