2 big problems in contruct : slowing a project.

For questions about using Classic.

Post » Fri Mar 25, 2011 5:01 pm

I think there is a big problem in construct that bothers me tremendously in creating video games:

You want to create an object, say Tutu example. Then we want after 5 seconds to destroy it.

If you have an object, it works no worries, because the object being the only object of its type, it will be created and then destruction. But if you have the same type of objects in the scene, and you create an object, if you say to destroy the object, it will destroy the object of the same type!


It should therefore be a very important feature in my opinion: it may affect the setting or take actions on the last object created in the statement block !!!!!

In addition: If we do an event like this:

weapon.Value ('dammage') Equal to 3: then => set weapon.Value ('dammage') to 4

It works! Changes the value of private variable for objects affected by the condition.

but if we do now:

weapon.Value ('dammage') Equal to 3:
Wait 3000 ms
then => set weapon.Value ('dammage') to 4

Any Weapon objects, even if they do not meet the condition, go to their private variable dammage affect the value 4.

These are two big problems that put big stick in the wheels




As part of my project I create for the fireball attack multiple enemies, I wish I could create fireball every few seconds and can identify each of them separately in order to destroy them after a period Certainties time, yet I have no way to do that.
B
2
G
2
Posts: 31
Reputation: 712

Post » Fri Mar 25, 2011 5:09 pm

You really need to do understand picking. In your case you're using the Wait object, well, you're out of luck. A wait action breaks all previous picking. Therefore all instances of the object will be affected.

As an alternative I would suggest using a private variable, calling it 'Lifetime' or something else that makes sense. You set it to an inital value of 5000 to get the 5 seconds you want (I like to measure time in ms), then have an event that always substracts 1000*TimeDelta from that PV.
Have another event that destroys the object when the PV is <= 0, and there you have it. A perfectly working 5 second timer without any picking issues.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Mar 25, 2011 7:45 pm

Ok thanks, d you have an example .cap to give to me please ?, i will better understand
B
2
G
2
Posts: 31
Reputation: 712

Post » Fri Mar 25, 2011 9:52 pm

I think this issue is important enough to go a bit into detail about it, so here you go:

We Construct Blog - Forum rescue #002: Timer
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Mar 26, 2011 10:27 am

Thanks i will test this !
B
2
G
2
Posts: 31
Reputation: 712


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests