ID:2714386
 
Looking for a lighting plane/Master Plane code I don't understand it
Here are the basics.

Planning

You'll want to designate which planes you'll use for the main game and for lighting. Usually, the main game will stay on plane 0, and lights (the halos from any light sources) will be on a higher plane like 1. Using #define to create constants for your planes is a good idea.

#define GAME_PLANE 0
#define LIGHTING_PLANE 1
#define HUD_PLANE 2
...

The goal here is that all your lights will be drawn together on the lighting plane, which is all grouped under a plane master, and then you can multiply that on top of the main render.

The lighting plane master

Create a special object that's a plane master on your lighting plane. Give it the appearance_flags of PLANE_MASTER and probably also NO_CLIENT_COLOR (not relevant if you don't use client.color). It should have a blend_mode of BLEND_MULTIPLY.

This plane master has to be made visible to your player somehow, so you'll probably want to add it to client.screen during Login(). Give it a simple screen_loc like "CENTER"; the actual loc doesn't matter much since this is for a whole plane, and it doesn't have a position like an object in your regular map or HUD would.

Finally, you'll also want to give this plane master a background. Just give it an overlay which is also on the lighting plane, but has a layer like BACKGROUND_LAYER+1. The overlay can be an icon that's either black or a dark gray that will be used for ambient light. Set a fairly large scale transform for this, like matrix(30, 30, MATRIX_SCALE). It should be big enough to cover the entire viewport.

Lights

Now you'll want lights. These can be simple white halos that fade out from the center. Make them overlays of the icon that you're actually using as a light source (e.g., a streetlamp or a lantern), but the overlay should be on the lighting plane. This halo overlay should also have a blend_mode of BLEND_ADD, since you want all the light sources in the scene to add together onto the lighting plane and then multiply that as a mask over the main game.

Each light can have its own color applied, so you can have a single white icon and scale it down for small lights.

How it all works

When it comes time to render, the black (or dark gray) lighting background and all the lights are grouped together as "children" of your plane master, which tells them to render to the same temporary surface. This creates a lighting map that will be mostly dark, except where any of your light sources are. The background should be at the bottom of this group, and the lights are drawn on top with BLEND_ADD so they all add light. (That is, if two lights are close together their halos will merge.) All together, this forms your lighting mask.

Now because the lighting plane master has BLEND_MULTIPLY, your lighting mask gets multiplied over the image that's already been rendered.
Do you have a demo of the code i can get and i can just use that?
No. It's important that you work on the code yourself and understand it. If you start putting it together and run into any snags we can help you through those. If you're not clear on anything in the previous post, we can walk through any of the specifics that are throwing you.
In response to Lummox JR
Ok Thank you.