Repeat Action?

  • #1, by burningsimonThursday, 15. October 2015, 17:15 5 years ago
    Hey,

    i want to make a flickering Screen and i used the "Brightness" Action, but i dont find any Repeat Action to set the Brightness to 40% and then wait 1 second and then to 100% again and this should happens endless.

    Newbie

    14 Posts


  • #2, by afrlmeThursday, 15. October 2015, 17:37 5 years ago
    If you want to do this in editor with action parts then you need to use a combination of pause action parts & a jump to x action part to create a loop. You need to remember to quit the action you looped or also add an if query in there with a condition or value to kill the loop automatically.

    Ok, so... this is more or less what the actions would look like...


    set brightness '100'
    pause 1000 ms
    set brightness '40'
    pause 1000 ms
    jump to action part #1


    If you wanted to go down the scripting route then you could actually fade in / out to the new value over x time with easing by using the to() tweening function.

    example... (inside an execute a script action part)
    game.CurrentScene:to(1000, {Brightness = 100}, easeQuintInOut)
    1
    2


    P.S: if you want to get really brave then you could use the set random value action part to generate random delay / pause times &/or for setting a random brightness value.

    Imperator

    6812 Posts

  • #3, by burningsimonThursday, 15. October 2015, 17:51 5 years ago
    Thank you so much smile

    Newbie

    14 Posts

  • #4, by afrlmeThursday, 15. October 2015, 18:24 5 years ago
    No problem. By the way I recommend having a look at this tutorial I wrote on dynamic lighting for the wiki a while back. It's not exactly relevant to controlling the scene brightness but it may give you some ideas as I used random values to generate the delay between lighting changes, the strength of the lighting & the amount of times it should flicker. All in all it creates a more dynamic approach which is different each time it gets triggered.

    Imperator

    6812 Posts

  • #5, by burningsimonThursday, 15. October 2015, 20:25 5 years ago
    Thank you very much, very helpful! I just love this Community everyone is so helpful grin

    Newbie

    14 Posts

  • #6, by tristan-kangThursday, 15. October 2015, 20:36 5 years ago
    Ah, that's how Jump to Action command used for.

    My method was just made two actions and if one action finished then I put called other action -> infinity loop.

    Great Poster

    267 Posts

  • #7, by afrlmeThursday, 15. October 2015, 20:50 5 years ago
    Yeah Jump to x action is used for creating loops (infinite, current scene, condition based or a specific amount of loops).

    I guess your method also works & when it comes to VS there's always multiple ways of achieving the same thing. wink

    Imperator

    6812 Posts

  • #8, by tristan-kangThursday, 15. October 2015, 20:54 5 years ago
    But somehow some methods can shorten amount of command lines. grin

    I guess I should be familiar with Jump to Action now.

    Great Poster

    267 Posts

  • #9, by afrlmeThursday, 15. October 2015, 21:04 5 years ago
    About 90% of all available action parts are covered on this page in the wiki. I need to update the page at some point with the action parts added to 4.x as well as change some of the keyword colors in the text as they are hard to read in the current themes (they were added before me & David replaced the default wiki with the current bootstrap theme & color styles).

    Imperator

    6812 Posts

Write post