Daimonin MMORPG Logo
Daimonin voting system

Recent Posts

[Daimonin project] v0.10.7 development by Shroud
April 17, 2014, 06:08:33 pm
[Scripts] Attack Register by smacky
April 17, 2014, 10:03:42 am
[Dev Server] MOVED: Rewritten pick up/drop code by smacky
April 15, 2014, 03:14:20 pm
[Community chat] Clobber's Garden by Shroud
April 14, 2014, 07:32:21 pm
[Community chat] Last one to post wins! by Shroud
April 13, 2014, 08:13:28 pm
[Bug discussion] v0.10.6 Bugs by smacky
April 13, 2014, 08:05:27 pm
[Arches] Joes archs by Shroud
April 07, 2014, 05:19:31 pm
[Bug discussion] Lost Skills/Levels by smacky
April 04, 2014, 04:04:54 pm

Daimonin Forums

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



Posts: 8525
Karma: +272/-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.091 seconds with 21 queries.
Checkout