Files

> > CS2D > Lua Scripts > Gajos | Day-Night Cycle v1.1
Files overviewCS2D overviewLua Scripts overview

English Gajos | Day-Night Cycle v1.1 >

2 comments728 b, 343 Downloads

old Gajos | Day-Night Cycle v1.1

Gaios
Reviewer Off Offline

Author: user Gaios
Version: 1.1

Description
This script adds a day and night cycle to the game and forces players to use lighting engine. Also the night isn't "too dark" like normally by default is.

Config
dayDuration
- Length of the day in seconds
dayRange
- Array[0] start and Array[1] end of the day in 360 degrees
nightRange
- Array[0] start and Array[1] end of the night in 360 degrees

off-topic Warning
dayRange
and
nightRange
must fit together the 360 degrees and can't be lower than 1. Also the lower values night has, the shorter it will be.

API
DAY_NIGHT_CYCLE.setTime(time)
- Sets current time in 360 degrees and returns mapped time for cs2d cmd sv_daylighttime
DAY_NIGHT_CYCLE.isNight()
- Returns
true
if the current cycle is night
DAY_NIGHT_CYCLE.isDay()
- Returns
true
if the current cycle is day

Installation
Put the script inside sys/lua/autorun directory.

1.1 >

IMG:https://i.imgur.com/0M8Zkk3.png

> GNU General Public License
edited 10×, last 09.03.23 10:39:00 am
Approved by DC

Download Download

728 b, 343 Downloads

Comments

2 comments
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Xirot
User Off Offline

I like
I like it!

old

Marcell
Super User Off Offline

Thanks god, that Gajos does exists. He was born to create awesome things like this.
I like it!
To the start Previous 1 Next To the start