Interesting Issue

Get help using Construct 2

Post » Wed Sep 05, 2012 5:46 am

I'm not sure if I am doing something wrong or not. Please forgive me if this turns out to be something stupid as I come from a background in flash as3 and am still trying to get used to using construct 2.

I have a simple layout with 3 instances of a sprite named "Space".

Each instance of Space has its own variable called "spaceID".

They have the values 1, 2, and 3 respectively. They have a simple looping animation with 2 frames.

I also have a global variable called "acitveSpace".

I have set activeSpace = 2;

On the event sheet I simply have one item (besides declaring the global and giving it the value of 2). This is as follows:

Space->activeSpace=spaceID, Space->Start animation.

All spaces except for 2 start animating.

But when I chance (activeSpace=spaceID) to (atciveSpace not= spaceID) then the correct space (#2) animates as it should.

Did I miss some core logic? LOL both variables == 2 but it only works if I put the condition not equal.

Please let me know if I missed something. Thanks ;-)
B
10
S
3
G
3
Posts: 29
Reputation: 2,769

Post » Wed Sep 05, 2012 9:05 am

Remember that these variables must have the same data type. (number - number). If so, this is really strange.
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Wed Sep 05, 2012 10:58 am

[quote]Space->activeSpace=spaceID, Space->Start animation[/quote]
This will restart the animation every tick so it will always be on the same frame and appear to be stopped. The other two sprites animate normally because the animation speed > 0. When you invert it the reverse happens, the other two have their animations reset every tick.

You'd need something like:
[code]
+System: On start of layout
   - Space: Stop animation

+Space.spaceID = activeSpace
+System: Trigger once
   - Space: Start animation
[/code]
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Wed Sep 05, 2012 12:13 pm

Moving to 'how do I' since this doesn't appear to be a bug report.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Sep 05, 2012 8:51 pm

Thank you guys... I learned something new. ;-) And it is now working brilliantly! The trigger once while true did the trick along with an event group. I've owned construct for a few months now... but am just now really getting into it. Thanks for your patience. agouti10142012-09-05 21:28:06
B
10
S
3
G
3
Posts: 29
Reputation: 2,769


Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, imnotspecial and 19 guests