ID:1429343
 
(See the best response by Magicsofa.)
Code:
mob
verb
replaythrow(mob/M in view(2))
looping
var/turf/replay/S = new/turf/replay
S.loc = locate(M.x-1, M.y, M.z)


Problem description:reply.dm:8:error: S.loc: cannot change constant value

Best response
Turfs can't move. Sorry!

Your only choices are to either make a new turf at the desired location, or modify the turf that is already there.

EDIT: Hmm, I didn't even realize you were already creating another turf. Do it like this:

var/turf/replay/S = new/turf/replay(locate(M.x-1, M.y, M.z))
//it's not necessary to specify the type a second time...I would write it like this:
var/turf/replay/S = new (locate(M.x-1, M.y, M.z))
I hope you don't do this for every object you create. It tells you in the DM Reference what the "new" instruction does and how it is supposed to be used to set the initial location of whatever atom is being created. You read that when you learned about "new" in the Guide or the DM Reference, right?
I was trying to make it so when this verb is used, the turf gets placed where the other person is
no, it was only for this one verb
there is already a turf btw,
turf/replay
icon='replay.dmi'

then its that code
It says reply.dm:7:warning: S: variable defined but not used
                var/turf/replay/S = new (locate(M.x-1, M.y, M.z))
In response to Naruto 5292
Naruto 5292 wrote:
It says reply.dm:7:warning: S: variable defined but not used
>               var/turf/replay/S = new (locate(M.x-1, M.y, M.z))
>


Then don't create a variable.

new/turf/replay/(locate(M.x-1, M.y, M.z))
thank you, no errors now :D
hey just wanted to know, is it possible to make it a loop? like adding goto loop or osmthing
like u see how it is looping, cant i just do
 goto looping
when i try that it says looping: invalid proc definition
don't mess with goto...use something like while(src)
id have to disagree about turfs not being able to move.... -_-
// heres how i imagine it.
mob/verb/Move_Turf () // replace the Name to what you desire.
set category = "Turf"
for (var/turf/T in range (2))
follow // loop name
sleep (10) // delays it so the server doesnt crash.
walk (T,src) // makes the turf walk.
goto follow
// pretty simpilistic idk if this is exactly what your looking for , i hope this helps.
In response to Hebrons
Hebrons wrote:
id have to disagree about turfs not being able to move.... -_-

The reference disagrees with you: http://www.byond.com/docs/ref/info.html#/turf
Magicsofa can u explain that a bit?
@Ex Pixel , haha i feel dumb lol
i kinda misunderstood exactly what Naruto 5292 requested.
Page: 1 2