Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

      CommentAuthorTheForumIsDead314 (Advanced Member)
    • CommentTimeOct 21st 2014 edited

    I'm trying to make it so if any object is restitution 0.2, it sets it to 0 at runtime. The event handler is on the right in scene 3, the "template" scene. It's On Entity Created with an Any assigner attached.

    What's wrong? I know floating-point numbers produce strange results (0.1 + 0.2 != 0.3 anyone?) but this is direct comparison, not addition.-----------------
    3.14159265358979323846264338327950288... Nothing Here
    • CommentTimeOct 26th 2014 edited
    The reason is the scene is merged in an OnBeforeLevelInitilzing event handler of the base scene.
    Yes, the OnBeforeLevelInitilzing event handlers of a merged scene will not run, just to avoid loop scene merging.
    (the merged scene may merge another scene, and the other scene will merge a new scene, ...)

    Following is the execution order of event handlers at the game init phase:
    1. OnEntityCreated for all entities
    2. OnBeforeLevelInitilzing
    3. OnEntiyInitialized for all entities
    4. OnBeforeLevelInitilzing

    So you can merge a scene in OnEntityCreated event handler to make the OnBeforeLevelInitilzing event handlers of a merged scene run.-----------------
    My games: Tapir Games
    My phyards: Tapir@phyard
    Ok, I actually read your other comment. I made it an on timer interval 3.-----------------
    3.14159265358979323846264338327950288... Nothing Here