Please Help! Repetitive Audio Event - How do I

Get help using Construct 2

Post » Thu Oct 27, 2016 3:39 am

Message: farfetchd83 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
@plinkie what if there's two kinds of sprites, and they both should be at the goal in order for the system to go to the next layout?

(image)
Image
http://imgur.com/a/LW787
B
20
S
9
Posts: 78
Reputation: 1,748

Post » Thu Oct 27, 2016 3:50 am

Add all of the sprites to a family and replace the sprite object in the events with the family, so for each family, family is overlapping and family.pickedcount
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Thu Oct 27, 2016 3:53 am

Message: farfetchd83 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
dear @plinkie I also tried the first option, with only one type of sprite, but it didnt work, can you point out my mistake??? When only one sprite find the goal, its already going to next layout...

http://imgur.com/a/duky9
B
20
S
9
Posts: 78
Reputation: 1,748

Post » Thu Oct 27, 2016 3:55 am

Use .PickedCount. .Count is the total number of instances that exist. What you are doing here is comparing how many are picked in the overlap.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Thu Oct 27, 2016 4:07 am

Message: farfetchd83 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
What did I do wrong this time @plinkie ?

http://imgur.com/a/9LCZI

Now its just not going to next layout at all! :D :D :D
B
20
S
9
Posts: 78
Reputation: 1,748

Post » Thu Oct 27, 2016 4:12 am

That looks fine. You probs have some other objects around that are not overlapping Sprite3. Load in debug/preview mode and see what the value of numpips is and check it matches how many objects you are expecting.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Thu Oct 27, 2016 4:15 am

@plinkie I have changed it to "on collision with" instead of overlapping, and even if all sprites of the family are touching the goal object, it still now working, it doesnt go to next layout :^(
B
20
S
9
Posts: 78
Reputation: 1,748

Post » Thu Oct 27, 2016 4:23 am

Your logic is correct, you'll have to debug it. Do you have the original object somewhere off layout? You'll need to destroy that at the start. Check out what numpips is saying.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Thu Oct 27, 2016 4:34 am

@plinkie So i noticed with the debugger that the numPips count is adding up everytime I reload the game, never returning to the correct count... Thats probably a hint for an error, but I cant think of it... Also there are no other Pip Sprites around or outside the layout...

maybe some "every tick" condition to keep the sprite count correct?

I added an event for every "sprite family" destroy, substract 1 from the sprite count (numPip) but still when the layout reloads, its not returning to the original count


EDIT: alright I fixed the count by stating that every start of layout the global variable should be reset.. is that correct?

But still my main objective is not working :(
B
20
S
9
Posts: 78
Reputation: 1,748

Post » Thu Oct 27, 2016 5:06 am

I gotta sleep now, probably move this to PM or it'll go on forever :D Message me with a link to the capx or something and I can debug it for you later. If you're switching between layouts then yes it should be reset for that type of logic, I was just talking from the most basic sense.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 37 guests