Graphics

 View Only
  • 1.  OnSceneOnline event

    Posted 08-23-2012 15:23
    Is anyone who can help me to understand when this event(OnSceneOnline) occurs?

    I cannot find anywhere documentation for this.


  • 2.  RE: OnSceneOnline event

    Posted 08-23-2012 15:49
    Hey There,

    The OnSceneOnline event executes your script when the scene goes online (whenever it is looaded to the framebuffer). Therefore this happens only once, whereas the OnRender event runs your script on every frame that is rendered.

    Andrew

    #XPression


  • 3.  RE: OnSceneOnline event

    Posted 08-23-2012 15:50
    sorry!

    I'm totally wrong.

    The OnSceneOnline event allows you to use another scen coming online to trigger a script in your scene.

    whoops!

    Andrew

    #XPression


  • 4.  RE: OnSceneOnline event

    Posted 08-23-2012 18:22
    I do not understand. I created a simple script for this event to see when it goes into action.

    Example:

    i have a scene whith name "TEST".

    i have another scene with name "MYSCENE"

    For scene MYSCENE i assigned the fallowing script at OnSceneOnline section:

    dim testscene As xpScene

    Engine.GetSceneByName("TEST",testscene)

    testscene.SetOnline(0,10)

    Now if i take online MYSCENE from scene director my script does not running(my TEST scene never comming online)..

    #XPression


  • 5.  RE: OnSceneOnline event

    Posted 08-23-2012 18:49
    OnOnline is triggered when the current scene goes online.

    OnSceneOnline is called when a scene of your project goes online (and if I don't make a mistake, only when the current scene is online).

    In other word, you can have a logo in scene 1 and when you set online a second scene (scene 2), you can act on scene 1 (ie. move up your bug). So you have to write your code in "scene 1", in OnSceneOnline Event.

    OnSceneOffline works in the same way... In order to move down your logo when scene 2 goes offline.

    #XPression


  • 6.  RE: OnSceneOnline event

    Posted 08-24-2012 02:49
    Take a look at the topic in this forum titled "Scripting Question, Conditional states" and you'll find a sample that included a script in OnSceneOnline

    #XPression


  • 7.  RE: OnSceneOnline event

    Posted 08-25-2012 10:31
    Thankyou for the answer.

    #XPression


  • 8.  RE: OnSceneOnline event

    Posted 08-27-2012 14:54
    Seems to be working if OnlineScene comes online to different layer but if run on the same layer the script is cancelled i think.

    Here is my scenario:

    I have four different scenes and the layer for all scenes to run is set to 5. My anim controller for eatch scene that becomes online depend on currently online scene. Maybe an event like OnBeforeOnline to check if there is a scene on current layer, check for some properties of OnlineScene, set AnimController or other properties for current scene and then take online on the same layer with that OnlineScene(witch automatically take offline because currently scene is on the same layer).

    In the example "Conditional states" the scenes runs on different layers.

    #XPression