When to modify "trig.solModifiers"?

0 favourites
  • 5 posts
  • Hi,

    I try to make an action which has an object-type parameter. My goal is to pass the uid of selected instance (sol.select = false) from sol.

    Fist, I try to use object-type parameter. The sol of this object will be push by "trig.solModifiers" (eveng.js, line 1626). So that I can not pick the target instance, since sol is in a new sol-stack.

    Second, I try to use number-type parameter. Then put expression object.UID in event sheet.

    In this case, "trig.solModifiers" does not contain this object, so that the sol will not be push, the sol-stack will not change. I can pick target instance from sol.

    one is picked by object-type parameter, the other is picked by expression. Why "trig.solModifiers" will be different?

  • If you modify the picked objects, it must be in the solModifiers array so the SOL stack correctly pushes and pops. Any object in an object parameter is automatically added to solModifiers by the event system so you can safely pick or unpick instances from an object parameter.

    TBH the event system is not yet designed to allow triggers to access the calling event's SOL (the function features when we add them should allow that). The UID thing is a hack and will not work if you add a condition affecting that object, because then the trigger's solModifiers will also contain that type and you'll still get a clean SOL.

    Another hack which might work is still use an object parameter, but try looking one level up the SOL stack. Not sure that will work 100% though.

  • Any object in an object parameter is automatically added to solModifiers by the event system so you can safely pick or unpick instances from an object parameter.

    Yes, that is true.

    If you modify the picked objects, it must be in the solModifiers array so the SOL stack correctly pushes and pops.

    the trigger's solModifiers will also contain that type and you'll still get a clean SOL.

    Not all modified objects will be in "solModifiers" array.

    I found the sol-stack does not always push a clean one by observed the sol stack in my second method. That's why I can pick uid in expression.

    the event system is not yet designed to allow triggers to access the calling event's SOL

    Oh no~ I'm sure the sol-stack does not change when I test function plugin a few months before.

    Another hack which might work is still use an object parameter, but try looking one level up the SOL stack. Not sure that will work 100% though.

    Auto-clean sol is a good design to make sure the sol is the same (clean).

    Would you mind to add a function to tell the engine to keep sol-stack without push a clean one, so that plugin can control the sol manually.

    Thanks for your reply.

  • I move instances selecting from action to triggered condition. It works, I can get instances correctly in action under triggered condition.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • rex, your SysExt will be perfect if you combined it with instance Grouping.. Enable Disable Behavior by Group or instance..if it is possible..

    it usefull for Grouping Object like NPC or Monster

    Ally Or Enemy..

    Pick instance by property comparing should be enabled in event too i think..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)