Trigger once but for each instance?

For questions about using Classic.

Post » Sun Jan 15, 2012 12:24 am

Hello. I'm working on a game where the characters rely on state machines to change their actions and animations. I have a character change to his jump animation and set the frame number to 4, then resume the animation. Once while true. Another character who uses the same objects but different variables controls differently and works out just fine. The only thing is, when they both try to jump, only one of the instances changes to the jump animation and resumes. The other changes to the animation but is stuck on the frame is is set to and remains that way until the other one lands. Is there any way to set an action to run once but for each object instance?
B
2
S
1
G
1
Posts: 12
Reputation: 624

Post » Thu Jan 19, 2012 4:17 pm

Hello StreakThundrstrm. I'm not quite sure I understand you problem. Sorry.    :(
I think you should post a .cap, maybe that could help us understand your problem a little better? :)
B
5
Posts: 18
Reputation: 386

Post » Thu Jan 19, 2012 9:44 pm

--character-is in air(or whatever your condition is that supposed to trigger once while true)
----Is Private Variable ('DoneOnce') equals 0
--------Set Animation "jump"
--------Set Animation Frame to 4
--------Resume Animation
--------Set Private Variable ('DoneOnce') to 1


--[Inverted]character-is in air(or whatever....)
----Set Private Variable ('DoneOnce') to 0
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Jan 20, 2012 6:50 pm

I understand how that would work, thanks. Is there any way to make it a bit more global? The characters have tons of animations and actions. Right now I have a way of choosing each character seperately and it works globally rather than locally except for these animation changes. I'll try something else and see what I can come up with. Thank you for your help. I'll post a reply if I find anything or need more help.
B
2
S
1
G
1
Posts: 12
Reputation: 624


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests