ID:163337
 
This is supose to move all players in party and self. into combat field...

And create enemys for the field.


Why doesnt this work?


mob/var/inbattle=0   
obj
battle
grass
var
inuse=0
land="grass"
enemy1
enemy2
enemy3
player1
player2
player3
mob/var
lastx
lasty
lastz
mob/proc
fightgrass()
world<<"INITIATED!"
var/selected=0
for(var/obj/battle/grass/T in world)
if(!T.inuse || !selected)
selected=1
world<<"blech"
var/many=rand(1,3)
while(many>0)
T.enemy1=pick(/mob/enemys/slime/)
many-=1
T.enemy2=pick(/mob/enemys/slime/)
many-=1
T.enemy3=pick(/mob/enemys/slime/)
many-=1
world<<"1"
var/starty=1
usr.lastx=usr.x;usr.lasty=usr.y;usr.lastz=usr.z
usr.loc=locate(T.x+3,T.y+starty,T.z)
starty-=1
world<<"2"
for(var/mob/M in usr.party)
M.lastx=M.x;M.lasty=M.y;M.lastz=M.z
M.loc=locate(T.x+3,T.y+starty,T.z)
starty-=1
if(T.enemy1)
new T.enemy1(locate(T.x-3,T.y+1,T.z))
if(T.enemy2)
new T.enemy2(locate(T.x-3,T.y,T.z))
if(T.enemy3)
new T.enemy3(locate(T.x-3,T.y-1,T.z))



Nothing happens, Doesnt move no one. :(.
Don't use Usr in procs.
In response to KirbyAllStar
No der. Ive been coding for 2 and a half yrs. and using usr isnt gonna mess with the proc. Thats just referring to what the reference is, Is the proc is being called FROM the person its being executed on.. src and usr will deafault be the same exact thing. I know the difference and when to and not to use em. thanks :). I need help figuring out why it wont do anything WITHIN the proc tho... It runs through the whole thing, just doesnt change locs.