Blockland Forums > Modification Help
Player Energy Problem
RedGajin:
I made a player type based off of the Quake player type, and made it so it can only run for a set period of time. The problem is that when it reaches the end of its energy bar, if I try to run, i get a jerky forwards movement as the energy bar reloads it self. I was wondering if I could have the energy bar stop reloading for a certain amount of time. During that time the player would go slower, or just stop in his tries.
--- Code: ---//quakePlayer.cs
//a new player datablock with quake-like movement
datablock PlayerData(PlayerQuakeArmor : PlayerStandardArmor)
{
runForce = 1000 * 900;
runEnergyDrain = 0.2;
minRunEnergy = 1;
maxForwardSpeed = 5.5;
maxBackwardSpeed = 3;
maxSideSpeed = 2.5;
maxForwardCrouchSpeed = 3;
maxBackwardCrouchSpeed = 2;
maxSideCrouchSpeed = 1;
jumpForce = 9 * 90; //8.3 * 90;
jumpEnergyDrain = 20;
minJumpEnergy = 1;
jumpDelay = 10;
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
rechargeRate = 0.04;
uiName = "Quake-Like Player";
showEnergyBar = true;
runSurfaceAngle = 55;
jumpSurfaceAngle = 55;
};
function PlayerQuakeArmor::onDamage(%client, %obj)
{
commandToClient(%obj.client,'bottomPrint',"\c6Damage Level: \c3" @ %obj.getDamageLevel() @ "%", 3);
parent::onDamage(%client, %obj);
}
--- End code ---
The parts I'm talking about are the runEnergy parts and recharge rate.
takato14:
Did you even ask permission to use the Quake-Like Player? If not, then whats the point?
RedGajin:
I'm just messing around with the quake-like player script, not releasing it.
Amade:
--- Quote from: takato14 on June 15, 2010, 02:00:28 PM ---Did you even ask permission to use the Quake-Like Player? If not, then whats the point?
--- End quote ---
Badspot made it. It came with the game. Of course he can use it.
RedGajin:
Ok i tried getstateRecovery and that doesn't work either.
--- Code: ---function PlayerQuakeArmor::onnoEnergy(%client, %obj)
{
%obj.getstateRecover
}##
--- End code ---
The bracket seems to be the problem. i tried putting ; after it, still the same problem. Any solutions?