some questions

For questions about using Classic.

Post » Wed Dec 30, 2009 11:51 pm

1. how does the timing of an event/action work

the reason why i ask, i have some troubles with bullet settings, some things should happen all at once, but there seem some delay between them, like doing bulletsettings i call a function to do multiple settings,and then after function set a sprite position to the bullet, there some time between them how should i make sure everything happens at the same time

2.
could there be some problems with fast collision detection on multiple objects at once, i beginning to think that it sometimes skips some events or something, as my code works if you take one hit at a time, but when i do one big blowup some things are getting messed up

if you use for each object collision with object, it should do all the events for each object on collison should it?

3. countmatching,
i litrally got crazy today as i didnt get this to work
so i have an event where some sprites are counted as the same group, when destroyed, the count goes down like it should, but it nevers reaches 0, i want it to do this way so there can not be a mistake in collison detection, substracting from a var, it has to do with the condition gets false before reaching zero (i think), but why doesn't it gives zero as there are no matching events .. so 0!
B
2
G
3
Posts: 72
Reputation: 994

Post » Thu Dec 31, 2009 2:35 am

[quote="Aphex":2uqp4207]1. how does the timing of an event/action work

the reason why i ask, i have some troubles with bullet settings, some things should happen all at once, but there seem some delay between them, like doing bulletsettings i call a function to do multiple settings,and then after function set a sprite position to the bullet, there some time between them how should i make sure everything happens at the same time[/quote:2uqp4207]

Not quite sure what you mean here. Could you post a .cap of the problem and a description of what should be happening?

[quote="Aphex":2uqp4207]2.
could there be some problems with fast collision detection on multiple objects at once, i beginning to think that it sometimes skips some events or something, as my code works if you take one hit at a time, but when i do one big blowup some things are getting messed up

if you use for each object collision with object, it should do all the events for each object on collison should it?[/quote:2uqp4207]

If you combine On Collision and For Each then the For Each will only loop the objects that are currently colliding in that tick. If you want all of them to blow up when only one collides, you need to not pick them. You could do this with a function (Forget picked objects -> Destroy objects), or you could use the Family Picking trick (put each object into two families like Red and Blue, then do On Collision with Red -> Destroy Blue).

[quote="Aphex":2uqp4207]3. countmatching,
i litrally got crazy today as i didnt get this to work
so i have an event where some sprites are counted as the same group, when destroyed, the count goes down like it should, but it nevers reaches 0, i want it to do this way so there can not be a mistake in collison detection, substracting from a var, it has to do with the condition gets false before reaching zero (i think), but why doesn't it gives zero as there are no matching events .. so 0![/quote:2uqp4207]

Are you certain there aren't any instances lurking around somewhere? Check the debugger and see how many objects you have to make sure there are none. Also, check your order of events, you might be skipping the last "subtract from var" event somehow.

Again, it would be a lot easier to see what's going wrong if you could provide a .cap.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest