Noobish Object picking question

For questions about using Classic.

Post » Wed May 11, 2011 2:34 pm

Hola amigos,

Ok seriously, can you guys tell me what do you think should happen with this?



I would expect all instance of Foe to be checked every time a Friend is destroyed then set each Foe's target value to 0 if its current target equals the destroyed Friend's UID.

Currently, only one instance has its target value reset to 0. Result, some Foe will continue shooting at already destroyed target forever.
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Wed May 11, 2011 2:43 pm

Try removing the for each, it's not needed. When you compare a variable it checks all the instances unless some were filtered before with another event.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed May 11, 2011 2:52 pm

Well, sorry, I found my problem. The issue was the events order. The target was reset to 0 then further down in the event sheet, set back to the UID of the destroyed Friend.

Which is strange since the Friend was destroyed before Foe's target would be set, so I don't understand why Foes detected the destroyed Friend.

Anyway, I put the target reset logic at the bottom of the sheet to fix it. But I hate not understanding something :P
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Wed May 11, 2011 2:58 pm

Objects are not truly destroyed until the end of each tick. Its somewhat of a design flaw of construct. So, you can still access the location, pv's, etc, for destroyed objects until the end of that event sheet, though I believe you won't be able to pick it after the event where it was destroyed is over
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed May 11, 2011 3:11 pm

Well, the Foe seems to pick the destroyed object even after the end of the Destroy event. It uses an Overlapping at offset condition and was still picking it. So you're right in saying that objects are still "pickable" until the end of the tick no matter what.

That's a very useful information thank you :) You're very.. lucid!
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Wed May 11, 2011 11:12 pm

[quote="lucid":1u5vrh4h]...I believe you won't be able to pick it after the event where it was destroyed is over...[/quote:1u5vrh4h]
[quote="Djordhan":1u5vrh4h]...you're right in saying that objects are still "pickable" until the end of the tick no matter what...[/quote:1u5vrh4h]
Well I was wrong about the pickablility for the remainder of the tick, but you were wrong about me being right about it. So...

...glad I could help!
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests