lizardcommando wrote:Alright, so I'm trying to figure out how to have grenades you can use at any time while using any weapon like in Call of Duty 4, however, I want it so that it'll play the animation of the player throwing the grenade. How would I go about and doing that?
TNT1 A 0 A_JumpIfInventory("FistsSelected", 1, "FistsStand")In the Mutiny (and Hexen come to think of it) I'm pretty sure it's a CustomInventory "Use" state that shoots the projectile. This is the simplest method but the grenade spawns instantly without any animation.lizardcommando wrote:Alright, so I'm trying to figure out how to have grenades you can use at any time while using any weapon like in Call of Duty 4, however, I want it so that it'll play the animation of the player throwing the grenade. How would I go about and doing that?
ACTOR Colt1911 : Weapon replaces Pistol
{
+NOALERT
+NOAUTOFIRE
Weapon.SelectionOrder 1000
Weapon.AmmoUse 1
Weapon.AmmoUse2 0
Weapon.SlotNumber 2
Weapon.AmmoGive 10
Weapon.AmmoType "Clip"
//AttackSound "weapons/coltfire"
Obituary "%o was capped by %k's Colt 1911."
+WEAPON.WIMPY_WEAPON
Inventory.Pickupmessage "Picked up a Colt 1911."
States
{
Ready:
TNT1 A 0 A_JumpIfInventory("TossGrenade", 1, "GrenadeThrow")
1911 A 1 A_WeaponReady
Loop
Deselect:
1911 A 1 A_Lower
Loop
Select:
1911 A 1 A_Raise
Loop
Fire:
1911 A 1
1911 B 0 A_AlertMonsters
1911 B 1 Bright A_PlayWeaponSound("weapons/coltfire")
1911 B 1 Bright A_FireBullets(3,2,-1,7,"BULLETPUFF",1,0)
1911 C 1
1911 D 2
1911 E 1
1911 D 1
Goto Ready
GrenadeThrow:
TNT1 A 0 A_JumpIfInventory("grenadepickup", 1, 2)
GRWU AB 3
GREN ABC 3
GREN D 4 A_PlayWeaponSound("weapons/pinpull")
GREN E 3
TNT1 A 6
GREN F 2 A_PlayWeaponSound("weapons/grenadethrow")
GREN G 2 A_FireCustomMissile("GrenadeObj",-1,1,3,2)
TNT1 A 0 A_TakeInventory("grenadepickup",1,TIF_NOTAKEINFINITE)
GREN HI 2
TNT1 A 4
Goto Ready
AltFire:
KICK A 2 A_PlayWeaponSound("weapons/kickgo")
KICK B 2
KICK C 0 A_Recoil(-5)
KICK C 2 A_CUSTOMPUNCH(10,0,0,"KickPuff")
KICK B 3
Goto Ready
Spawn:
PIST A -1
Stop
}
}
GrenadeThrow:
TNT1 A 0 A_JumpIfInventory("grenadepickup", 1, "GrenadeReallyThrow")
GRWU AB 3 //play these frames and cancel attack, if there are no more grenades left
TNT1 A 0 A_TakeInventory("GrenadeThrowFlagOrWhateverYouNamedIt",999999) //EDIT: gotta remove this or you're stuck in a loop, zero or otherwise
TNT1 A 0 A_Jump(256,"Ready")
GrenadeReallyThrow:
GREN ABC 3 // continue attack
...Users browsing this forum: gamefreakdude, Kinsie, The Zombie Killer, Turbo and 8 guests