//ELEVATION------------
turf
var elevation = 0
elevation
icon = 'elevation.dmi'
elev_1
icon_state="1"
elevation = 1
elev_2
icon_state="2"
elevation = 2
elev_3
icon_state="3"
elevation = 3
elev_4
icon_state="4"
elevation = 4
mob
Move()
if(istype(src.loc, /turf/elevation) in get_step(src,dir))
var/turf/currETurf = src.loc
var/level = currETurf.elevation
var/turf/nextETurf = get_step(src,dir)
var/nextLevel = nextETurf.elevation
if((level + 1 != nextLevel) && (level - 1 != nextLevel) && (level != nextLevel))
return 0
else
return ..()
else
return ..()
Problem description: So I know at least a few people have been doing elevation in their games, but the code I've been finding has usually been very specific to individual turfs. Like, people would have a cliff turf or a certain grass turf that would have the elevation. All I want to do is set some transparent overlay turfs to have a certain elevation property so that I can reuse those overlays wherever I think it's appropriate. So far this code snippet has been doing nothing for me. I just walk on to the elevation 3 from elevation 0.
What's wrong with the code? Thanks!