Night

Night

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Night

Post by Evil4Zerggin »

Night

This widget filters the world to look like it is nighttime, and gives most units searchlights. Somewhat performance-intensive due to my lack of GL-fu.

Download from caspring at the bottom of the page here.

Image

Versions

1.5.4
  • Tweaked searchlight upwards. Hopefully this is the end of the crotch light problem.
  • Fixed bug where extra upward-pointing cones would appear for units going down slopes.
1.5.3
  • "/luaui night_simplebase" replaced with "/luaui night_basetype [0-2]", with 0 = no base, 1 = simple base, 2 = full base (default)
1.5.2
  • I hereby release this widget under the GNU LGPL, version 2.1 or later.
1.5.0
  • Now uses color map with sunrise, sunset.
1.4.1
  • Made searchlights stronger, not all turn on/off at the same time.
  • Made days longer.
1.4.0
  • Added day/night cycle; "/luaui night_cycle" to stop.
  • Darkened default night color.
1.3.1
  • First forum release.
Commands
  • "/luaui night_preunit" to toggle whether the filtering is done before or after units and projectiles are drawn. Unfortunately, I don't know of a way to do it after units but before projectiles.
  • "/luaui night_basetype" to set the base type.
  • "/luaui night_beam" to toggle the searchlight beam.
  • "/luaui night_setsearchlight [number]" to set the strength of the searchlight, typically 0-1, or <= 0 to turn the searchlight off.
  • "/luaui night_cycle" to start/stop the day/night cycle.
Last edited by Evil4Zerggin on 29 Sep 2008, 04:22, edited 8 times in total.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Night

Post by BaNa »

OMFG man you f*cking rule the world. You sir deserve a happy ending with everything you order.
User avatar
Cremuss
Posts: 364
Joined: 28 Oct 2006, 21:38

Re: Night

Post by Cremuss »

lol ! amazing !

It could be interseting to have a game where it switch from day to night every XX minutes. Enemy units will be harder to localize by radars, artillery will have less accuracy etc.. :-)
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Night

Post by Evil4Zerggin »

Any gameplay element will have to be done by the modmaker. However, I just implemented a visual day/night cycle.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Night

Post by Argh »

Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?

This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Night

Post by REVENGE »

Argh wrote:Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?

This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
Heh, should be easy to incorporate right? Just put in the call and have it be incremented to change gradually with the cycle code (FSCKING WIN). Now, if only we had the ability to change the skybox. :P (Or can we draw it using lua? Hm...)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Night

Post by smoth »

very nice.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Night

Post by rattle »

Reminds me of Tiberian Sun
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Night

Post by FLOZi »

Very cool. I was hoping someone would write a nighttime shader, which would probably be a better way of doing it.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Night

Post by Evil4Zerggin »

I might write a shader once I learn how.
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: Night

Post by Tribulexrenamed »

Evil4Zerggin wrote:I might write a shader once I learn how.
rofl so would we all
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Night

Post by aegis »

o_O
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Night

Post by Forboding Angel »

Any chance you could make the sun move around?
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Night

Post by Evil4Zerggin »

Unfortunately, it appear there is a gl.GetSun but not a gl.SetSun. I'll experiment with gl.Light when I get a chance, although I'm not entirely sure what it does.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Night

Post by CarRepairer »

I absolutely love this widget. A bit of brainstorm and it could definitely go into CA's rules as a modoption that modifies gameplay like less LoS and accuracy at night.
Argh wrote:Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?

This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
Zerggin included several commands that allow you to change the behavior. /luaui night_preunit makes the colormap apply to units too so they look dark as well and it's awesome. Unfortunately it also causes lasers and explosions to get darker but it's still the best way to play in my opinion. I suggest you make a screenie with preunit darkening on, looks more more like night. Good work zerg!
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: Night

Post by Masure »

Nice work but this really should be made in the engine code.

Just like bloom...
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: Night

Post by Tribulexrenamed »

I have this widget on permanently. I love it. :)
User avatar
smartie
NOTA Developer
Posts: 146
Joined: 23 Jun 2005, 19:29

Re: Night

Post by smartie »

:-) Love the widget
User avatar
smartie
NOTA Developer
Posts: 146
Joined: 23 Jun 2005, 19:29

Re: Night

Post by smartie »

A couple of ideas

aa defenses should have the search light point upwards
(mainly flak, it probably wouldn't look as good for missile towers)

for defenses, the spotlight should focus on the unit that it is shooting at

This should really be programmed into the engine so that the sun position can be set, and the color of the map lighting could be changed that way. Then you could have the sun moving, and the shadows getting longer and everything. It looks good now, but it could look even better.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Night

Post by Evil4Zerggin »

Unfortunately AFAIK there is no way of reading a unit/weapon's current target.

But yeah, like the bloom shader, it's pretty much a case of doing as much as possible without real engine support.
Post Reply

Return to “Lua Scripts”