ID:268439
 
1) How would you make an obj's screen_loc x and y change to a different amount?

Example... This doesn't work:

...Code here...
for(var/obj/g in world)
g.screen_loc="g.x-1,g.y"


Neither does...

...Code here...
for(var/obj/g in world)
g.screen_loc="x-1,y"


Is there anything that would work that is similar? If not, I would appreciate an example of how to do it properly.
Devourer Of Souls wrote:
1) How would you make an obj's screen_loc x and y change to a different amount?

Example... This doesn't work:

> ...Code here...
> for(var/obj/g in world)
> g.screen_loc="g.x-1,g.y"
>

Neither does...

> ...Code here...
> for(var/obj/g in world)
> g.screen_loc="x-1,y"
>

Is there anything that would work that is similar? If not, I would appreciate an example of how to do it properly.

I'm no expert but by the looks of it try the second one but make it like this g.screen_loc="[x-1],[y]". U see its only picking up the text screen_loc"x-1,y" and since x and y are letters it is like what the heck this coders on crack!

Also there is probley some other problems with your code but, Im no super advanced dm programmer so asked one of the olbies.
When you are setting screen_loc you are setting it as text so when you do g.screen_loc="g.x-1,g.y" it is trying to set it to "g.x-1,g.y". What you want to do is:

...Code here...
for(var/obj/g in world)
g.screen_loc="[g.x-1],[g.y]"


Also just to note if there is an obj located at 100,100,1 it will put it's screen_loc to 99,100.