Individual objects / timer triggering problem

Get help using Construct 2

Post » Tue Oct 03, 2017 12:33 pm

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! :)
B
38
S
12
G
5
Posts: 151
Reputation: 5,338

Post » Tue Oct 03, 2017 1:42 pm

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

Code: Select all
WRONG
"steam_startdelay&self.UID"

CORRECT
"steam_startdelay" & self.UID


Besides that, the code is a bit confusing, so, this might not be the only cause for the problem you're having...
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Post » Tue Oct 03, 2017 4:01 pm

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".
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
72
Posts: 1,085
Reputation: 39,233

Post » Tue Oct 03, 2017 8:07 pm

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..
B
38
S
12
G
5
Posts: 151
Reputation: 5,338


Return to How do I....?

Who is online

Users browsing this forum: hao102a2 and 24 guests