VP EVENT WORLD SETTING: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
(Quick addition of missing world settings)
(Use content of List_of_world_settings instead of having a second list)
 
Line 6: Line 6:
* 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:
* List of keys:
{{sdk world setting table|
{{:List_of_world_settings}}
{{sdk world setting row|int|allow_debug_menu|0 or 1|Enable/disable use of the debug menu.}}
{{sdk world setting row|int|allow_flying|0 or 1|Enable/disable the ability for users to fly.}}
{{sdk world setting row|int|allow_passthrough|0 or 1|Enable/disable the ability for users to pass through objects and terrain.}}
{{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|???|avatars_update_interval||???}}
{{sdk world setting row|string|entry_point||World entry point.}}
{{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|"none", "linear", "exp", "exponential", "exp2", "exponential2"|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|float|old_walking_speed||???}}
{{sdk world setting row|int|override_visibility||Fixed visibility in meters}}
{{sdk world setting row|int|recommend_light_count||Recommended maximum number of lights.}}
{{sdk world setting row|int|recommend_per_pixel_lighting||Recommend the use of a renderer that supports per pixel lighting.}}
{{sdk world setting row|float|run_speed||Sets the run speed of users.}}
{{sdk world setting row|string|sky_clouds1||Cloud layer 1 texture.}}
{{sdk world setting row|string|sky_clouds2||Cloud layer 2 texture.}}
{{sdk world setting row|float x 3|sky_clouds1_color||SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float x 3|sky_clouds2_color||SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float|sky_clouds1_scale||Scales the size of cloud layer 1.}}
{{sdk world setting row|float|sky_clouds2_scale||Scales the size of cloud layer 2.}}
{{sdk world setting row|???|sky_clouds1_velocity||Cloud layer 1 velocity.}}
{{sdk world setting row|???|sky_clouds2_velocity||Cloud layer 2 velocity.}}
{{sdk world setting row|float x 3|sky_color1||Sky color 1 in SRGB (e.g. "0.65 0.65 0.65") - top}}
{{sdk world setting row|float x 3|sky_color2||Sky color 2 in SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float x 3|sky_color3||Sky color 3 in SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float x 3|sky_color4||Sky color 4 in SRGB (e.g. "0.65 0.65 0.65") - below horizon}}
{{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|float|walk_speed||Sets the walking speed of users.}}
{{sdk world setting row|string|web_overlay||???}}
{{sdk world setting row|string|welcome||Welcome message.}}
{{sdk world setting row|float x 3|worldlight_ambient||Ambient light color in SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|float x 3|worldlight_diffuse||Diffuse light color in SRGB (e.g. "0.9 0.9 0.9")}}
{{sdk world setting row|float x 3|worldlight_position||Directional light position (e.g. "-1.842309 1.547655 -1.358088")}}
{{sdk world setting row|float x 3|worldlight_specular||Directional light specular (e.g. "1.0 1.0 0.95")}}
{{sdk world setting row|???|worldlight_srgb_colors||Directional light color in SRGB (e.g. "0.65 0.65 0.65")}}
{{sdk world setting row|string|worldname||Name of world.}}
|}}
|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.

Latest revision as of 12:59, 24 July 2018

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 Type Default Value Description
allow_debug_menu boolean 1 If true, allows the debug menu to be used
allow_flying boolean 1 If true, allows the user to fly up and down by using the + and - keys.
allow_passthrough boolean 1 If true, allows the user to move through objects and terrain by holding the shift key
avatar string DEPRECATED - Object to use as users' 3D avatar (3D representation). Relative object name on the specified path with extension, e.g.:
  • p1cube0100.rwx
  • ../avatars/cy.rwx
  • dog.md2
