Individual objects / timer triggering problem

0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I'm trying to trigger animations on individual instances of the same object (by using booleans and variables).

    I have a rising steam object (with 3 animations: steam_rise, steam_up, steam_end) and I'd like to control each individual instance of the object by the time values set in instance variables, but somehow the triggering gets messed up.

    On creation, each instance is supposed to wait X seconds start delay before the animation starts. Then, when steam is up (animation has run it's length) trigger another animation (steam_up) and timer. After this timer has stopped, trigger steam going down animation. After steam_end animation trigger a timer to wait X seconds before repeating / the steam rises again.

    https://www.dropbox.com/s/wpnjs97rjvfo3 ... px?dl=0&m=

    I probably have a simple stupid error somewhere in my event logic but I'm unable to locate it right now.

    If anyone has time to take a look and help me figure out what I'm doing wrong it'd be much appreciated! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • I noticed you included the self.UID info INSIDE the quotation marks, instead of outside. It may be causing the problem.

    WRONG
    "steam_startdelay&self.UID" 
    
    CORRECT
    "steam_startdelay" & self.UID
    [/code:1arib2po]
    
    Besides that, the code is a bit confusing, so, this might not be the only cause for the problem you're having...
  • You don't really need to include UID in the timer name. Each instance is running its own timer.

    However, you might need to add "For each test_obs_steam" in the On Timer event as another condition or sub-event, because there is a chance that timer will be triggered for 2 instances at the same moment (tick).

    Also, you don't have to stop timer in the On Timer event, as you start it "Once".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks brunopalermo and dop2000 , I finally managed to get it to work but it took quite a lot of trial and error Ended up scratching most of the event logic and starting from scratch..

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