Function not receiving correct instance

Bugs will be moved here once resolved.

Post » Sat Mar 02, 2013 6:41 pm

Link to .capx file (required!):
Bugged Version
https://www.dropbox.com/s/rnu6ndgsoq3hfgu/Space%20Vikingz%20-%20Function%20Bug.capx?m

It works this way
https://www.dropbox.com/s/o9qo3h3vsdlp5l8/Space%20Vikingz%20-%20Working.capx?m

Steps to reproduce:
1. Run the project
2. Click Button in top left to spawn your ships
3. The enemy bomber must have more than one bomb on screen(fires every 1.5 seconds when one of your ships is in the line of fire)
4. When any bomb should spawn an explosion animation, it spawns an explosion animation on every instance of the bomb.

#4 occurs only when the action to spawn the explosion animation is within the same function that checks AoE damage. When placed individually in both the conditions that should produce it, it works fine. I assume the function is receiving all instances of the bomb instead of just the one affected in the calling event.

I have not tested the rest of my AoE function enough, it could be checking for damage around every instance of the bomb as well.

Observed result:
When any bomb either collides or reaches the maximum distance, an explosion animation is spawned on all instances of the bomb.

Expected result:
When a bomb either collides with one of your ships or reaches its maximum distance it should spawn an explosion animation on itself.

Browsers affected:
Only tested with Chrome.

Operating system & service pack:
Windows 7, SP1

Construct 2 version:
120.2(64 bit)
B
25
S
8
G
2
Posts: 33
Reputation: 3,620

Post » Sat Mar 02, 2013 6:43 pm

Forgot to mention, all of the affected events are in the event sheet called "Fronir Projectiles".
B
25
S
8
G
2
Posts: 33
Reputation: 3,620

Post » Mon Mar 04, 2013 6:23 pm

Closing, it is by design that functions do not receive picked objects from the calling event.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests