Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

dergyrtundefined

dergyrt

@dergyrt
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
5
Following
5

Posts

Recent Best Controversial

  • Stamina Depletion
    dergyrtundefined dergyrt

    dont think so, that has the same problem, here is my implementation of your formula with a textbox (to verify accuracy):

    updateStamina()
    {
        self endon("disconnect");
    
        if(self hasPerk("specialty_longersprint"))
        {
            self.maxsprintcount = 7.0;
        }
        else
        {
            self.maxsprintcount = 3.5;
        }
        
        self.sprintcount = self.maxsprintcount;
        
        for(;;)
        {
            if(self isSprinting() && self.sprintcount > 0)
            {
                self.sprintcount = self.sprintcount - 0.1;
            }
            else if(self.sprintcount < 0.5)
            {
                self.sprintcount = self.sprintcount + 0.05;
            }
            else if(self.sprintcount < self.maxsprintcount)
            {
                self.sprintcount = self.sprintcount + 0.1;
            }
            
            self.sprintcount = max(0, min(self.sprintcount, self.maxsprintcount));
            
            staminaPercentage = int((self.sprintcount / self.maxsprintcount) * 100);
            
            if(isDefined(self.staminaText))
            {
                self.staminaText setText("Stamina: " + staminaPercentage + "%");
                
                if(staminaPercentage <= 25)
                {
                    self.staminaText.color = (200, 0, 0);
                }
                else
                {
                    self.staminaText.color = (0, 200, 0);
                }
            }
            
            wait 0.05;
        }
    }
    
    BO2 Modding Support & Discussion

  • Stamina Depletion
    dergyrtundefined dergyrt

    Im currently trying to develop a stamina UI, problem is, sometimes it doesnt match the player stamina. For example, if you sprint, jump and repeat these like 4 times you would ran out of stamina even though the bar would not even be at half. Any ideas on whats happening or how the stamina regen or spending works?

    BO2 Modding Support & Discussion
  • 1 / 1
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate