1. The space forums use a separate registration system from the main virtual world. To comment on these forums, you need to create a separate forum account.
    Dismiss Notice
  2. Hey there, we have two Skype groups for space early users - if you're creating content, or need help, feel free to join in either the the beginners or advanced users groups.
    Dismiss Notice

[IMPORTANT FOR SCRIPTERS] Scripting execution order changes

Discussion in 'General' started by Adam, May 10, 2017.

Share This Page

  1. Adam

    By:AdamMay 10, 2017
    Developer
    Staff Member Moderator

    Joined:
    Aug 21, 2014
    Messages:
    630
    Likes Received:
    113
    Hi there,

    This is just a quick note on an upcoming change - I don't believe it breaks any scripted content out there already (infact may help with some other content making it work more reliably).

    We're changing when clientside scripts initialise and execute. I discussed this in the developer chat a few weeks back, but am formalising the change here.

    Currently, scripts will load when the object instantiates - in the case of scripts embedded in a scene, this can occur while the loading screen is up, but prior to when the users own avatar is present in the scene.

    We are changing this behaviour so that scripts will execute as soon as the player avatar is in the scene, this will still occur while the loading screen is up potentially, but only for the last 1-2 frames.

    This will ensure that the Space.Scene.PlayerAvatar global property is always available.

    Please note however, that the Player Avatar while present, will only be the root node -- the sub-components of the player (such as their skeleton, clothing, etc) may take a while to load from there, depending on cache status, and network speeds.

    I will look at adding a SAvatar.OnLoad event, which allows you to hook events to whenever the skeleton is loaded; this is important as a players avatar may reload periodically (such as when changing outfits), which could break script-driven attachments if they occur in an inopportune time.
     
    AshaSekayi and Mike (CNDG) like this.
  2. Adam

    By:AdamJul 12, 2017
    Developer
    Staff Member Moderator

    Joined:
    Aug 21, 2014
    Messages:
    630
    Likes Received:
    113
    These changes are now in place and live. The old behaviour can still be emulated using a checkbox in the latest experimental EPs.
     
    AshaSekayi likes this.
  3. AshaSekayi

    By:AshaSekayiJul 13, 2017
    Member

    Joined:
    Dec 20, 2016
    Messages:
    49
    Likes Received:
    5
    Was SAvatar.OnLoad already added as well?