The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Daytime and lightlevel question
Author Message
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Daytime and lightlevel question
Hi Smile

I'm working (hell, thousands of bugs!) on an old italian shard and I've found a strange custom script. It does a lot of stuff about local time and lightlevel and I would like to remove it.

So the question is: How the daytime and the lightlevel works on sphere .56b?
I mean, I think that a day inside the shard (without this custom script) isn't long like a real day. And what about the lightlevel of LOCAL, REGION, and SECTOR? How it changes?

Can someone explain or link some docs?

Thank you!
06-15-2012 06:52 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Daytime and lightlevel question
Sector are the ones that manages light level,and players have a Light field which you can use to override sector's light level.
06-16-2012 02:09 AM
Find all posts by this user Like Post Quote this message in a reply
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Daytime and lightlevel question
Ok, but how the daily light works? Every how much time it changes? How many "real" minutes is long a "virtual" day?

I would like to understand this mechanism, how Sphere is trying to replicate the "revolution movement" of our world? Ok, not the details, I would like to know the effects.
For example, when Vesper is in light, in other distant sectors is night, how can we know where? And how can we know how much time is left to see the night in Vesper?
06-16-2012 06:25 PM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #4
RE: Daytime and lightlevel question
At sphere.ini you have this lines:

Code:
DungeonLight=27

// Day light level 0-30
LightDay=0

// Night light level 0-30
LightNight=25
Here you can set the light level of day, night and dungeons.

Later you have the next line:

PHP Code:
// Length of the game world minute in real world in seconds
GameMinuteLength=60 

With this you have 1 real minute for 1 world minute. If you set this quantity to 15 (for example), you have 4 world minutes for 1 real minute, 4 world hours, for 1 real hour, 4 world days for 1 real day, etc...

As far I know, the revolution movement of the world is the same for all the map. The map it´s only a small continent of the world, so it´s the same time at Yew, or Vesper o Moonglow. There is no day in one corner of the map, and night on the other.
If it´s night, it´s night at the whole map.
06-17-2012 07:20 AM
Find all posts by this user Like Post Quote this message in a reply
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: Daytime and lightlevel question
Ok thanks! GameMinuteLength will be very useful.

Hmm so the "revolution" effect is done by this damn custom script... argh!

I think that create one item for every sector (6144 every x minutes) is not a good idea, right? This is why I would like to remove this script. I will try to do the same things without create items Smile
06-19-2012 07:28 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #6
RE: Daytime and lightlevel question
It is easier than you think, from Spherewiki:

Quote:Information for Advanced Scripters

There is a way to refer to all of the sectors within a region. It works a little like ALLCLIENTS, in that it will run a function on all sectors. This is a good way to change the season for an entire region. If a region is contained within another (i.e. Britain contained within Britain Territory), it will be affected if you use this command on the surrounding region.

REGION.SECTORS

For example:

REGION.SECTORS SEASON 3

This will set all sectors in the region to the "winter" season. Keep in mind that sectors can "overlap" regions, meaning that you may get some winter in other surrounding regions as well.

You can change all sectors from a region with this command, if you have a region who cover the whole world, you can change them all when you want.
06-19-2012 05:59 PM
Find all posts by this user Like Post Quote this message in a reply
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #7
RE: Daytime and lightlevel question
Very nice! So I've only to decide the "meridians" regions if I don't want the same light level for all sectors over the world.

Or there is a method to do something like:
REGION.SECTORS LIGHT <value_not_constant_for_all_sectors>
?
06-19-2012 07:50 PM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #8
RE: Daytime and lightlevel question
You can use: REGION.SECTORS LIGHT <value_not_constant_for_all_sectors>

But somehow you have to specify what sector you want to change, and what sectors not. You can put a tag to every sector you want change, or specify meridians with regions.

I think is better and faster the second option.
06-19-2012 09:53 PM
Find all posts by this user Like Post Quote this message in a reply
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #9
RE: Daytime and lightlevel question
Yes, I like the "meridians regions" solution, it's simpler Smile

So, thank you very much!
06-19-2012 11:58 PM
Find all posts by this user Like Post Quote this message in a reply
Khizag
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #10
RE: Daytime and lightlevel question
Hmm... I'm here again...

So, I've defined my region:
Code:
[AREADEF a_lightband_5]
NAME=lightband5
GROUP=Lightbands
P=4590,100,5,0
RECT=4081,0,5120,4096,0

And a function that should bring the night all over this region

Code:
[FUNCTION f_world_light_update]
SERV.AREA.a_lightband_5.SECTORS LIGHT 25

But when I try to use this test item:
Code:
[ITEMDEF i_light_update]
ID=i_crystal_ball
TYPE=t_normal
NAME=Light update

ON=@Dclick
    f_world_light_update
        SRC.GO <SERV.AREA.a_lightband_5.P>
    SRC.SAY DEBUG: <SERV.AREA.a_lightband_5.P>
    RETURN 1

The light remains the same. The PG goes at the right position and says "DEBUG: 4590,100,5" but but no light changes... where is the problem?

Ah, and there aren't errors in the log.
(This post was last modified: 06-22-2012 08:13 AM by Khizag.)
06-22-2012 08:10 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)