var/Z=rand(1,8)
M.loc= locate(M.Z,M.Z,M.z)
That dont work at all. This shown below work with the map view.
var/Z=rand(1,8)
M.loc= locate(Z,Z,M.z)
So how do i go about making M teleport to random spot thats in M view.
I tried using rand but it didn't work with view nor the M. Shown below
var/Z=rand(1,8) That dont work at all. This shown below work with the map view. var/Z=rand(1,8) So how do i go about making M teleport to random spot thats in M view. |
In response to Cody123100
|
|
Cody123100 wrote:
The mob will move to the new location if movement is possible (i.e. the random location isn't dense or nonexistent or otherwise blocked). Otherwise, it will fail and no teleportation will occur. The simple workaround to this is to utilize Move's return value within a loop and keep generating A and B and then trying to Move until Move returns a value of 1. Here is a sample of the final product. > Teleport() Okay, I didnt understand so i do what i always do and search DM Ref of what you showed me. So i can understand. Then i tried it out. For moment it had my eyes crazy because I use it as proc and it spam it and had me teleporting all over the map. Then just add few adjustment added a return so it wouldn't continue and its perfect. Thank you for help. |
The mob will move to the new location if movement is possible (i.e. the random location isn't dense or nonexistent or otherwise blocked). Otherwise, it will fail and no teleportation will occur. The simple workaround to this is to utilize Move's return value within a loop and keep generating A and B and then trying to Move until Move returns a value of 1. Here is a sample of the final product.