Jump to content


Photo

Easy Lighting V7.0.2 | Last Updated: 06/07/11


  • Please log in to reply
465 replies to this topic

#121 LoserHands

LoserHands

    GMC Member

  • New Member
  • 17 posts

Posted 24 January 2009 - 07:40 PM

How do you set a light's depth? So it doesn't go over a wall, not asking for a shadow system, just that I can give the illusion that there is one in the game.

Edited by LoserHands, 24 January 2009 - 07:43 PM.

  • 0

#122 ccloud1833

ccloud1833

    GMC Member

  • New Member
  • 34 posts

Posted 24 January 2009 - 10:47 PM

Great job very professional.
  • 0

#123 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 24 January 2009 - 11:53 PM

Thanks for all the great comments and compliments guys. :D

@Galious, Hm... that is an odd problem that I haven't ever come across. Though, if it is working properly on other computers I would have too assume it is your computer. Though, would you mind sending me the editable so I can look through it and see how you are using the lighting functions? (I have seen a few people's where they are using them completely incorrectly which lead to some really wacky results)

@bocochoco, sorta like an alpha check to see how dark/light it is at a point? I tried adding a function like that earlier, and sadly enough I could only come up with one way to do it, but it was an EXTREMELY slow function and could only be called in the create/alarm/etc. events. So I dropped it.

@LoserHands, there is currently no way to change the lighting's depth. It is either drawn at -10,000 or -100,000 depth. Though many people seem to be requesting that I add depth, so perhaps I will add that to the next updated. Though, there will only be able to be one depth for the entire lighting system, not a separate depth for each individual light.
  • 0

#124 Galious

Galious

    GMC Member

  • New Member
  • 8 posts

Posted 25 January 2009 - 12:55 PM

@Galious, Hm... that is an odd problem that I haven't ever come across. Though, if it is working properly on other computers I would have too assume it is your computer. Though, would you mind sending me the editable so I can look through it and see how you are using the lighting functions? (I have seen a few people's where they are using them completely incorrectly which lead to some really wacky results)


I found the problem! You DO NOT have to put the option "Treat the initialized variables as 0" on in the ERRORS general options, because it messes everything up.

By the way, how would you make rotating lights? I see those on the second example but can't think of how to do it.
  • 0

#125 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 26 January 2009 - 12:48 AM

Odd, it doesn't effect it at all for me if that function is checked or not. (And I can't think of why it would) But as long as it is working right... huh.

As for rotating lights, when you use the function light_add_light() it returns the ID number of the light created. You can later change the lights properties by using it's ID number and the function light_set_light(). The argument angle changed the angle the light is facing. (0 is facing to the right) so if you change that value it will rotate the light. (You could have a constantly increasing variable and set the angle to that)
  • 0

#126 Galious

Galious

    GMC Member

  • New Member
  • 8 posts

Posted 27 January 2009 - 10:02 PM

Odd, it doesn't effect it at all for me if that function is checked or not. (And I can't think of why it would) But as long as it is working right... huh.

As for rotating lights, when you use the function light_add_light() it returns the ID number of the light created. You can later change the lights properties by using it's ID number and the function light_set_light(). The argument angle changed the angle the light is facing. (0 is facing to the right) so if you change that value it will rotate the light. (You could have a constantly increasing variable and set the angle to that)


Duh... it happened again. You were right, it has nothing to do with that setting. I do not know what did I do to repair it the last time. It's bugging me a lot...

Could it be something related to graphic acceleration?
  • 0

#127 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 28 January 2009 - 06:51 AM

Hm... Tell me, does it do this with the included example? Also, what if you created a .gmk and only had one object and one simple light, does it still do it?
You could try removing lights, functions, and such (Testing after every change) to see if it is a specific command that is causing the problem. It really looks like something is going wrong with the alpha and blend functions. As if it was not setting alphas and removing the whole sprite shape, then using the oposite blend mode...
  • 0

#128 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 31 January 2009 - 07:52 AM

@Galious, Hm... that is an odd problem that I haven't ever come across. Though, if it is working properly on other computers I would have too assume it is your computer. Though, would you mind sending me the editable so I can look through it and see how you are using the lighting functions? (I have seen a few people's where they are using them completely incorrectly which lead to some really wacky results)


I found the problem! You DO NOT have to put the option "Treat the initialized variables as 0" on in the ERRORS general options, because it messes everything up.

By the way, how would you make rotating lights? I see those on the second example but can't think of how to do it.

Does on some pcs.
Will try 4.0 :lol:

Edited by Krisando, 31 January 2009 - 07:52 AM.

  • 0

#129 thejonjon

thejonjon

    GMC Member

  • New Member
  • 94 posts

Posted 01 February 2009 - 05:22 AM

Looks amazing, and the replies your getting show me that its as good as the pics. Will try.
  • 0

#130 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 01 February 2009 - 11:11 AM

i get a weird error

