Daimonin MMORPG Logo
Daimonin voting system

Recent Posts

[Arches] Joes archs by joeshmo
August 21, 2014, 09:13:04 pm
[Daimonin project] Combat balancing by Shroud
August 21, 2014, 05:25:30 pm
[Daimonin project] v0.10.7 development by smacky
August 18, 2014, 03:42:17 pm
[Spoilers] Shroud's Guide to Special Drops by petarkiller
August 15, 2014, 12:35:05 pm
[Bug discussion] Lost Skills/Levels by smacky
August 13, 2014, 02:48:13 pm
[Community chat] Name the new rare ring for priest by Reviver
August 12, 2014, 11:37:57 pm
[Bug discussion] Magic Container Bug by smacky
August 12, 2014, 02:11:25 pm
[Daimonin project] Widget "controls" by smacky
August 12, 2014, 11:50:50 am

Daimonin Forums

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



Posts: 8619
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.202 seconds with 21 queries.
Checkout