ID:2628552
 
(See the best response by Magicsofa.)
Problem description:

This is really bothering me because I don't know why this would happen and it's preventing me from getting some good work done. Any time I add a PLANE_MASTER to the lighting plane (Defined as -1), it draws everything on plane -1 as invisible despite no changes to the plane master.

I use SS13 lighting for lighting visuals. The way lighting works is that it calculates what the lighting would look like for each corner and generates an icon to accurately reflect that. For some reason whenever I set a plane master for that, it refuses to draw. It refuses to draw even simple overlays that are just icons attached to objects on the overlay layer.

I've tried mixing and matching appearance flags on the plane master to see if that is the issue. Nothing seems to work. As an experiment I disabled all other plane_masters and it still does not draw. I triple checked to see if any other objects use plane -1, but it's just lighting objects.

The object:
//Lighting
/obj/plane_master/lighting
name = "plane master"
screen_loc = "CENTER"
mouse_opacity = 0
layer = LAYER_LIGHTING
plane = PLANE_LIGHTING
invisibility = INVISIBILITY_LIGHTING
blend_mode = BLEND_MULTIPLY
appearance_flags = PLANE_MASTER | LONG_GLIDE | PIXEL_SCALE | RESET_COLOR | RESET_ALPHA | KEEP_APART


How it's added. (Other planemasters are added in the same proc, and they work fine.)
    if(!plane_master_lighting)
plane_master_lighting = new(src)
C.screen += plane_master_lighting



Any help would be greatly appreciated.
Plane -1 is below the default map plane. Anything on plane 0 is gonna draw on top of it.
Best response
Lol @ LONG_GLIDE. I understand the desire to just try completely random things and see if it works, but you can really create serious headaches for yourself if you do that too much. Long glide has everything to do with the old-school tile based movement, and absolutely nothing to do with plane masters. Also, all the RESET_ flags only work if the object is attached to something else (as in an overlay). Also, KEEP_APART only works if there's an attached object that has the KEEP_TOGETHER flag set.

I would really, really, really encourage you not to do things recklessly like that. If you don't understand what a property does, don't just throw it in. Experiment with that property in an isolated fashion so you can learn how it works. This is the kind of situation where you could slap on a flag that has no effect now, but then later on it totally breaks something and you won't remember why.
In response to Ter13
Ter13 wrote:
Plane -1 is below the default map plane. Anything on plane 0 is gonna draw on top of it.

All my physical planes are below -1 as well. The lighting was already on plane -1 before and it worked fine.

#define PLANE_WALL -8

#define PLANE_BLOOD -7

#define PLANE_OBJ -6

#define PLANE_MOB -5

#define PLANE_SCENERY -4

#define PLANE_EFFECT -3

#define PLANE_AREA -2

#define PLANE_LIGHTING -1

#define PLANE_DARKNESS 0


Magicsofa wrote:
Lol @ LONG_GLIDE. I understand the desire to just try completely random things and see if it works, but you can really create serious headaches for yourself if you do that too much. Long glide has everything to do with the old-school tile based movement, and absolutely nothing to do with plane masters. Also, all the RESET_ flags only work if the object is attached to something else (as in an overlay). Also, KEEP_APART only works if there's an attached object that has the KEEP_TOGETHER flag set.

I would really, really, really encourage you not to do things recklessly like that. If you don't understand what a property does, don't just throw it in. Experiment with that property in an isolated fashion so you can learn how it works. This is the kind of situation where you could slap on a flag that has no effect now, but then later on it totally breaks something and you won't remember why.


I don't know what you're talking about because the entire purpose of me adding those flags was to experiment to see if something special needed to be added for it to work with icons generated like that.
Fair enough, just sayin it's kind of a brute force method :P
What's INVISIBILITY_LIGHTING?
In response to Ter13
Ter13 wrote:
What's INVISIBILITY_LIGHTING?

It's set to 5. By default, all mobs can see 10. Ghosts can see 90.
I'm experiencing the same problem. When i add PLANE_MASTER to the lighting plane it draws everything on plane lighting as invisible, but from the moment i change lighting plane from PLANE_MASTER's plane it gets back to normal. I also tried adding ALL blend_mode types and it didn't work
In response to Comicao1
I FIGURED IT OUT.

Removing the blend_mode on the lighting object itself, not the plane master, fixes it. It seems that it stops drawing or something if both the object and the plane master have a blend_mode set. Not sure if this is a bug, will report on it tomorrow.


Comicao1 wrote:
I'm experiencing the same problem. When i add PLANE_MASTER to the lighting plane it draws everything on plane lighting as invisible, but from the moment i change lighting plane from PLANE_MASTER's plane it gets back to normal. I also tried adding ALL blend_mode types and it didn't work

Quoting you so you know as well.
Hold on, hold on. There is only one object in the code you posted. That object is the plane master. As said in the reference, the plane master's icon is not supposed to be drawn. Only the separate light objects that you should be adding to the same plane will be drawn, through the "lens" of the plane master if you will. It should be totally acceptable for the light objects to have BLEND_ADD. The lights themselves shouldn't be BLEND_MULTIPLY - only the plane master.

Login to reply.