for new__object93 or something: draw event:
trying to use non-existing surface...

i copied and pasted your codes into my game and yes the gex is installed too...

if u want my gmk file i could send it too ur PM...
  • 0

#131 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 01 February 2009 - 08:02 PM

This is so odd, multiple people have contacted me of problems with the surface. I can't understand why it wouldn't create the surface! I am looking into it, but recently my computer went down so I can't work on anything till it is fixed. I will see if I can get it up and running, then I will fix the .gex.
  • 0

#132 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 02 February 2009 - 03:54 AM

i get a weird error

for new__object93 or something: draw event:
trying to use non-existing surface...

i copied and pasted your codes into my game and yes the gex is installed too...

if u want my gmk file i could send it too ur PM...

Same error my friend got which was fixed in the newest version, need the surface name so we can go if surface_exists =/
  • 0

#133 Hello Darren

Hello Darren

    Pirate

  • Banned Users
  • 275 posts
  • Version:Unknown

Posted 07 February 2009 - 10:00 PM

I will definitely be using this when I start my next game. Awesome job dude!

#134 Gamer-Alex

Gamer-Alex

    GMC Member

  • New Member
  • 135 posts

Posted 11 February 2009 - 04:32 PM

I can't even run the game, it says there isn't a library file and nothing will work because of it.
  • 0

#135 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 12 February 2009 - 06:55 AM

That is because you need to install the .gex file... seriously people, if you don't know how to install .gex's then don't even view this part of the forum. :lol:

To learn to install .gex files, check out this sticky topic.

For the rest of you, sorry, I haven't had time to work on the .gex (including fixing that strange error) because I have been having computer troubles recently. The hard-drives have been wigging out on me and I finally got this computer back up and working. Now! To get my rear in gear and get this problem fixed! :P

Ok, small update guys! Version 4.1 is now avaliable! What is different:

-I attempted to fix the bug so that instead of giving an error when the surface isn't created, then it simply turns them off permanently. This shouldn't be a big problem because there is no reason why the surface wouldn't be created unless it was something with the computer.
-I added a simple function, light_object_set_on(id,true), which I think you guys will appreciate. You can set a specific object to be effected by lights or not! In the example, click on a square for it to be enabled/disabled.
-I removed the light_set_effect() function, I hated that function. Well actually it is still there (but hidden because I wish it never existed) so if you want to use it you can, but don't expect help with it.

Edited by KC LC, 13 February 2009 - 07:35 AM.

  • 0

#136 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 17 February 2009 - 02:07 AM

___________________________________________
In extension function light_end:
Error in code at line 1:
   surface_free(global.__light_draw_surface);global.__light_drawon=false;global.__lighting
_current=0;global.__lightsdeleted=0;global.__light
f
lashchance=2;global.__lightblinktime=30;global.__l
i
ghtflickerchance=2;if (sprite_exists(global.__light_circle))sprite_delete(global.__light_circle);if (sprite_exists(global.__light_horz))sprite_delete(global.__light_horz);if (sprite_exists(global.__light_vert))sprite_delete(global.__light_vert);global.__lightingusingcolor=false;global.__li
ghtingiscurrentlyon=false;if (instance_number(global.__lightintobj)>0){with (global.__lightintobj)instance_destroy();}if (object_exists(global.__lightintobj))object_delete(global.__lightintobj);

at position 21: Unknown variable __light_draw_surface

Got this when closing down the game.. v4.1

edit: issue solved. forgot to add a light :(

Edited by bocochoco, 17 February 2009 - 02:41 AM.

  • 0

#137 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 18 February 2009 - 05:24 PM

somehow my game just wont listen to the light commands...
when i made a new game (just to see if it works)

the light works correct.. but in my topdown shooting game the lights wont even work...-.-
its not using any surfaces or 3d .. just plain 2d... so i dont know why...
guess i have to start over the shooter...
anyway.. nice gex mate
  • 0

#138 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 19 February 2009 - 04:47 AM

Is the surround lighting even showing up? If not, then you probably didn't call the function to turn the lighting on. (it is off by default) Use light_main_set() to do so. Also, you have to turn the lights on when you create them, so if you don't specifically tell it to do so (light_set_on()) then the screen will be a solid color or gradient depending on the surround lighting. If that doesn't fix it, mind if you give me an example? (Editable, or perhaps your scripts?)
  • 0

#139 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 19 February 2009 - 03:48 PM

thanks i will give it another try.. ill edit later or post later ^_^
  • 0

#140 Scyler_27

Scyler_27

    -Insane Kid-

  • GMC Member
  • 2755 posts
  • Version:GM:Studio

Posted 21 February 2009 - 06:36 AM

Any luck, frog? No reply yet. :P

Anyone else still interested in this? :D I am thinking about stopping working on this .gex because it seems pretty complete, so if you have any ideas that you want implemented speak up now while I am still interested! :D
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users