ID:2644974
 
Resolved
vis_flags, render_source, and render_target did not work with initial().
BYOND Version:513
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 84.0
Applies to:Dream Daemon
Status: Resolved (513.1540)

This issue has been resolved.
Descriptive Problem Summary:
Attempting to fetch the initial render_target of a plane master typepath always returns a null. I'm not sure if this occurs with atoms, movables, or instanced plane masters more generally.

Numbered Steps to Reproduce Problem:
Define a plane master subtype with a hardcoded render_target
Assign the typepath to a var typed as a plane master
Attempt to fetch the initial render target using initial(plane_master_typepath.render_target)
Receive a null regardless of what the initial render target should be.

Code Snippet (if applicable) to Reproduce Problem:
#define EMISSIVE_TURF_RENDER_TARGET    "*EMISSIVE_TURF_PLANE"

/atom/movable/screen/plane_master/emissive/turf
name = "emissive turf plane master"
plane = EMISSIVE_TURF_PLANE
layer = EMISSIVE_TURF_LAYER
render_target = EMISSIVE_TURF_RENDER_TARGET

/atom/movable/screen/plane_master/lighting
name = "lighting plane master"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
render_target = LIGHTING_RENDER_TARGET

/atom/movable/screen/plane_master/lighting/Initialize()
. = ..()
var/i = 1
for(var/plane in subtypesof(/atom/movable/screen/plane_master/emissive))
var/atom/movable/screen/plane_master/emissive/emissive_plane = plane
var/emissive_source = initial(emissive_plane.render_target)
add_filter("emissives-[i]", i++, alpha_mask_filter(render_source = emissive_source, flags = MASK_INVERSE))
add_filter("object_lighting", i++, alpha_mask_filter(render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE))


Expected Results:
`emissive_source` would be assigned the relevant render_target for the given emissive plane and allow the emissive planes to mask the lighting plane

Actual Results:
Fetching the initial render_target of the plane master typepaths consistently returns a null, breaking the intended function of the filters.

Does the problem occur:
Every time
Yep
In other games?
It popped up on ss13 and on a test program so I'm going to say yes.
In other user accounts?
Yep
On other computers?
Yep

When does the problem NOT occur?
It seems to occur every time, at least with plane masters.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unknown

Workarounds:
Assigning a second copy of the render target to another var will make it accessible, but you'll need to remember to reassign it every time you override the render_target.

I tend to doubt the fact of this being a plane master is the issue. The problem would instead seem to stem from initial() for this var.
Lummox JR resolved issue with message:
vis_flags, render_source, and render_target did not work with initial().