delay time

For questions about using Classic.

Post » Mon Mar 12, 2012 8:00 pm

+ Platform: Value 'Trigger' Equal to "1"

+ System: Every 100 milliseconds
-> Platform: Add 1 to 'Timer'

+ Platform: Value 'Timer' Equal 20
-> Make Paltform invisible etc

+ Platform: Value 'Timer' Equal 50
-> Platform: Set 'Timer' to 0
-> Platform: Set 'Trigger' to 0
-> Make Paltform visible

http://dl.dropbox.com/u/12412965/Timer.capUnixRoot2012-03-12 20:24:01
B
7
S
2
G
2
Posts: 45
Reputation: 1,465

Post » Tue Mar 13, 2012 12:43 am

yes that method works fine for one plateform, but when you have multiple platforms they all seem to share the same private variable (timer) They can't just obey their own private timer, they'll all refer to the one of the first created instance, even if I use conditions like "pick closest" and such.

It seems to work if the execution is "destroy" but not if it's "make invisible" and "disable collision"

It says your file was saved with a newer version of construct? r1.2 is the latest version is it not?

Thanks a lot for your time! I'm still searching...
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Tue Mar 13, 2012 12:53 am

Here.s what I tried so far

With private timer

With function delays

Gropwel2012-03-13 01:30:27
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Tue Mar 13, 2012 1:55 am

[QUOTE=Gropwel] yes that method works fine for one plateform, but when you have multiple platforms they all seem to share the same private variable (timer) They can't just obey their own private timer, they'll all refer to the one of the first created instance, even if I use conditions like "pick closest" and such.

It seems to work if the execution is "destroy" but not if it's "make invisible" and "disable collision"

It says your file was saved with a newer version of construct? r1.2 is the latest version is it not?

Thanks a lot for your time! I'm still searching...[/QUOTE]
They don't share the same pv - it is the right picking that is missing. Please have a look at one of my earlier posts "Posted: 05 Aug 2011 at 2:01pm". It is the most simple and effective way to do it, because you don't need any timer object and you pick the right object by comparing the pv to the actual time.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Mar 15, 2012 12:46 am

Yes I already tried it and unfortunately it gives the same result. Works fine with one platform, but weird things happen with two or more.

I would jump on the first platform then on the second but as soon as I touch the second it dissapears.

I use debug texts to display the variables, I don't know if it's any indicatives but the value displayed is always the one of the first instance created, it'll never update if I touch another instance.


Here's how I did it

It's scary because that's how I intended to manage delays for the character animation's timing. She's getting annoyed that all of her animations are being interrupted all the time. XD :(

Thanks again!Gropwel2012-03-15 00:49:14
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Thu Mar 15, 2012 1:04 am

OMG I actually found a way but it's so archaic!

this is insane...

Creating and destroying objects seems the only way on the fly of forcing them to use their own pv's.

Can't imagine how I can use such a process for my animations tho...
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Thu Mar 15, 2012 6:04 am

[QUOTE=Gropwel]Creating and destroying objects seems the only way on the fly of forcing them to use their own pv's.[/QUOTE]
No, it isn't. It's the event-structure that breaks the logic in this case.

In your screenshot "Capture3.PNG", the "trigger once"-subevents don't work as you expect. "Trigger once" should only be used as a second condition in an event and can easily confuse, if used in a subevent.

Instead, think of your issue as a triple state:
1) object is touched
2) object will be made invisible
3) object will be made visible

Now use the pv "touched" to map that tri-state.

1) object is touched -> touched = 1
2) object will be made invisible -> touched = 2
3) object will be made visible -> touched = 0

If you adapt the following screenshot exactly as is to your project, it will work (I just omitted the animation setting, which you would have to put back in, in my events 2 and 3):



EDIT: In case you didn't find it yet, there's an extensive description of picking (filtering) in Construct's wiki. Just follow this link

EDIT 2: Damn, I posted an image with the wrong order of the conditions in event 2. Don't know why^^ Here is the correct order of conditions:
tulamide2012-03-15 07:13:44
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Mar 15, 2012 11:14 pm

Just a quick post before I go and do that to give all my thanks to you Tulamide, and of course to the community. You've always been incredibly generous of your time and knowledge which to me are pretty much the most valuable virtues. Sorry, had a rough day today, need to share positive vibes. ^^

You'll have a spot in my team's credits if it's ok with you.

Damn construct is the bomb.
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Thu Mar 15, 2012 11:50 pm

It works indeed! God what a relief! Fixed some collision detection bugs as well for some reason.

You're right, I treated pv's too much like booleans I guess. States is a much more appropriated method.

I'm sure my whole designer prog'd script could be reduced to just a few pages with optimizations like those.
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests