Timer Frustration

My goal: When an enemy hits an active trigger, it stops motion/slows down for X amount of seconds.


So I followed the suggestions in this link and built a small test of what I wanted to achieve using the tips (and the downloadable file in the thread) and was able to have success! Awesome! http://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips. When enemy collides with a certain trap, I was successfully able to stop it for X amount of seconds.

So then I implemented those exact steps into my bigger project and the timer never resets itself. I have no idea what is going on!

Essentially my bigger project, upon the user starting the game, assigns a velocity X to a hero and an enemy. If the enemy hits a trap, I just want to slow it down (or stop it) for a X amount of time. I've attached a screen of my logic if it helps.

https://dl.dropboxusercontent.com/u/5820347/enemyTest.jpg

I appreciate any help or anything that I may be missing.

Thanks



Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Honestly if I were doing this I'd just use a regular boring old Timer Behavior, it's much more straight forward.
  • mesaticusmesaticus Member Posts: 51
    I thought that might really hinder performance if I had a lot of traps?
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    I've never had a problem using timers, but I've also never built a super timer heavy game. My personal experience is I've had several running at one time (maybe 4-6) and never had any issues.
  • mesaticusmesaticus Member Posts: 51
    Good to know, esp since I probably won't have more than that running at one time. I think I'll give this another hour of fiddling (I just recreated my test timer again) and if I can't get it to work, I may just move to your method.

    Oh the fun!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited August 2013
    I think the issue with timers is if you have a whole bunch actually running at the same time it can slow things down. For example if you had 50 timers all running at the same time, BUT if you have 50 timers in your game of which only a few are actually running at the same time, you likely won't have the same slowdown.

    Anyone with more information feel free to chime in. :)
  • mesaticusmesaticus Member Posts: 51
    Looks like my issue was Change Attribute versus Constrain Attribute. Ugh. Seriously I think I just need to post in a public forum before I can see the answer sometimes. Maybe the mods could give everybody a special filter to hide me.

    I still think I have a lot to learn about how GameSalad initiates everything. I guess when things are placed on the stage, everything is just firing.

    In my example for instance, I had a button that says, when you are press, set the velocities of these two characters to X. But with the rules that I attached in my screen above, I guess that condition on the timer technically allowed the enemies speed to be increased. So I had to add another attribute to the enemy to actually define it as zero.

    That just seems odds to me.

    Slowly but surely, I'll get there.
  • mesaticusmesaticus Member Posts: 51
    (Just to clarify my last statement, the error I was getitng was the enemy automatically progressing forward before my button that said to progress it forward was hit.)
Sign In or Register to comment.