ID:2267861
 
(See the best response by Kaiochao.)
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.
Best response
You probably shouldn't be using a parameter for this, and the way you defined the parameter doesn't make much sense either.

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:
open_space
proc
// Define a new proc that takes no arguments.
get_icon_below()

// Get a reference with type /turf to the turf "below" src.
var/turf/below = get_step(src, DOWN) // or locate(x, y, z - 1)

// Set src's icon_state to below's icon_state.
icon_state = below.icon_state
Wow...thanks for helping me out, as you can tell im pretty new to this, this is helping me understand more.