"Ghost" Sprites? Bug?

Get help using Construct 2

Post » Thu Sep 25, 2014 7:55 pm

Hi everyone :)

I've come along a bug as I think, but cant explain where it comes from. I have the situation, that there is a set of squares, that can be changen to different "styles" when clickin on them. after the click a popup appears with 4 different selections. the problem is, that 2 selections are always clickable (red squares), even if the sprites dont excist (checked with debugger). i've attached some screenshots and the capx.

I know my explanation of the problem is a bit confusing but I dont know how to describe it better. just try it out ;)

C2 Build: R181 (beta)
OS: W7 64bit

If this is just a silly beginners problem then i would appreciate tips on solving the problem.

Thx
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 7
Reputation: 189

Post » Fri Sep 26, 2014 9:14 am

I don't understand the issue..

You are spawning the red squares, but not destroying them, so they will remain..
Maybe I just don't understand what you are trying to do..

The red squares don't seem to have any function, so I'm not sure why you are spawning them..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Sep 26, 2014 9:44 am

The red square are just spawned to mark the spots where the big squares change to blue or green if you click on them although the selection is not up. the problem is that when clicking on that spot it changes even if the selection is not there and it seems that from the beginning on those spots are there.

little example:
1. i start the game
2. i click on a spot where later on will appear the red squares
3. the big square changes to green/blue without showing the selection

issues:
1. the selection was not set there yet
2. squares can be changed without selection

...hope that helps to understand.
B
3
Posts: 7
Reputation: 189

Post » Fri Sep 26, 2014 9:55 am

It seems like you are spawning the selection on layer 2 (which doesn't exist)..
On created it spawns the blue squares on layer zero and on blue squares clicked selection is destroyed along with the blue squares..
so without seeing the things actually happening (for they happen all in one tick) they are created and destroyed, it would otherwise be impossible for the red squares to be spawned..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Sep 26, 2014 10:09 am

ah ok.... i think i undestood it. is there a possibility to change that, so that the selection appears and a 2nd click is needed? didnt expect that with that one click it would activate both actions.
B
3
Posts: 7
Reputation: 189

Post » Fri Sep 26, 2014 10:14 am

C2 reads events top to bottom, so when one event is executed the next event will trigger within the same tick if the conditions are met..

Adding a wait action before creating the blue squares might help..
Other options would include adding more conditions and or even timer behaviour..
You might even get away with just adjusting the order of events..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Sep 26, 2014 10:42 am

ok thx for the hints. with adding a 0.1sec wait before creating the blue squares solved the issue :)

thx a lot
B
3
Posts: 7
Reputation: 189


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests