Scripts / Ambient Light controled by .lua script fast and easily.

Author
Message
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 2nd May 2017 05:40 Edited at: 6th May 2017 23:45
Hi guys ,
I'm sure this is already an easy thing to do for MOST of you old
pros in here , but , for many of us , a lot of the , even very basic things
can appear complex ........so...I came up with a little .lua script that only needs to use
a simple trigger to be placed anywhere in the map that you'd like the AMBIENT LIGHT LEVEL
to change....such as going from an outside location and entering a building or a cave .
This greatly decreases the need to use a number of DYNAMIC LIGHTS in order to achieve
a specific ambient feel.
Now you can take the basic code and just change the name of it as per the lua rules and you can make
any number of light levels to use as you like where you like...as there is ONLY ....ONE......number that has to be changed.
I'm not going to go in to great detail on how the code works as it is EXTREMELY COMPLEX in nature ,as it is 8 lines long.
( P.S.-----SARCASM ! )

Check out the video here of 8 basic ambient light level changes.
and I will attach the code below....IF it can be useful to anyone else..it's YOURS...IF your a genius already and DON'T need it
no need to come on and tell me and be a critic.

https://www.youtube.com/watch?v=x3wbdfSl-Fo&feature=youtu.be



SCRIPT STARS HERE...
..............................................................................................
-- LUA Script - precede every function and global member with lowercase name of script + '_main'



............................................




thx

UNIRD12B
Let\'s actually make something happen with this one !

Attachments

Login to view attachments
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 2nd May 2017 17:18
Thank you for this! Very useful
PM
Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 3rd May 2017 00:13
Quote: "IF your a genius already and DON'T need it
no need to come on and tell me and be a critic.
"


If anybody does that, they should be flamed right over the edge of the forum. Thanks for this! One more item in my bag of tricks!
Desktop: i7 4770@3.4Ghz (passmark 9809), 12GB RAM, Win 10/64, GeForce GTX 1080 (passmark 12006), 1TB SSD, 1TB HDD; Laptop: i7 4800MQ@2.7Ghz, 16GB RAM, Win 10/64, GeForce GTX870M , 1TB SSD.
PM
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 00:35
Hey
Pink Panther and Jerry Tremble,,,,
so glad it could have an even limited use to anyone at all.
For me , made it a lot easier to emulate ...day to night...or...night to day ...light level changes
or inside to outside light level changes where ever I wanted them in a map without tons of dynamic lights
being used.

ON we go.........................

UNIRD12B
Let\'s actually make something happen with this one !
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 3rd May 2017 10:33
very nice, thanks
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd May 2017 11:03
Hmn, i wonder if you could use the weapon name function _main(e,name) etc. so that you could name it the number you want it to be instead of having to edit it and have multiple versions.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 14:53
Hi Belidos ,
thanks for the idea.
Did you try adding that to the code and seeing if it would work.
I wouldn't have a clue on how or where to add it and you seem to have
some understanding of how it might work. Would that make it chooseable
in the Properties page , where you would just add the number you wanted
in the box and away you go ?
I'll see if i can figure it out..but...if you have an idea on it , it would
be more than welcome.

Thx again to all.

UNIRD12B

Let\'s actually make something happen with this one !
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 15:01
BTW ,
whatever MOD took the time to correctly allow my videos and code snippet
to show in here properly...THANK YOU also.
If you direct me to a page in here with instructions on how to do those things
I'd much appreciate that too. I did try to find one.

UNIRD12B

Let\'s actually make something happen with this one !
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd May 2017 15:17 Edited at: 3rd May 2017 15:18
Quote: "id you try adding that to the code and seeing if it would work."


Not yet i'm at work, it as just an idea that popped up while reading the thread, i'm not sure how to do it either.

For youtube videos just put the youtube URL's number/letter identifier (the 11 or so digits after v= in the youtube address, in the case of the video you post it would be x3wbdfSl-Fo) into the editor, then left drag to highlight it, click the video button up above, and select youtube, what you get should look like:



to enter code just paste the code in the editor, left click and highlight it all, then click the code button up top, it should look like......


Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 15:24
NOW THAT was a great explanation Belidos,
for the videos and code snippet entries !

thanks a lot.

UNIRD12B
Let\'s actually make something happen with this one !
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 15:53 Edited at: 3rd May 2017 15:55
Ok , here is a short video ,
showing the Ambient Light Level change automatically
using just simple triggerzones and the lightzone??.lua.
2 different ones = 64 to 16 to 64



P.S. Thanks to Belidos' help , I was able to get the video to work...FIRST SHOT ! WOO HOO !

UNIRD12B
Let\'s actually make something happen with this one !
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd May 2017 20:38
Quote: "Hmn, i wonder if you could use the weapon name function _main(e,name) etc. so that you could name it the number you want it to be instead of having to edit it and have multiple versions."

sure, here you go


p.s for any1 interested in playing with the scene settings there's a script called darkzone.lua which has the commands in it which is slightly easier than scrolling through the global.lua to see what you can or can't change.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 3rd May 2017 20:55
That is brilliant ! Thanks for sharing
PM
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd May 2017 21:09 Edited at: 3rd May 2017 21:11
wow THANK you again
smallg for adding in a way to make the code even easier
and more versatile to use...(as always )and to Belidos for the suggested
addition.
I used that second snippet you added in there( darkzone.lua) as the base for my simplistic one
and will now use your excellent addition to mine to make more versatile
ones for all the other functions separately.

THANKS AS ALWAYS TO EVERYONE THAT CHIPS IN SO WELL AND SO WILLINGLY

UNIRD12B
Let\'s actually make something happen with this one !
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 4th May 2017 01:23 Edited at: 4th May 2017 16:06
ok now Thx to Belidos suggestion about adding some code
and smallg's coding skills , I took the liberty
of making some small changes in the .lua file naming for clarities sake.
So now it should better reflect its overall function.
I also added in some instructions so it can be easily implemented by just about anyone.






let me know if it works ok or needs further adjustments,

UNIRD12B
Let\'s actually make something happen with this one !

Attachments

Login to view attachments
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 4th May 2017 09:29
Can you fade the lights in instead of a snap change of colour,is that possible.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
UNIRD12B
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 4th May 2017 15:31
Hi granada ,
I'm sure it COULD be done using one of 2 methods.

( 1 ) placing a number of triggerzones and using the lightzoneambient.lua along a path with relatively close
values either ascending or descending in order to achieve the final level desired at any specific part of the map.

or

( 2 ) adding in 3 further functions to the .lua file
- 1 - to make a comparison between the present ambient light level and the new , desired one.
and
- 2 - a second function to act as a timer to make the changes ,either up or down , in a smooth
and less apparent manner.
and
- 3 - a further function to implement the change in ambient level to the new desired range.

That having been said..." I sure as Hades can't do it. " But if someone else can..it would be a wonderful idea.

in the meantime this .lua file at least gives us a bit more flexibility than we had , when it comes to ambient light control.

Thx to all again for BOTH the new ideas and the Help so far with this.

UNIRD12B
Let\'s actually make something happen with this one !
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Jan 2019 18:43
Here you go, simple but effective.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 18th Jan 2019 20:42
Hey guys! That's radical. Nice work everyone!

Hey, could I ask anyone if they know how to get the forum avatar (little profile pic) set? Please, details for the old man...
PM

Login to post a reply

Server time is: 2024-04-23 10:02:37
Your offset time is: 2024-04-23 10:02:37