VP EVENT WORLD SETTING: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
(Created page with "{{sdk event page|world_setting|Received for each setting of a world upon connecting to it. |attributes= {{sdk attribute row|string|WORLD_SETTING_KEY |Setting key}} {{sdk ...")
 
No edit summary
Line 1: Line 1:
{{sdk event page|world_setting|Received for each setting of a world upon connecting to it.
{{sdk event page|world_setting|Received for each setting of a world upon connecting to it.
|attributes=
|attributes=
   {{sdk attribute row|string|WORLD_SETTING_KEY  |Setting key}}
   {{sdk attribute row|string|world_setting_key  |Setting key}}
   {{sdk attribute row|string|WORLD_SETTING_VALUE|Setting value}}
   {{sdk attribute row|string|world_setting_value |Setting value}}
|behavior=
|behavior=
* When all settings have been sent, {{sdk event|WORLD_SETTINGS_CHANGED}} is fired
* When all settings have been sent, {{sdk event|WORLD_SETTINGS_CHANGED}} is fired
* List of keys:
{{sdk world setting table|
{{sdk world setting row|int|allow_debug_menu|0 or 1|Used to enable/disable the debug menu.}}
{{sdk world setting row|int|avatar<NUMBER>|n/a|Not used anymore.}}
{{sdk world setting row|string|avatars_file||Name of file containing avatar configuration.}}
{{sdk world setting row|float|farplane||???}}
{{sdk world setting row|float|fog_begin||Distance at which fog should begin.}}
{{sdk world setting row|float|fog_color|rrggbb|Color of the fog (rr, gg and bb are each a hexadecimal number between 00 and ff).}}
{{sdk world setting row|float|fog_density||Density of fog.}}
{{sdk world setting row|float|fog_end||Distance at which fog should be end.}}
{{sdk world setting row|string|fog_mode|"linear", ...|Fog mode.}}
{{sdk world setting row|int|fov|Field of view angle.}}
{{sdk world setting row|string|ground||Ground object.}}
{{sdk world setting row|int|groundrepeats|0 or 1|Ground object is tiled.}}
{{sdk world setting row|float|nearplane||???}}
{{sdk world setting row|string|objectpath||Base url for object path.}}
{{sdk world setting row|string|objectpassword||Password used to encrypt zip files in object path.}}
{{sdk world setting row|int|override_visibility|0 or 1|???}}
{{sdk world setting row|string|skybox||Base name of skybox textures.}}
{{sdk world setting row|int|skybox_swaplr|0 or 1|Swap the left and right texture of the skybox.}}
{{sdk world setting row|string|skybox_extension|(e.g. "png")|File-extension of skybox textures, to allow using non JPEG textures.}}
{{sdk world setting row|int|terrain|0 or 1|Terrain enabled/disabled.}}
{{sdk world setting row|float|terrainoffset||Sets a height offset for terrain, in meters.}}
{{sdk world setting row|float|terrainscale||Scales the size of terrain cells.}}
{{sdk world setting row|string|web_overlay||???}}
{{sdk world setting row|string|welcome||Welcome message.}}
{{sdk world setting row|float x 3|worldlight_ambient||??? (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float x 3|worldlight_diffuse||??? (e.g. "0.9 0.9 0.9")}}
{{sdk world setting row|float x 3|worldlight_position||??? (e.g. "-1.842309 1.547655 -1.358088")}}
{{sdk world setting row|???|worldlight_srgb_colors||??? (e.g. "1.0 1.0 0.95")}}
|}}
|caveats=
|caveats=
* Because these settings are always sent upon entering a world, it is recommended to register for this event before calling {{sdk function|enter}}. Otherwise, some or all settings may be missed.
* Because these settings are always sent upon entering a world, it is recommended to register for this event before calling {{sdk function|enter}}. Otherwise, some or all settings may be missed.

Revision as of 19:24, 17 December 2016

Event set and handler snippet

vp_event_set(instance, VP_EVENT_WORLD_SETTING, event_world_setting);

void event_world_setting(VPInstance instance) { }

Received for each setting of a world upon connecting to it.

Attributes

Attribute Usage
VP_WORLD_SETTING_KEY Setting key
VP_WORLD_SETTING_VALUE Setting value

Behavior

Key Range Usage
"allow_debug_menu" 0 or 1 Used to enable/disable the debug menu.
"avatar<number>" n/a Not used anymore.
"avatars_file" Name of file containing avatar configuration.
"farplane" ???
"fog_begin" Distance at which fog should begin.
"fog_color" rrggbb Color of the fog (rr, gg and bb are each a hexadecimal number between 00 and ff).
"fog_density" Density of fog.
"fog_end" Distance at which fog should be end.
"fog_mode" "linear", ... Fog mode.
"fov" Field of view angle.
"ground" Ground object.
"groundrepeats" 0 or 1 Ground object is tiled.
"nearplane" ???
"objectpath" Base url for object path.
"objectpassword" Password used to encrypt zip files in object path.
"override_visibility" 0 or 1 ???
"skybox" Base name of skybox textures.
"skybox_swaplr" 0 or 1 Swap the left and right texture of the skybox.
"skybox_extension" (e.g. "png") File-extension of skybox textures, to allow using non JPEG textures.
"terrain" 0 or 1 Terrain enabled/disabled.
"terrainoffset" Sets a height offset for terrain, in meters.
"terrainscale" Scales the size of terrain cells.
"web_overlay" ???
"welcome" Welcome message.
"worldlight_ambient" ??? (e.g. "0.65 0.65 0.65")
"worldlight_diffuse" ??? (e.g. "0.9 0.9 0.9")
"worldlight_position" ??? (e.g. "-1.842309 1.547655 -1.358088")
"worldlight_srgb_colors" ??? (e.g. "1.0 1.0 0.95")

Caveats

  • Because these settings are always sent upon entering a world, it is recommended to register for this event before calling vp_enter(). Otherwise, some or all settings may be missed.
  • There is currently no method to force a resend or watch for settings changes, except by re-entering the world

Examples

This event has no usage examples; please add at least one to this page