Need some help with this

Get help using Construct 2

Post » Thu Sep 01, 2016 6:08 pm

Hi all

I have this strange issue.
Image
http://www.pileofcrab.nl/Apps/Games/LittleCreatures/Issue.jpg

I have asteroids and i have little creatures.
The asteroids is food so the little creatures need to eat them.

Each little creature is assigned to a asteroid.
The assigned asteroids UID is stored in a variable of the little creature.
The little creatures walk up the the assigned Asteroid.
(so far all works)

But then when i want to check if they overlap their assigned asteroid, only 1 of them is eating.
The rest is not.
I want them all to eat individually, but only if they overlap their assigned asteroid.

As you see in the logic i am using i try to pick the assigned little creature for each asteroid.
Then do a overlap test.

Why is this not working?
why is only 1 of them eating?

I tried so many different ways but i cant figure this out.

Thanks for helping.
Savvy001
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Thu Sep 01, 2016 6:27 pm

I'd recommend using a Timer on the Creature, rather than Every X seconds.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Thu Sep 01, 2016 6:40 pm

@blackhornet

How does that solve my issue?
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Thu Sep 01, 2016 6:42 pm

I suspect the every X seconds is not doing what you want, buried there. The other alternative is to try putting the Every X seconds at the top.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Thu Sep 01, 2016 6:52 pm

Hmm that is interesting.
I will report back after a test.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Thu Sep 01, 2016 6:58 pm

@blackhornet

Thank you so much!
Strangely that was the issue.
Don't really understand why the other way around did not work.

Can you or someone else explain this?

I am happy now :-)
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Thu Sep 01, 2016 7:13 pm

The problem is the Every X is not associated with anything, and triggers once. So the first time through the loop it hits "every 0.5" sees that it has expired and resets it for the next 0.5sec. It doesn't know it's in a loop and is expected to still hold that value. That's why at the top it triggers, then each creature is tested at that time.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Thu Sep 01, 2016 7:21 pm

Wow that is a solid explanation.
Now i understand what is happening.
Thank you so much.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, dop2000, Rhindon and 25 guests