My 'Help Me' Thread

For questions about using Classic.

Post » Sun Feb 01, 2009 3:51 pm

[quote="Rich":2wghmt8b]- On pause pressed
+ Set TimeScale to 1 - TimeScale[/quote:2wghmt8b]

Could you elaborate on that? Not quite sure how I'd set that up.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Feb 01, 2009 4:07 pm

Exactly as it's shown...

"1 - TimeScale" means "one minus the current TimeScale value," so if your TimeScale is 1, then it's 1 minus 1, which equals 0. If it's 0, then it's 1 minus 0, which equals 1. It's like a toggle switch.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 01, 2009 4:18 pm

Ah, got it. I thought 0 - 1 = -1.

Or are there no negative values in Construct?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Feb 01, 2009 5:49 pm

It's never subtracting anything from 0, only from 1 :).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Feb 01, 2009 8:09 pm

[quote="thomasmahler":2fm7wul1]AI thought 0 - 1 = -1.[/quote:2fm7wul1]

0 - 1 does indeed equal -1. But that's not what's happening here.

The equation indicates it will either be 1 - 1 or 1 - 0. Neither of which is 0 - 1.

1 - 0 /= 0 - 1.

1010100010011101010100101010011101 :shock: 010101100100100101
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 02, 2009 4:37 pm

8) Alright, next problem. I quickly recorded a video to demonstrate it:

http://thomasmahler.com/files/construct ... bar_01.avi

Basically, I created a progress bar that shall act like a healthbar later on. So if you attack an enemy, it shows you how much energy the enemy still has left.

I want the healthbar to always follow the Mushroom sprite, but it acts weird when the screen starts to scroll.

My event was:

Always - healthFieldMushroom: Set X to Mushroom.X
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Mon Feb 02, 2009 5:39 pm

Hard to say. As nice as video demonstrations are, you can't really tell too much from them. It would be easier to see your .cap.

Mu guess is that you have the health bar on a different layer that has different scrolling settings. If not... well, like I said, it's hard to say.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 02, 2009 7:50 pm

Nah, that was also my first thought, but that's not it. Still haven't figured it out, but I'll post the solution once I will.

Anyway, here's another one:

9) I added an 'attack' control and have my 'animation' event sheet pretty much set-up like you did in the platforming school thingy.

What I want to achieve is this: If the player presses 'Attack' once the 'Attacking' Animation will be played once. And after the attacking animation has been played once, the character will be back at 'Standing'.

Now, my attack event is:

On "Attack" pressed - Player: Set "IsAttacking' to 1 (private variable for the player)
Value "IsAttacking" equal to 1 - Player: Set animation to "Attacking"

Now, what I don't get is how to tell Construct that it should only play the animation ONCE and then return to the "Standing" stance. If I press the Attack key now, the "Attacking" animation will loop with no end.

So what I tried was this:

(Inverted) On "Attack" pressed - Player: Set "IsAttacking' to 0
Value "IsAttacking" equal to 0 - Player: Set animation to "Standing"

That results in the sprite flashing for a tick and nothing else happening. So my guess is that the "press key" only works for a single tick and so does the inverted version - so it tries to start the animation for a tick and immediately sets it back to 0.

But I don't see how I'd set it otherwise. Help! :D
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Mon Feb 02, 2009 8:13 pm

There's a check-box in the animation editor to turn looping on/off for an animation. Then you could use the "Is animation finished?" condition to check if the attacking animation is done playing. If it is, have the animation set back to standing.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon Feb 02, 2009 8:20 pm

Ah, thanks, I didn't know about that condition! :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest