I use the User1 button as a hotkey to throw a frag granade from the players inventory - works fine and dandy BUT:
I'd like to have it that when CountInv says I have the TimeFreeze powerup, and I throw a grenade it slows to a crawl and the gravity on the projectile changes (changing gravity not being a problem here), and when I turn off TimeFreeze, it speeds up again to its default speed. So, I could be throwing a nade in realtime, but on it's way I switch on TimeFreeze and it should slow down and vice versa.
I'm a noob in ZScript but I have this set up so far:
Code: Select all
class FRAG : Grenade
{
Default
{
Speed 20;
Damage 1;
DeathSound "weapons/exp1";
BounceType "Hexen";
BounceFactor 0.5;
WallBounceFactor 0.3;
BounceCount 4;
Scale 0.75;
Gravity 1.0;
Decal "Scorch";
+EXTREMEDEATH;
+NOTIMEFREEZE;
-GRENADETRAIL;
+ALLOWBOUNCEONACTORS;
+BOUNCEONACTORS;
}
States
{
Spawn:
SGRN A 1
{ if (CountInv("PowerTimeFreezerSound", AAPTR_TARGET)>0)
{
Gravity = Default.Gravity*0.25;
Speed = Default.Speed*0.25;
}
else
{
Gravity = Default.Gravity;
Speed = Default.Speed;
}
}
Loop;
Death:
[...]
Big thanks in advance to anybody bothering with this
EDIT: What I probably mean is "velocity". But I can't wrap my head around vector calculation...