ID:1029000
 
Keywords: list, location, mob, transport
(See the best response by NNAAAAHH.)
Code:
mob/var/tmp
list/Challenger=list()
//I use this to add a mob to the list.
usr.Challenger+=M

//and to extract the mob from the list
for(var/mob/M in usr.Challenger)
M.loc=locate(40,3,3)


Problem description:
I can't seem to get this to work. I'm trying to have the usr and M transfer to almost the same location by adding M to a list and when usr transfers. it runs through a proc and tries to access M in the list and send it to those coordinates.


Moar details on how you add the mob to the list needed, kk thnx.

All we see is some unknown variable(M) being added to a tmp list. We don't know if the M is a mob or just a text string. Could be null for all we know.
mob/var/tmp
list/Challenger=list()

obj/NPC
Main
icon='Base.dmi'
density=1
verb
Use()
set src in oview(1)
if(usr.MainMenu==1) return
if(usr.SingleMenu==1) return
if(usr.ExitMenu==1) return
for(new /mob/Monster/Base)
for(var/mob/Monster/Base/M)
usr.Challenger+=M
usr.Fighting=1
usr.Location()
usr.TerrainCheck()

mob/proc/Plain_Map()

if (!Plains ["One"])
PlainLoc = "One"
src.loc=locate(2,3,3)
src.client.view="15x8"
src.client.eye=usr
for(var/mob/M in usr.Challenger)
M.loc=locate(40,3,3)
M.client.view="15x8"
M.client.eye=M
Basically it's supposed to add the Mob into the Challenger List. And then extract the list, so that the location, eye, and view can be set for that mob
In response to Isenggard
Best response
mob/verb/SetEnemy()
var/mob/Enemy/E=new(location)//create a new mob of type /mob/Enemy at location(has to be a atom, not co-ords)
usr.List+=E//Add new mob to List
mob/proc/Fight()
loc=locate(x,y,z)//locate src to x,y,z
for(var/mob/M in List)//for every mob in List
M.loc=locate(x2,y2,z2)//Set enemy in second location
if(M.client)//If the mob you're facing is a player
M.client.stuff=otherstuff//Set client vars

Thanks, The set enemy verb got me the answer I needed.