avatars_file string avatars The name of the avatars list YAML file on the object path, with the default value the file will be loaded from avatars/avatars.yml, this allows the same object path to be used with multiple different avatar list configurations
entry_point decimal 0 0 0 0 Defines the entry point, in coordinates (X Y Z Yaw), for a world.
farplane decimal 40.0 Far clipping plane distance in decameters; how far from the camera the ground and avatars are rendered
fog_begin decimal 0.0 The distance at which fog starts (only applies to linear fog mode)
fog_color color FFFFFF Color of the fog rrggbb (rr, gg and bb are each a hexadecimal number between 00 and ff).
fog_density decimal 0.0 Fog density (only applies to exponential fog modes)
fog_end decimal 0.0 The distance at which fog ends (only applies to linear fog mode)
fog_mode string none Valid values are: none, linear, exp/exponential, exp2/exponential2 (exponential squared)
fov decimal 50 Field of view; how wide an angle of the scene is visible to the camera (in degrees)
ground string ground (or empty if terrain is enabled) Model name for the world "ground" object, a base object that is always rendered regardless of the user's distance from it (e.g. ground.rwx)
groundrepeats boolean 0 If true, the ground object repeats infinitely, to cover the world with the object (center the ground object at the nearest point on a 30m grid)
nearplane decimal 0.03 Near plane distance in decameters; how close to the camera the ground and avatars are rendered (0 may cause glitching)
objectpassword string Password for extracting password-protected ZIP files from the object path
objectpath string http://objects.virtualparadise.org/vpbuild/ Resolvable HTTP address to a server that provides the world's assets via the HTTP protocol, such as an object path (e.g. "http://localhost/", "http://objects.activeworlds.com/aw/" (alphaworld path), "http://myop.no-ip.org:8282")
old_walking_speed ??? ??? ???
override_visibility decimal Force a fixed visibility value (specified in decameters, the visibility menu in the user's client will be disabled)
recommended_light_count decimal 0 If set, displays a warning in chat if the maximum light count in settings is not set to the world's recommended value.
recommended_per_pixel_lighting boolean 0 If true, displays a warning in chat if the user's graphical renderer in settings is not set to one that supports per-pixel lighting.
run_speed decimal 2.4 If set, changes the speed at which users run.
sky boolean 0 Enable gradient sky
sky_clouds1 string Texture file name for cloud layer 1
sky_clouds1_color vector4 1 1 1 0 Cloud layer 1 color (RGBA)
sky_clouds1_scale vector2 1 1 Texture coordinate scaling for cloud layer 1
sky_clouds1_velocity vector2 0 0 Movement of cloud layer 1
sky_clouds2 string Texture file name for cloud layer 2
sky_clouds2_color vector4 1 1 1 0 Cloud layer 1 color (RGBA)
sky_clouds2_scale vector2 1 1 Texture coordinate scaling for cloud layer 2
sky_clouds2_velocity vector2 0 0 Movement of cloud layer 2
sky_color1 vector4 1 1 1 1 Sky color 1 (RGBA)
sky_color2 vector4 1 1 1 1 Sky color 2 (RGBA)
sky_color3 vector4 1 1 1 1 Sky color 3 (RGBA)
sky_color4 vector4 1 1 1 1 Sky color 4 (RGBA)
sky_srgb_colors boolean 1 0: Sky colors are in linear color space

1: Sky colors are in sRGB color space

skybox string Prefix name of a set of textures used for the skybox. A direction and a file extension is added to the prefix for each of the skybox textures (_fr, _lf, _bk, _rt, _up or _bt). The files are downloaded from the textures folder of the world object path. For example "sky_hd", will load:
  • sky_hd_fr.jpg
  • sky_hd_bk.jpg
  • sky_hd_lf.jpg
  • sky_hd_rt.jpg
  • sky_hd_dn.jpg
  • sky_hd_up.jpg
skybox_extension string jpg
skybox_swaplr boolean 0 If true, swap the _lf and _rt skybox faces
terrain boolean 0 If true, terrain is enabled.
terrainoffset decimal -0.02 Y (up-down) distance to offset the terrain globally by
terrainscale decimal 1.0 Scale factor of the terrain grid, with 10m*10m at scale factor 1. Values below 0.5 may cause performance issues for clients
walk_speed decimal 0.3 If set, changes the speed at which users walk.
web_overlay string URL to a web page to be displayed on top of the 3D scene. The web page should have a transparent background so the 3D scene can still be seen
welcome string Welcome to <world>, <name>! Welcome message to provide to clients entering
worldlight_ambient vector3 1.0 1.0 1.0 3D vector defining the ambient light color of the world. Three float values between 0.0 - 1.0 for red, green and blue channels respectively, delimited by space. e.g.:
  • 1.0 0.0 0.0 for full red
  • 1.0 1.0 1.0 for full white
worldlight_diffuse vector3 1.0 1.0 1.0 3D vector defining the diffuse light color of the world. Three float values between 0.0 - 1.0 for red, green and blue channels respectively, delimited by space. e.g.:
  • 1.0 0.0 0.0 for full red
  • 1.0 1.0 1.0 for full white
worldlight_position vector3 0.4 1.0 -0.8 3D vector defining the position of the world's sunlight. Three float values between 0.0 - 1.0 for X, Y and Z positions respectively
worldlight_specular vector3 1.0 1.0 1.0 3D vector defining the specular light color of the world. Three float values between 0.0 - 1.0 for red, green and blue channels respectively, delimited by space. e.g.:
  • 1.0 0.0 0.0 for full red
  • 1.0 1.0 1.0 for full white
worldlight_srgb_colors boolean 1 If true and if the user has sRGB rendering enabled in their client the world light settings (ambient, diffuse and specular) will be converted to linear color space before being used
worldname string Name of the world (used in default welcome message)

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