Code:
open_space
proc/get_icon_below(T as turf in locate(x,x,Z))
src.icon_state=T.icon_state
turf\floors.dm:10:error: T.icon_state: undefined var
So this didn't work, I guess i see why.
I know how to code falling through the open space, but without a texture, it is just a black turf, i want to get the turf's icon_state one Z level below the open_space turf.
The Z in the locate proc is a var that is always set to the Z level that is below the player.
The spacing is correct its just the code i need help with.
1. When declaring a parameter (or any variable), you need to include the "type" that you want the variable to assume. So, declaring T as "turf/T" instead of just "T" means that T has all the vars and procs that all turfs have, including icon_state (which is inherited from /atom).
"as turf" is a filter that is specific to fields (vars of types), verb parameters, and the input() proc. It doesn't declare the T variable as the type /turf.
2. There are no "turfs in locate(x,x,Z)" because locate() always returns a turf when given coordinates (or null if the coordinates are off of the map), and turfs can't be in other turfs.
This is probably what you want: