Results 1 to 5 of 5

Thread: How do I create a Triggerable effect in an assetbundle?

  1. #1

    How do I create a Triggerable effect in an assetbundle?

    Situation:
    1. Created effect.
    2. Added trigger script to object (did this probably wrong)
    3. Added effect to the "Object" that will become an asset bundle
    4. Created asset bundle
    5. Created a trigger call code
    6. Tested-> getting just the sound...

    The code recognizes the trigger and calls it. But nothing happens.
    The effect works, as I checked the "Play on awake" and it plays once, as it should.
    Tried to study the Light and Explosion triggers that exist, but the jscript component in them looks different. Old versions?

    Included a couple of pics of my attempt on asset bundle trigger.
    Maybe I got it completely wrong?


    Trigger script
    Attachment 532
    Start of Effect
    Attachment 531

    Windburst is the effect I want to display. Lua code does find the trigger (and and calls it?)...

    The Lua seems to work, but I'll include it too (Yes I am calling it from somewhere else, no one want's to read all the code for this...).
    The values I get when testing:
    print(effect.name) -> "Windburst"
    print(effect.index) -> 0


    function activateTrigger(obj, triggerName)
    local effectList = obj.AssetBundle.getTriggerEffects()
    if #effectList == 0 then
    print("Error: No trigger effects on this object.")
    else
    for i, effect in pairs(effectList) do
    print(effect.name)
    if effect.name == triggerName then
    obj.AssetBundle.playTriggerEffect(effect.index)
    print(effect.index)
    return
    end
    end
    print("Error: No trigger found with that exact name.")
    return
    end
    end

  2. #2
    I can't be sure without checking your asset in full

    But . . .

    I see you have not assigned the particle effect to a trigger in one of your images.



    If you set the number to match the number of trigger-able particle effects you intend to use, then for each one assign a particle effect to each Element spawned in the Particles hierarchy of the TTS asset Bundle Effects (Script)

    you should have created the necessary actionable trigger(s) you are missing . . . Probably

  3. #3
    Yup, that was it. I actually fought an extra couple of days, as I tried to us "Game Objects" Instead of Particles.
    Works now. Thanks!
    Only small "complaint"...
    The sound effect goes on for 4 sec, but TTS plays only around 1 or 2 sec of it....
    Is it tied to the duration of the particle effect? That is 2 secs, but the particles hang around for a bit longer...
    It would be nice if the entire sound file would play out...
    https://youtu.be/lM56Fenp_TQ

    - - - Updated - - -

    After two weeks of constant fighting with my Asset bundle.
    I decided to have some quiet quality time with it...
    https://youtu.be/2VIqaVdfezc

  4. #4
    Only small "complaint"...
    The sound effect goes on for 4 sec, but TTS plays only around 1 or 2 sec of it....
    Is it tied to the duration of the particle effect? That is 2 secs, but the particles hang around for a bit longer...
    It would be nice if the entire sound file would play out...
    I have not checked this specifically for triggered particle effects but the last line in the TTS asset Bundle Effects (Script) that's Labelled.

    Duration for each trigger you set up,

    Should control the length of that Triggered effect . . . Which should includes the sound element.

    Its measured in seconds and starts with a default of "1" which is probably why your sound is currently being cut of , at a guess.

  5. #5
    Yup, that was it.
    Thought it was connected to the animation options.
    Now the effect is close to what I wanted. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •