Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Repeat Action?

  • #1, by burningsimon 11 years ago Zitieren
    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.
  • #2, by afrlme 11 years ago Zitieren
    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)
    


    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.
  • #3, by burningsimon 11 years ago Zitieren
    Thank you so much smile
  • #4, by afrlme 11 years ago Zitieren
    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.
  • #5, by burningsimon 11 years ago Zitieren
    Thank you very much, very helpful! I just love this Community everyone is so helpful grin
  • #6, by tristan-kang 11 years ago Zitieren
    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.
  • #7, by afrlme 11 years ago Zitieren
    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
  • #8, by tristan-kang 11 years ago Zitieren
    But somehow some methods can shorten amount of command lines. grin

    I guess I should be familiar with Jump to Action now.
  • #9, by afrlme 11 years ago Zitieren
    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).