Daimonin MMORPG Logo
Daimonin voting system

Recent Posts

[Graphics] Artemis Artwork by smacky
October 24, 2014, 10:59:02 pm
[Community chat] internet messed up by Shroud
October 24, 2014, 05:09:43 pm
[Tech support] cant access main server by VMP-KNIGHT
October 23, 2014, 01:06:40 am
[Community chat] moving the servers by michtoen
October 23, 2014, 12:56:30 am
[Spoilers] GT keys by VMP-KNIGHT
October 21, 2014, 02:27:11 am
[Community chat] Infravision by Shroud
October 20, 2014, 11:23:47 pm
[Community chat] +4 etc on items by VMP-KNIGHT
October 19, 2014, 09:46:16 pm
[Events] hallo maps by Shroud
October 19, 2014, 01:27:20 am

Daimonin Forums

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



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