I really don't understand about multiple instances

Get help using Construct 2

Post » Fri Mar 01, 2013 9:53 pm

@vee41 It looks nice tricky!

I'm not sure this is flexible enough, my idea is supposed to be like

Frames:

1 - 2 - 3 - 4 - 5

bolded 3 causes impact to another object.

Otherwise 4 and 5 are cooldown frames.

We can add new instance variable like "Impact Frame" value is 3 compare frame animation

Is complicated to do it?
Joannesalfa2013-03-01 21:54:33
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Tue Mar 05, 2013 12:57 am

@vee41 i'm sorry to bump
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Tue Mar 05, 2013 7:18 am

Sorry didn't see your reply earlier :)

Modified the example a bit, added a small delay so the gathering moment now matches with animation frame 3. Other approach would be to modify your animation a bit so it matches with gathering the way you wish, or start your animation on different frame.

Hope this helps!
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 8:37 am

@vee41 Thanks for your reply! :)


I've checked your sample, that's not flexible tought what happens if you add extra cooldown frames?

Actually we have 4 frames for Harvester, then duplicate last frame, duplicate another 4 frames, in total 8 frames. It altered the impact time. The observed result was it can impact by some cooldown frame, not frame number "2"

Do you think we can create new instance variable as "Impact Frame" we type 2 in value field which is related to impact frame?

B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Tue Mar 05, 2013 9:21 am

[QUOTE=Joannesalfa]
Do you think we can create new instance variable as "Impact Frame" we type 2 in value field which is related to impact frame?

[/QUOTE]

Yes, if you have different animations with different impact frames you need to change the action: Wait(Harvester.GatherSpeed/Harvester.AnimationFrameCount)*3

Change the *3 to whatever your impact frame is, should work. You can have it as instance variable as well if you have separate animations with different impact frames.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 10:06 am

[QUOTE=vee41] [QUOTE=Joannesalfa]
Do you think we can create new instance variable as "Impact Frame" we type 2 in value field which is related to impact frame?

[/QUOTE]

Yes, if you have different animations with different impact frames you need to change the action: Wait(Harvester.GatherSpeed/Harvester.AnimationFrameCount)*3

Change the *3 to whatever your impact frame is, should work. You can have it as instance variable as well if you have separate animations with different impact frames.[/QUOTE]

@vee41 Honestly, i'm getting a headache for this. The biggest problem to determine the number of frames and each frame speed.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Tue Mar 05, 2013 10:14 am

[QUOTE=Joannesalfa]
@vee41 Honestly, i'm getting a headache for this. The biggest problem to determine the number of frames and each frame speed.[/QUOTE]

The number of frames is in variable Harvester.AnimationFrameCount
The speed of animation is determined by how fast the harvester gathers stuff, so a single animation frame takes: Harvester.AnimationFrameCount/Harvester.GatherSpeed seconds to display a single frame (I assumed a single gather cycle = one animation cycle).
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 10:34 am

@vee41 Ok, i think it's enough, i would like to send you a PM, there is something special that i might need a help, i'm not asking you to make a game for me, i'm looking the best practices.

B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests