Set Properties ⚙️ | Sansar Store
Set Properties ⚙️

Set Properties ⚙️

FREE

You need to own this item to leave a rating.

0 ratings

This script lets you set up to 80 object properties at once or in steps, such as velocity/position/rotation and much more, triggered by Script Library events. This script is a work in progress and more features will be added with time, so keep checking for updates on this page.

This script saves you from hoping to find the script that does exactly what you want with the right parameters. The concept is dead simple, enjoy.

Currently supports movement/physics/light/interaction/mesh visibility/animation/sound properties. More will be added in the future.

Just add your list of properties you want to set in the format 'property:value'.

Supported properties:
== General ==
- wait (0+)
- send_event (any text)
- can_grab (true|false)
- hide_mesh (true|false)
- new_set_event (any text)
- cancel (true|false)
- skip (0+)
- log (any text)
- startloop (true|false)
- endloop (true|false)
- skiploop (true|false)
- send_chat (any text)
- send_private_chat (any text)

== Movement ===
- wait_for_move (true)
- motion_type (dynamic|keyframed|static)
- move_mode (linear|easein|easeout|smoothstep)
- move_speed (0+)
- move_duration (0+)
- move_stop (true)
- position (<0,0,0>)
- position_offset (<0,0,0>)
- rotation (<0,0,0>)
- position_initial (true)
- rotation_initial (true)
- relative_position (<0,0,0>)
- relative_rotation (<0,0,0>)

== Physics ==
- bounce (0.0 - 1.0)
- surface_friction (0.0 - 1.0)
- air_friction (0+)
- spin_friction (0+)
- impulse (<0,0,0>)
- spin_impulse (<0,0,0>)
- relative_impulse (<0,0,0>)
- relative_spin_impulse (<0,0,0>)
- inertia (<0,0,0>)
- gravity_multiplier (-2.0 - 2.0)
- mass (0+)
- center_of_mass (<0,0,0>)
- velocity (<0,0,0>)
- spin (<0,0,0>)
- relative_velocity (<0,0,0>)
- relative_spin (<0,0,0>)
- velocity_offset (<0,0,0>)
- spin_offset (<0,0,0>)
- relative_velocity_offset (<0,0,0>)
- relative_spin_offset (<0,0,0>)

== Light ==
- select_light (0+)
- light_angle (1 - 160)
- light_angular_falloff (0.01 - 1.0)
- light_cast_shadows (true|false)
- light_shadow_priority (0+)
- light_color (<r,g,b>)
- light_color_hsl (<h,s,l>)
- light_color_hsl_offset (<h,s,l>)
- light_intensity (0 - 100)
- light_intensity_offset (-100 - 100)
- light_range (1 - 500)
- light_near_clip (0 - 500)

== Interaction ==
- interaction_text (any text)
- interaction_enable (true|false)
- interaction_click_event (any text)

== Animation ==
- select_animation (0+)
- wait_for_animation (true)
- animation_name (any text)
- animation_blend_duration (0+)
- animation_looping (loop|pingpong|none)
- animation_speed (0+/-)
- animation_start_frame (0+)
- animation_end_frame (1+)
- animation_play (true|false)
- animation_reset (true)

== Sound ==
- select_sound (0+)
- wait_for_sound (true)
- sound_play_at (component|object|target|agent|global)
- sound_speed (0.01 - 100)
- sound_looping (true|false)
- sound_volume (1 - 100)
- sound_offset_seconds (0+)
- sound_sync (true|false)

('relative' denotes being relative to the object's current rotation/position)
('offset' denotes an incremental change)

=== functions ===
set (anything)
not (boolean)
if (boolean, anything, anything)
add (number, number)
subtract (number, number)
multiply (number, number)
divide (number, number)
minmax (number, number, number)
anglediff (numvwe, number)
fromeuler (vector)
fromlook (vector, vector)
addvector (vector, vector)
subtractvector (vector, vector)
normailzevector (vector)
multiplyvector (vector, number)
dividevector (vector, number)
vectorlength (vector)
vectorrotate (vector, rotation)
rotationrotate (rotation, rotation)
rotationinverse (rotation)
floor (number)
ceiling (number)
round (number)

=== constants ===
_position (vector)
_rotation (rotation)
_initial_position (vector)
_initial_rotation (rotation)
_agent_count (number)
_forward (vector)
_back (vector)
_left (vector)
_right (vector)
_up (vector)
_down (vector)
_zero_vector (vector)
_infinity (number)
_-infinity (number)
_random (number)
_random_vector (number)
_timer (number)
_gravity (number)

for dynamic objects:

_velocity (vector)
_relative_velocity (vector)
_speed (number)
_is_moving (boolean)
_spin (vector)
_relative_spin (vector)
_mass (number)
_air_fiction (number)
_surface_fiction (number)
_spin_friction (number)
_gravity_multiplier (number)
_center_of_mass (number)
_can_grab (boolean)
_bounce (number)
_collider_center (vector)
_collider_extents (vector)
_ground_distance (number)

for event targets:
_event_has_object (boolean)
_event_has_agent (boolean)
_event_source_position (vector)
_event_source_rotation (rotration)
_event_object_position (vector)
_event_object_rotation (rotation)
_eventObject (string)
_eventSourceObject (string)
_agent_camera_rotation (rotation)

Changelog:
1.0.0:
- Initial release, includes dynamic/keyframed properties
1.1.0:
- Added light properties, including HSL color manipulation
- Renamed 'offset' to 'position_offset'
- Changes accumulation, now the order of properties matter
- Added another 20 property slots
1.2.0:
- Added 'wait' property, it is now possible to apply properties in a chain over time.
- Added 'impulse', 'relative_impulse', 'inertia', 'air_friction', 'spin_friction'
- Renamed 'gravity_factor' to 'gravity_multiplier'
- Renamed 'fiction' to 'surface_friction'
- Renamed 'initial_position/rotation' to 'position/rotation_initial'
- Added 'Set Finished ->' event
1.2.1:
- Added 'motion_type' property to set. Motion type can only be set to something lower then initial motion type, the levels being Dynamic -> Keyframed -> Static
1.3.0:
- Added interaction properties. Interaction can now be created and trigger an event
- Added support for move api, with added 'move_stop', 'move_speed', 'move duration', and 'wait_for_move'. That can be enabled with 'Use movable by script' toggle on the script. Move api means that movement is animated, instead of instant teleport.
- Added 'send_event' to trigger any Script Library event.
1.4.0:
- Added hide_mesh (requires 'Is Scriptable' to be enabled on the mesh if it is not animated), spin_impulse, relative_spin_impulse
- Fixed issue where position/rotation are not updated after a wait
1.5.0:
- Major performance improvements
- Added support for multiple lights manipulation. With 'select_light' it is now possible to select a specific light source in within the object, it accepts an index number (starting from 0).
1.6.0:
- Added animation support
- Some bug fixes with 'wait_for...' and interrupted retriggers
1.7.0:
- Added sound support
- Added 'new_set_event' which accepts an event name, this will allow to split your properties into multiple events, so essentially this allows you to use multiple Set Properties scripts in one. Every time 'new_set_event' is called, all following properties will be for that event.
1.8.0:
- Set Properties now supports COMPUTATION properties. Every computation line start with a variable name followed by '=', followed by a function call, for example: 'a = add(b, 2)'. This will add 2 to b and set the result to a, then you can use 'a' in a property like so: 'air_friction: a'. You can set global variables which their values are remembered between different set cycles. There are some constants available to you, they all start with '_'. For the lists of functions and constants, see the list above.
- Added 'cancel' property, which accepts a boolean and will stop from processing the following steps
- Added 'skip' property, which accepts a number and will skip this number of steps after it
1.8.1:
- bug fixes
- added support for '!' prefix to boolean (true/false) variables which means negating them, ie "not", such as "!_is_moving"
- added support for loops, added 'startloop', 'endloop', 'skiploop'. Startloop will decide if to loop all the following properties until 'endloop', and endloop will decided whether to start the loop again from the start. Skiploop will allow to skip the rest of the properties in the loop for one iteration.
- added 'log' property, which will write a message in debug console
- all strings input now support placeholders for variables by wrapping the variable name with '{}', such as 'log: is moving: {_is_moving}'
- added '_timer' constant, which gives the number of milliseconds since startup.
- added more property slots.
1.8.2:
- bug fixes
- added 'anglediff' function
1.8.4:
- bug fixes
- added '_eventObject' and '_eventSourceObject' for placing object groups from the event into the target event name
- add '_agent_count' for the number of agents in the scene
1.8.5:
- added 'send_chat' and 'send_private_chat' properties
- added 'floor', 'ceiling', 'round' math functions
1.8.7:
- increased resource (light/animation/mesh/sound) parameter lists to up to 80 slots

* I allow buyers to resell this script as part of their own products, but not as a standalone script

Item name
SetProperties [1.8.7]
Min. resale price
50