Alternative attacks
Alternative attacks
I'm currently working on my first Doom mod and i'm starting with new weapon logic. I'm trying to add alternative attacks for each weapon, like in Unreal Tournament, but i'm also looking into adding non-weapon specific attacks: punching, kicking and throwing a grenade. Are there any examples i can find where i can learn more about this non-weapon specific attack modes? Is there any specific changes needed for multiplayer? Where can i find more about bouncing projectiles, like grenades?
Re: Alternative attacks
Look at the Decorate in complex-doom.v26a2.pk3 using Slade 3.
- madcat
- Forum Regular
- Posts: 361
- Joined: Mon Jul 08, 2013 7:16 pm
- Location: Czech republic
- Clan Tag: [Sun]
Re: Alternative attacks
if by "alternative attack" you mean some "third" attack (FIRE being the "first" and ALTFIRE being the "second"), a_jumpifinventory mixed with ACS and KEYCONF is the key. First make an ACS that only gives you a special item, lets call it a "thirdattack", then make a KEYCONF that adds a new bind in the customize controls, executing that ACS (puke). And finally, make the Ready state of your weapon go TNT1 A 0 a_jumpifinventory("ThirdAttack",1,"ThirdFire")
with the first string of the ThirdFire state going a_takeinventory("ThirdAttack",999) followed by the attack of your choice.
with the first string of the ThirdFire state going a_takeinventory("ThirdAttack",999) followed by the attack of your choice.
- fr blood
- Frequent Poster Miles card holder
- Posts: 995
- Joined: Wed Mar 06, 2013 4:04 pm
- Location: France
Re: Alternative attacks
If you are looking for a weapon able to make more than 2 attacks here is an example, hoping you will understand it.
Code: Select all
ACTOR Belphegor-Weapons : Weapon
{
+WEAPON.DONTBOB
+WEAPON.CHEATNOTWEAPON
+WEAPON.AMMO_OPTIONAL
+WEAPON.ALT_AMMO_OPTIONAL
+INVENTORY.UNDROPPABLE
States
{
Ready:
TNT1 A 0 A_GiveInventory("CanHold",1)
TNT1 A 0 A_GiveInventory("CanHalfHold",1)
TNT1 A 0 A_TakeInventory("AttackCharge",10)
BH2D A 1 Bright A_WeaponReady
Loop
Deselect:
BH2D A 1 Bright A_Lower
Loop
Select:
BH2D A 1 Bright A_Raise
Loop
Fire:
BH2D A 1 Bright A_JumpIfInventory("AttackCharge",10,"Fire3")
BH2D A 0 A_GiveInventory("AttackCharge",1)
BH2D A 1 Bright
BH2D A 1 Bright A_Refire
Fire1:
BH2D B 0 A_JumpIfInventory("AttackCharge",10,"Fire3")
BH2D B 0 A_JumpIfInventory("AttackCharge",5,"Fire2")
BH2D B 0 A_TakeInventory("AttackCharge",10)
BH2D BCD 2 Bright
BH2D E 0 A_FireCustomMissile("PlayerCyNobleBall",0,1,0)
BH2D E 0 A_FireCustomMissile("PlayerCyNobleBall",-4,1,0)
BH2D E 3 Bright A_FireCustomMissile("PlayerCyNobleBall",4,1,0)
BH2D FBCD 2 Bright
BH2D E 0 A_FireCustomMissile("PlayerCyNobleBall",0,1,0)
BH2D E 0 A_FireCustomMissile("PlayerCyNobleBall",-4,1,0)
BH2D E 3 Bright A_FireCustomMissile("PlayerCyNobleBall",4,1,0)
BH2D FGHZ 2 Bright
Goto Ready
Fire2:
BH2D B 0 A_GiveInventory("MissileType2")
BH2D B 0 A_GunFlash
BH2D BCD 3 Bright
BH2D EEEEE 0 A_FireCustomMissile("PlayerKnightFastBall",random(-8,8),1,0)
BH2D E 5 Bright A_FireCustomMissile("PlayerKnightFastBall",0,1,0)
BH2D FBCD 3 Bright
BH2D EEEEE 0 A_FireCustomMissile("PlayerKnightFastBall",random(-8,8),1,0)
BH2D E 5 Bright A_FireCustomMissile("PlayerKnightFastBall",0,1,0)
BH2D FBCD 3 Bright
BH2D EEEEE 0 A_FireCustomMissile("PlayerKnightFastBall",random(-8,8),1,0)
BH2D E 5 Bright A_FireCustomMissile("PlayerKnightFastBall",0,1,0)
BH2D FGH 3 Bright
BH2D Z 3 Bright A_TakeInventory("AttackCharge",10)
Goto Ready
Fire3:
BH2D B 0 A_GiveInventory("MissileType3")
BH2D B 0 A_GunFlash
BH2D BCD 3 Bright
BH2D E 0 A_FireCustomMissile("PlayerDukeBall",-4,1,0)
BH2D E 0 A_FireCustomMissile("PlayerDukeBall",4,1,0)
BH2D E 5 Bright A_FireCustomMissile("PlayerDukeBall",0,1,0)
BH2D FGH 3 Bright
BH2D Z 3 Bright A_TakeInventory("AttackCharge",10)
Goto Ready
AltFire:
BH2D A 1 Bright A_JumpIfInventory("AttackCharge",10,"AltFire3")
BH2D A 0 A_GiveInventory("AttackCharge",1)
BH2D A 1 Bright
BH2D A 1 Bright A_Refire
AltFire1:
BH2D I 0 A_JumpIfInventory("AttackCharge",10,"AltFire3")
BH2D I 0 A_JumpIfInventory("AttackCharge",5,"AltFire2")
BH2D I 0 A_TakeInventory("AttackCharge",10)
BH2D I 0 A_GiveInventory("MissileType4")
BH2D I 0 A_GunFlash
BH2D IJK 4 Bright
BH2D L 0 A_FireCustomMissile("PlayerDukeFireSpawner",12,1,0)
BH2D L 0 A_FireCustomMissile("PlayerDukeFireSpawner",-12,1,0)
BH2D L 5 Bright A_FireCustomMissile("PlayerDukeFireSpawner",0,1,0)
BH2D Z 4 Bright
Goto Ready
AltFire2:
BH2D I 0 A_GiveInventory("MissileType5")
BH2D I 0 A_GunFlash
BH2D IJK 4 Bright
BH2D L 0 A_FireCustomMissile("PlayerHDComet",4,1,0)
BH2D L 0 A_FireCustomMissile("PlayerHDComet",-4,1,0)
BH2D L 10 Bright A_FireCustomMissile("PlayerHDComet",0,1,0)
BH2D Z 4 Bright A_TakeInventory("AttackCharge",10)
Goto Ready
AltFire3:
BH2D A 0 A_GiveInventory("MissileType6")
BH2D A 0 A_GunFlash
BH2D IJK 4 Bright
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D LLLLLLLLLLLLLLLL 1 Bright A_SpawnItemEx("PlayerDukeSpike",Random(300,-300),Random(300,-300),0,0,0,0,0,0)
BH2D L 5 Bright
BH2D Z 4 Bright A_TakeInventory("AttackCharge",10)
Goto Ready
Spawn:
TNT1 A 1
Stop
}
}
ACTOR CanHold : Inventory{Inventory.MaxAmount 1}
ACTOR CanHalfHold : Inventory{Inventory.MaxAmount 1}
ACTOR AttackCharge : Inventory{Inventory.MaxAmount 10}