Stamina Regen problem

Get help using Construct 2

Post » Thu Jul 17, 2014 2:05 pm

Exactly, just use your current equation and suctract from currentStamina.
Also don't forget to limit min and maximum stamina after all calculations are done, if currentStamina < 0, currentStamina = 0, else if currentStamina > maxStamina, currentStamina = maxStamina.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Jul 17, 2014 3:19 pm

Saw your comment after I had posted! Thanks, now it makes sense.

Thanks!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jul 23, 2014 12:50 am

I updated the main post since I don't seem to be getting anywhere. I can get it working directly on the bar, but not by using variables.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jul 23, 2014 7:07 am

looking at the debugger currentstamina goes directly to 0 when moving..

Also I can see you are setting the width of the staminabar in th stamina-consumption eventsheet and in the hud event sheet..
it makes it very unclear for me to get an overview of what the actions should be..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 23, 2014 4:59 pm

@LittleStain, you are right. I added the bar update with the values twice. Should instead stay in the HUD sheet. My idea is to deal with the values (since later they will be modified by a simple level up system). The way I understand it, I should add my variables and then update the bar with the values based off currentStamina and maxStamina.

The reason I added a Stamina Consumption sheet is mainly because every action uses a different amount of stamina. Some actions use a constant value and others such as running are based on the duration of the action.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Thu Jul 24, 2014 4:47 pm

Sorry for the shameless bump! :)
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sat Jul 26, 2014 12:33 am

Nevermind, and thanks again. I reorganized my code based on the previous help and took the time to see where the problems lied.

Cheers!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests