Edited by Hello Darren, 16 December 2011 - 02:44 PM.
Easy Lighting V7.0.2 | Last Updated: 06/07/11
#421
Posted 12 December 2011 - 07:52 PM
#422
Posted 13 December 2011 - 06:02 PM

And also i was wondering about more than 1 view that use's 2 different background image's for the lighting? since my view 1 is controlled by the player. and view 2 is controller by another controller is it possible to make them have the same lighting effect? i tried 0 and 1 in view shamefully didn't work. thanks again for this great and easy to use lighting engine ^^;
#423
Posted 14 December 2011 - 12:22 PM
This is what I have in the obj_Wizard Create event.
var = instance_create(x,y,obj_WizardLight); var.vParent = id;
This is in the obj_WizardLight Create event.
vParent = 0 // initalise vLight = lt_lightadd(spr_LightWizard, 1, vParent.x, vParent.y, 1, 1, 0, c_white, 1, 0);
This is in the obj_WizardLight Step event.
if instance_exists(vParent)
{
lt_lightset(vLight, spr_LightWizard, 1, vParent.x, vParent.y, 1, 1, 0, c_white, 1, 0);
}
else
{
lt_lightdelete(vLight);
instance_destroy();
}It looks like the above code also messes up one my other lights as well. A light that appears over the ninja when he casts a spell doesn't show up at all if the level has any obj_Wizard in it. Don't know why they would conflict.
Edited by Hello Darren, 14 December 2011 - 03:49 PM.
#424
Posted 19 December 2011 - 03:02 PM
#425
Posted 19 December 2011 - 06:49 PM
@Darren, hm... Are you sure the objects controlling the lights are always created? Are all the wizard objects' depths below the lighting system? Are you deleting the lights at any other time on accident?
#426
Posted 20 December 2011 - 08:18 PM
Yeah all of the obj_WizardLight objects are being created, I checked with an instance_number which it equals the amount of obj_Wizard. The obj_WizardLight are currently below the main light object that controls the lighting system (I did try changing the depth to above but it didn't seem to make any difference). The only time a light ever gets deleted is in the obj_WizardLight object.@Darren, hm... Are you sure the objects controlling the lights are always created? Are all the wizard objects' depths below the lighting system? Are you deleting the lights at any other time on accident?
Something I found quite interesting was that the ninja has a constant light of his own that's always on and doesn't get destroyed. When killing the obj_Wizard which in turn deletes it's light object the ninja's light only disappears if the Wizard's light was not working in the first place. If the Wizard's light was working and is killed then the ninja's light is unaffected. I've no idea why the two lights would be connected though since they have completely different names and objects.
I wonder if a problem is that all of the lights from the wizards have the same variable name. Would that cause issues somehow? I'm not sure how I would go about creating a unique variable for every wizard when it's created so I haven't tested it.
Oh and thanks for taking the time to help me out here, I really appreciate it.
#427
Posted 21 December 2011 - 07:19 PM
#428
Posted 29 December 2011 - 08:40 AM
#429
Posted 31 January 2012 - 09:35 AM
#430
Posted 03 April 2012 - 03:52 AM
Thanks again for an awesome lighting system!
#431
Posted 03 April 2012 - 04:47 PM
-light_refresh/redraw changed to lt_refresh/redraw
-Must now call lt_shadcreate() which returns ID
-ID must now be used for lt_shadbegin() (previously didn't take an argument)
-lt_shadobj() has more arguments and DOESN'T automatically make a mask for you
(This is fine though, you just use the same image as the sprite for the mask)
Taken out because it was slow and really buggy.
-lt_shadcircle() doesn't exist (I will likely add it in the future, however)
built-in images are gone for compatibility between versions. Images DO come included
in download.
-lt_sysset() some arguments are switched around
Is it worth it? Well, there aren't really any more features. Most of the changes were "under the hood." Certain things should be faster. Mostly complex objects, large rooms, stuff like that that you wouldn't immediately notice. Also there were a considerable amount of unchecked variables/limitations and things that were in 6.x that could lead to crashes or unexpected problems (usually after longer gameplay periods) that have been fixed.
So whether or not you should upgrade is up to you. I would say you may not really notice too huge of a difference right away, but what you will be working with will be a decent amount more stable and it gets the (very occasional) update for bug fixes and new features.
Edited by Scyler_27, 03 April 2012 - 04:53 PM.
#432
Posted 13 April 2012 - 11:13 PM
Thanks in advance.
#433
Posted 14 April 2012 - 12:35 AM
#434
Posted 18 May 2012 - 06:22 PM
#435
Posted 20 May 2012 - 07:56 PM
#436
Posted 22 May 2012 - 10:30 AM
#437
Posted 23 May 2012 - 01:27 AM
#438
Posted 26 May 2012 - 01:13 PM
Ohh I figured why, the object I made create before the room started which had a room size of 640x480 to avoid an error.@Krisando, That is extremely wierd. The lighting system isn't based around the view, it covers the entire level. It uses room_width and such so it is impossible for it to do that. Are you sure part of the view isn't going outside of the room? Since the lighting stops at the edge of the room, if you have the view go beyond it would give what you are seeing right now. I tried testing multiple things with views and room sizes just now and couldn't get the same problem as you. Mind making a quick example of how you got that problem and sending it to me? Would be greatly appreciated.
Also I get this error in the latest which didn't appear in previous versions___________________________________________
ERROR in
action number 2
of Step Event
for object o_bullet_1:
In extension function light_set_light:
Error in code at line 1:
var ID;ID=argument0;global.__lightx[ID]=argument1;glob
al.__lighty[ID]=argument2;global.__lightdiam[ID]=ar
gument3;global.__lighttype[ID]=argument4;var LIGHT;LIGHT=argument5;global.__lightangle[ID]=argu
ment6;if (LIGHT>=0&&LIGHT!=global.__lightshape_orig[ID]){
at position 235: Unknown variable __lightshape_orig or array index out of bounds
when i open it... a message pops up saying it cant find the extension lighting v.6.2... wut do i do... i copied the two things from the zip but now it doesnt work...
#439
Posted 26 May 2012 - 03:07 PM
extract the zip file then go into gamemaker and click on extension packages, then click instal and search for the *.gex you unzipped, then you have 2 ways of loading the extension,
Ohh I figured why, the object I made create before the room started which had a room size of 640x480 to avoid an error.@Krisando, That is extremely wierd. The lighting system isn't based around the view, it covers the entire level. It uses room_width and such so it is impossible for it to do that. Are you sure part of the view isn't going outside of the room? Since the lighting stops at the edge of the room, if you have the view go beyond it would give what you are seeing right now. I tried testing multiple things with views and room sizes just now and couldn't get the same problem as you. Mind making a quick example of how you got that problem and sending it to me? Would be greatly appreciated.
Also I get this error in the latest which didn't appear in previous versions___________________________________________
ERROR in
action number 2
of Step Event
for object o_bullet_1:
In extension function light_set_light:
Error in code at line 1:
var ID;ID=argument0;global.__lightx[ID]=argument1;glob
al.__lighty[ID]=argument2;global.__lightdiam[ID]=ar
gument3;global.__lighttype[ID]=argument4;var LIGHT;LIGHT=argument5;global.__lightangle[ID]=argu
ment6;if (LIGHT>=0&&LIGHT!=global.__lightshape_orig[ID]){
at position 235: Unknown variable __lightshape_orig or array index out of bounds
when i open it... a message pops up saying it cant find the extension lighting v.6.2... wut do i do... i copied the two things from the zip but now it doesnt work...
- close gamemaker and and open it again
- select the extesion package you just installed and click the arrow
#440
Posted 29 June 2012 - 03:55 PM
I'm not great at using game maker yet. I'm still learning. I'd like to be able to make some really good lighting effects for my game. I downloaded your file, but I get error messages when I try to run the example. Mind helping me out? Here are the error messages I got btw...Easy Lighting v7.0.2!
Easy, yet effective.
Wow, up to version 7! When I started this .gex, it was a mere side-project thrown together to solve the issue of the lack of good lighting engines. Now-a-days that isn't much of a problem anymore, but I hope that through 7 full version, 3 rewrites, and many updates later you will be impressed and satisfied by what this .gex has become! This .gex is a full-fledged lighting engine with over 20 functions that provides a simple way to add impressive lighting and shadows to your games. I strive to provide a high-quality .gex that acts and performs as if it were part of GM itself. I am always open for suggestions, opinions, and ideas on how to improve my work and make it better for you. After close to 3 years of working on this .gex, I present to you Easy Lighting v7.0! Let me introduce you to some of the features:
-23 easy to use functions.
-Very flexible.
-Customizable ambient lighting for different moods and times of day.
-5 Included light shapes for quicker production.
-Supports varied light shapes with no extra slowdown!
-Supports animated lights for unique effects.
-Rotate and color your lights easily!
-Lights "interact" with objects and other lights, making moving lights look that much more stunning!
-View support, have the lights limited to a specified view for faster rendering on big levels!
-Option for control of light's update and drawing system. Static lighting? Ok, just draw it once!
-Delete unwanted lights for speed boost.
-Built-in shadow system for amazing results!
-Each shadow point can have a different z value.
-Shadows can be animated and morphed in-game.
-Stack multiple shadows on objects for a more 3D effect.
-Much, so much more.
If that isn't enough to get you interested, check out these screenshots taken from the provided example: (version 7.0)
-
Lights aren't just placed on top of objects, they interact with and brighten them! Though, of course, there is the option to remove additive lighting for a more simplistic look.
Here is a quick summary of the functions:Lights can be turned on or off at will with lt_lightset/lt_lightset_on, along with the possibility to create flashing and blinking lights (among others) with ease!lt_sysset - Set's properties for the lighting system
lt_lightadd - Creates a new light and returns an id
lt_lightset - Adjusts settings for an existing light
lt_lightdelete- Delete's a light
lt_lightget_x - Get's x position of a light
lt_lightget_y - Get's y position of a light
lt_lightget_on - Returns if a light is on or off
lt_lightget_castsshadows - Returns if the light can cast shadows
lt_lightexists - Returns if a light exists
lt_lightcount - Returns the number of lights created
lt_lightset_x - Sets a light's x position
lt_lightset_y - Sets a light's y position
lt_lightset_on - Turns a light on/off
lt_lightset_castsshadows - Enables/Disables shadow casting for this light
lt_refresh - Manually updates lighting settings
lt_redraw - Manually draws lights onto screen
lt_shadcreate - Creates a new shadow shape
lt_shadbegin - Starts defining new shadow shape
lt_shadreset - Resets the points for a shadow so they can be re-defined
lt_shadpoint - Adds a point to the shadow
lt_shadend - Ends the shadow shape
lt_shadobj - Assigns an object with a specified shadow
lt_shadsetobj - Re-sets properties for an object and shadow
So why are you still reading and not downloading? It is a small file-size and well worth the download!
FILE:
(v7.0.2) Download 1.2mb .zip <- .gex should now work with GM7 and GM4MAC, but not the example.
(v6.2 old) Download 800kb .zip <- Download, Made for GM8.0. (NOT COMPATIBLE WITH GM7 BECAUSE OF RESOURCE LOADING DIFFERENCES)
If you guys could leave feedback and tell me what you think, that would be very much appreciated. Thanks.
As always, with all of my .gex files, no credit is ever required (though appreciated) and you can use this .gex in both free and commercial projects.
Note: If you decide to credit me, please use the name Thagen Pinch
Extra Credit:
- With version 6.x+ I took a few ideas from the LS3 lighting engine by Adventus.
Changes In v7 Rewrite:There are many internal changes and there may be some compatibility issues.
-You can now define multiple shadows at once. As a result, the process is slightly different.
-I removed the internal built-in lights for GM7 compatibility. I provided 5 shapes in the file, however, as a substitute.
-Much greater optimization for large areas, providing bigger speed boosts when objects/lights are out of view.
-Added many quick return functions for ease of use.
-Fixed many invisible internal remnants that could cause crashes/slowdown over long play times.
-Added returns to almost every function.
-Added a few more personal error messages, more to come, for when the user does something wrong (Rather than a confusing GM message).
-Completely re-wrote the example, making it easier to understand and more step-by-step.
-Wrote a quick function list (html file) that provides a brief rundown of every function.
-Fixed many minor bugs, such as black screen when no lights exist, among others.
-Made everything more efficient and easy to access so 1) Faster results for you, 2) Easier for me to modify.
-Source code is not provided with v7, nor will it ever be.
"___________________________________________
COMPILATION ERROR in Script: level_shadows_scr
Error in code at line 3:
shad_shape[0]=lt_shadcreate();
^
at position 16: Unknown function or script: lt_shadcreate"
Either that or "cannot find extension package easy lighting 7.0.2"
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











