Code:
mob
verb
Phase()
for(var/turf/T in usr.loc)
var/obj/Phasing_Icon/P = new /obj/Phasing_Icon
P.loc = usr.loc
P.icon = T.icon
ID:2117467
Jul 17 2016, 9:23 am
|
|
I am trying to make it so that when a player presses a button their icon or (body) phases into the ground. I already had the idea of using pixel_y to simulate them going down, but I could not figure out a way to make it so that their body slowly goes down. I tried to make a black object that has an animation of it going up so that I could make a code that turns that object's icon into the turf icon of wherever the player is standing, but it ended up crashing the game.
Code: mob |
Jul 17 2016, 9:36 am
|
|
Did you try using animate()?
|
So you tried something similar to the following?
// pixel_x/y need some adjusting for your own project. |
I tried something similar to that, but the object never turned the same icon as the turf.
|
In response to Dayvon64
|
|
It worked fine for me in my test project.
One thing I noticed wrong with your snippet: for(var/turf/T in usr.loc) You are looking for turfs inside usr.loc, which is likely a turf. This is probably why your object did not take on the turf's icon -- nothing was found. You don't even need a for() loop there. Just use usr.loc for your turf reference. |