How do I - Handle overlapping objects with passing time

Just started using Construct 2? Post your questions here

Post » Mon Aug 15, 2016 7:45 am

@99Instances2g0

Just wanted to thank you for your reply, I will need to soak it all in and may be back for questions again! :) I think the part that I am trying to get my head around is how the mover is moving between the target endlessly - is this because is it running for every frame of the game ? If so I would need to work out how to stop this as the movers or enemies in my game, once they have reached their target, need to stop.


** EDIT *** 29 08 2016
@99Instances2go

I have read your post and then decided to follow the logic by trying to re-create what you have done but with using my own objects. The stupid pat is I am unable to mirror how you have added stage 2 where you destory the target onto a separate line under the On Start of Layout.

Can you please help with this?
** EDIT 22 08 2016 ***
@99Instances2go
Worked out that these are "blank sub events" will continue working on this and hopefully will understand it better when I do this.

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Fri Aug 26, 2016 6:34 am

@99Instances2go

I think I have got my head around this now, I do however have some questions on what I am trying to achieve, if they need to be a new post then let me know and I will submit a new thread.

As I will be having multiple enemies (They will be different in apperance and may be size) moving towards the different targerts, I would need to have this block of code for each of them. Is there an easy way of doing this ?

Also I may want to stop the emenies from heading to a target that is already "picked" by another and may allow for e.g. 2 ememies to go to the same target but no more. Can this be done as well ?

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Fri Aug 26, 2016 10:33 am

Hope this answhers all the remaining questions. I used a container to pair the text objects.
Basecaly, all you have to do is make every variable 'personal'. Meaning: use instance variables and personal behaviours. Pick based on the instance variables.

If the conditions pick several instances, and the actions must be private, use 'for each'. Loops trough each of the picked instances.

https://drive.google.com/open?id=0B1SSu ... ENlSGYwMXc
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 26, 2016 11:48 am

Message: timcs can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
99Instances2Go wrote:Hope this answhers all the remaining questions. I used a container to pair the text objects.
Basecaly, all you have to do is make every variable 'personal'. Meaning: use instance variables and personal behaviours. Pick based on the instance variables.

If the conditions pick several instances, and the actions must be private, use 'for each'. Loops trough each of the picked instances.

https://drive.google.com/open?id=0B1SSu ... ENlSGYwMXc


Thanks once again for you help @99instances2Go if Construct can work for me then I will likely be purchasing it. It has taken me some time to find a decent game maker and one that works with my budget. Some seem too expensive to me and one that I did buy lacks in support from a community like this one.

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Sat Aug 27, 2016 5:04 am

@99instances2Go

Had a look at this capx file you have done, thank for this, one question on the "badboy" object which in the case of this project is one object instances being created X amount of times. If I had e.g. 4 different objects how would I best spawn these in the same way ? I was wondering if they could all be part of a family and then spawn them if they are part of X family . Obviously I cannot test this on the free version so I would not know if that would work
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Sat Aug 27, 2016 7:57 am

Yes, familys will help, for sure.

But. Dont use differend objects. (for now) Use the same sprite with different animations (or frames). Learning that practice will give you joy in the long term, licensed or not. Instances are so much easyer to handle.

If you use differend objects you will at some point (in the nearby future) have no other choice then to buy construct. Because 4 different objects means 4 times more code, and the free version has a limit in amount of code lines.

Personal (just an opion) i think that you should buy Construct when you are ready for it, not when you hit its free limits while still learning it. Buying it should be a gift to yourself, one you are very happy with.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Aug 27, 2016 3:18 pm

99Instances2Go wrote:Yes, familys will help, for sure.

But. Dont use differend objects. (for now) Use the same sprite with different animations (or frames). Learning that practice will give you joy in the long term, licensed or not. Instances are so much easyer to handle.

If you use differend objects you will at some point (in the nearby future) have no other choice then to buy construct. Because 4 different objects means 4 times more code, and the free version has a limit in amount of code lines.

Personal (just an opion) i think that you should buy Construct when you are ready for it, not when you hit its free limits while still learning it. Buying it should be a gift to yourself, one you are very happy with.


Hi 99instances2Go

Thanks for your input here, the goal with Construct is to see if it can do want I am after before I buy it , so yes so far it is looking as though I will. I have been "experiementing" with your last profect file trying to get my last niggle resolved but I must not yet have gotten to grips with Contruct because it is not working fully.

So , once the enemy or in your example "BadBoy" overlaps the picked target using the UID, I need then to have e.g. 20 seconds to pass by, then the overlapped target starts to change appearance. So I tried to do this using opacity to stat with,. It looked like it was working but only a few of the overlapped targets started to change, some completely disappeared as I expected, others no change at all, and some went partially .

I was using a for each Target logic where the "badboy" overlapped the target using the UID as a condition and only on every 20 seconds.

Any thougthts on this please ?


** EDIT ** 28/08/2016

I have it working to a point whereby when the enemy or badboy overlaps the target , this is going to occur at different times for each instance, so I have simply started with an every X seconds event - That then has a sub event of a for each target and then from there has two conditions, which are is badboy overlapping target and badboy.UID = target.UID . This then has the effect on each badboy overlapping each target to fade at different times because each overlapping happens at different times .

Ideally I would like to store at what time the enemy overlapped the target and count the fading or appearance change from there but not sure how I would achieve this.

Thanks

TmCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Tue Aug 30, 2016 8:40 pm

Just want to update this thread with the fact that how without the help of all who have responded to this thread and a thank you to @99instances2Go for the work put into the example capxs files as well.

I am hoping to look forward to using construct 2 and also hope that construct 3 will be released to support the Mac and Linux OS as well.

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 08, 2016 7:38 pm

Sorry all I thought I had this nailed until now, I got my project to work in that the time for each enemy only starts with the timer once the enemy has reached the target, what I am struggling with now is when the timer reaches e.g. 30 seconds, I then want to trigger an action to change it appearance.

So I thought I would try System-> every X seconds then using Round(enemy.timer.<tried CurrentTime , TotalTime and Duration here>("timetag")*100)/100=30

But this has not worked. I presume I am going about this all wrong but there does not seem to be a timer compare to what its value is, there is an On Timer but I cannot see how that would help

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 08, 2016 9:58 pm

System ... compare 2 values ... sprite.timer.CurrentTime("tag") ... > .. 30
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: kainrazial, Yahoo [Bot] and 1 guest