Random Flicker

  • #1, by HasuakMonday, 07. April 2014, 02:00 10 years ago
    Hey,

    I'm trying to make a random flicker to a light in my scene. So far I got the object and its animation into the game. It's a two-frame animation with 20ms pause. I tried the "random pause between animations" checkbox but that seems to work differently. When the animation is played, the object just becomes invisible during the randomized pause. Am I using this checkbox correctly or am I missing something.

    To be clear, the animation has one frame for the glow and one with less glow. I want to show the frame with less glow randomly for a short time. Oh, and I don't know LUA at all so I need to get this working through the editor itself.

    Newbie

    26 Posts


  • #2, by afrlmeMonday, 07. April 2014, 02:36 10 years ago
    the random pause is a random value between 5 & 20 seconds I think.

    Yes it's normal that it disappears... essentially when an animation has finished playing it unloads. A simple solution is to add a few more frames & use the set individual pause value for each frame & then select the play in random order. That way it will randomly select a frame & play that & then randomly select another frame. The more of the bright frame you add the more chance it will be selected or vice versa. You could of course create a called by other action containing some if queries... say something along the lines of:
    set value 'value name' random between x value & y value
    if value 'value name' is 1
     play animation 'a'
    end if
    if value 'value name' is 2
     play animation 'b'
    end if
    
    etc...
    

    The above being a very quick & crude list of action parts. Obviously you would need to create multiple animations inside of the object to select from. The max value of the random value should be the amount of animations you have created.

    It's a bit late, which is why I've not gone into much detail, but hopefully this will give you an idea of what you could do? if not then I will provide a better explanation the morrow afternoon.

    Imperator

    7278 Posts

  • #3, by HasuakMonday, 07. April 2014, 03:47 10 years ago
    Thanks for the lengthy reply! I had completely ignored the "play random frame" button which seemed to do the trick quite well. I just added a bunch of the glow's frame with different pauses and one glowless frame with a very short pause, and added a sound to it. Works wonderfully smile

    Newbie

    26 Posts

  • #4, by afrlmeMonday, 07. April 2014, 04:04 10 years ago
    no problem smile

    Imperator

    7278 Posts