ID:268722
 
warp
parent_type = /area
test1
Enter(mob/M)
M.loc = locate(1,1,1)
for(var/mob/monster/Q in M.monsters)
Q.loc = locate(M.loc)


The monsters don't get warped with it. :(
How would you go about doing this?
Don't use locate(M.loc). If a player is on the map, their loc will be a turf.
Hell Ramen wrote:
The monsters don't get warped with it. :(
How would you go about doing this?

You've got several parts of this wrong.

warp
parent_type = /area
test1
Enter(mob/M)
M.loc = locate(1,1,1)
for(var/mob/monster/Q in M.monsters)
Q.loc = locate(M.loc)


You're using Enter() instead of Entered(). If you don't want to restrict movement, then use Entered(). The argument shouldn't be mob/M, if you aren't checking if its a mob too. It might be longer, but it is more safer and organized.

The second thing which is wrong is that you're using locate() on a loc. You can just edit the loc manually.

warp
parent_type = /area
test2
Entered(atom/movable/A) // any movable atom can move to it
if(ismob(A))
var/mob/M=A // define it as a mob, to use mob atributes
for(var/mob/monster/Q in M.monsters)
Q.loc = M.loc // no need to use locate()


If I made any errors, tell me.

~~> Dragon Lord
In response to Unknown Person
:o
Thanks DL, 'tis perfect.