I have a projectile that is supposed to push the player back, but it won't work no matter what I set
verticalImpulse and impactImpulse to.
Also, I have a couple sounds that won't work in game, and I can't figure out why.datablock ProjectileData(FLUDDProjectile)
{
directDamage = 0.5;
directDamageType = $DamageType::FLUDD;
explosion = FLUDDExplosion;
verticalImpulse = 1000;
impactImpulse = 1000;
muzzleVelocity = 25;
velInheritFactor = 1;
armingDelay = 0;
lifetime = 300;
fadeDelay = 0;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0;
uiName = "FLUDD Squirt";
};
Also, I have this weird GUI position issue. I have a HUD that displays how much water you have left:
Below is what I use to calculate the position and extent of the water tank. The problem is, instead of the extent going down and the position going up by the amount that the extent went down, the extent goes down and the position goes up and then it goes down back down, lower than it was before.
function clientCmdSetFLUDDWater(%num)
{
FLUDD_TankTop.setVisible(0);
if(%num <= 0)
{
FLUDD_TankLeft.setVisible(0);
FLUDD_TankRight.setVisible(0);
return;
}
FLUDD_TankLeft.setVisible(1);
FLUDD_TankRight.setVisible(1);
if(%num >= $MaxFLUDDWater)
{
FLUDD_TankTop.setVisible(1);
FLUDD_TankLeft.position = "29 38";
FLUDD_TankRight.position = "47 40";
FLUDD_TankTop.position = "26 30";
FLUDD_TankLeft.extent = "22 61";
FLUDD_TankRight.extent = "24 59";
FLUDD_TankTop.extent = "49 22";
return;
}
%prevLeftTankExtent = restWords(FLUDD_TankLeft.getExtent());
%prevRightTankExtent = restWords(FLUDD_TankRight.getExtent());
%leftTankExtent = mFloor((getSubStr(%num / $MaxFLUDDWater, 0, 4) * 61) + 0.5);
%rightTankExtent = mFloor((getSubStr(%num / $MaxFLUDDWater, 0, 4) * 59) + 0.5);
echo(%prevLeftTankExtent SPC "-" SPC %leftTankExtent);
echo(%prevLeftTankExtent - %leftTankExtent);
%leftTankPos = %prevLeftTankExtent - %leftTankExtent;
%leftTankPos = restWords(FLUDD_TankLeft.getExtent()) + %leftTankPos;
%rightTankPos = %prevRightTankExtent - %rightTankExtent;
%rightTankPos = restWords(FLUDD_TankRight.getExtent()) + %rightTankPos;
FLUDD_TankLeft.extent = "22" SPC %leftTankExtent;
FLUDD_TankRight.extent = "24" SPC %rightTankExtent;
FLUDD_TankLeft.position = "29" SPC %leftTankPos;
FLUDD_TankRight.position = "47" SPC %rightTankPos;
echo("New left tank pos:" SPC FLUDD_TankLeft.position);
}