Daimonin MMORPG Logo
Daimonin voting system

Recent Posts

[Community chat] moving the servers by smacky
September 30, 2014, 09:22:31 pm
[Community chat] Is this game dying? by smacky
September 27, 2014, 06:44:59 pm
[Community chat] Last one to post wins! by Shroud
September 25, 2014, 09:16:36 pm
[Daimonin project] v0.10.7 development by smacky
September 24, 2014, 02:21:26 pm
[Suggestions] Guild Revamp Discussion by Shroud
September 19, 2014, 06:05:45 pm
[Daimonin project] Combat balancing by Shroud
September 15, 2014, 01:44:52 pm
[Bug discussion] v0.10.6 Bugs by Shroud
September 12, 2014, 06:47:52 pm
[Suggestions] Third Hand Belt by petarkiller
September 11, 2014, 07:18:54 pm

Daimonin Forums

 
Pages: [1]   Go Down
  Print  
Author Topic: Lua methods: object:GetPersonalLight() and object:SetPersonalLight()  (Read 1942 times)
smacky
The Singular Soul of Lom Lobon Tribe
*
*
*
*
*
*
*



Posts: 8643
Karma: +275/-134


View Profile
« on: May 08, 2009, 04:34:00 pm »

Personal light is what used to be called DM light. It means to a particular player the map looks as if it has a different ambient light setting than it actually does.

Eg, with personal light 7 the darkest mugwump burrow appears brightly lit and with personal light 1 the brightest Summer's day in Stonehaven appears more shadowy than a troll's armpit.

Of course the actual light levels are unaffected, so setting personal light to 1 and expecting Thrakir to spawn 24 hours a day won't work.

The idea is that scripts can fiddle with a given player's personal light for special effects affecting that player only, not the entire map for instance.

Code: [Select]
/*****************************************************************************/
/* Name   : GameObject_GetPersonalLight                                      */
/* Lua    : object:GetPersonalLight()                                        */
/* Info   : Only works for player objects. Other types generate an error.    */
/*          The function takes no arguments.                                 */
/*          The return is the object's personal light value (0 means off).   */
/* Status : Untested/Stable                                                  */
/*****************************************************************************/

/*****************************************************************************/
/* Name   : GameObject_SetPersonalLight                                      */
/* Lua    : object:SetPersonalLight(mode)                                    */
/* Info   : Only works for player objects. Other types generate an error.    */
/*          The mandatory argument is the personal light value to set (this  */
/*          will be normalised to the range 0 <= value <= MAX_DARKNESS).     */
/*          value of 0 means turn it off.                                    */
/*          The return is the new personal light setting.                    */
/* Status : Untested/Stable                                                  */
/*****************************************************************************/

There are also three game constants for use with these methods: PERSONAL_LIGHT_OFF, PERSONAL_LIGHT_MIN, and PERSONAL_LIGHT_MAX.
Pages: [1]   Go Up
 
 

Powered by SMF 2.0 RC1-1 | SMF © 2006–2008, Simple Machines LLC
Page created in 0.087 seconds with 21 queries.
Checkout