How to make quick knifing when you press, for example, Q or grenade throw form G?
I tried to look this up form WAD scripts but didn't get it.
And is there actor flag/property if I want to make weapon silent, so the monsters wont hear it?
Knifing Key
Knifing Key
Last edited by Hece on Wed Jun 20, 2012 6:22 am, edited 1 time in total.
-
- Posts: 82
- Joined: Tue Jun 05, 2012 4:17 am
- Location: Brazil
RE: Knifing Key
Well, its a bit complicated. You will need to know about DECORATE, KEYCONF, and ACS to do it.
First of all, you need to make a custom inventory DECORATE item
Actor UseKnife : Inventory
{
inventory.maxamount 1
}
Now you need to make the following ACS script
(I'm suggesting the script number 600. But you can use any number you want)
script 600 (void)
{
GiveInventory("UseKnife", 1);
}
Use Slade 3 ACS compiler to compile your script. If you don't know how to properly implement scripts in a wad or pk3 (they use different ways to read scripts) Read the Zdoom WIki for more info.
Now in your KEYCONF lump, you must bind a key to give the UseKnife inventory
addkeysection "New Actions" NewActions
addmenukey "Knife" knifeattack
alias knifeattack "puke 600"
defaultbind Q knifeattack
This will make the game start the script 600 whenever you press Q.
PS: If you want to make another script to make a throwable grenade, you don't need to write the "addkeysection "New Actions" NewActions " again. You only need to write this line once.
Now, in all your weapon Ready states, you need to make it jump to another state which uses the knife to attack.
Something like this:
Ready:
PISG A 1 A_WeaponReady
PISG A 0 A_JumpIfInventory("UseKnife", 1, "KnifeAttack")
Loop
This will make the weapon always jump to a state called KnifeAttack if you have the custom inventory item.
KnifeAttack:
KNIF A 2 asoihfoasfh do your stuff
// // // // // // //
// // // // // // //
TNT1 A 0 A_TakeInventory("UseKnife", 1)
Goto Ready
This take inventory line is important to make the DECORATE know that you already performed the knife attack, and prevent it from looping the animation.
First of all, you need to make a custom inventory DECORATE item
Actor UseKnife : Inventory
{
inventory.maxamount 1
}
Now you need to make the following ACS script
(I'm suggesting the script number 600. But you can use any number you want)
script 600 (void)
{
GiveInventory("UseKnife", 1);
}
Use Slade 3 ACS compiler to compile your script. If you don't know how to properly implement scripts in a wad or pk3 (they use different ways to read scripts) Read the Zdoom WIki for more info.
Now in your KEYCONF lump, you must bind a key to give the UseKnife inventory
addkeysection "New Actions" NewActions
addmenukey "Knife" knifeattack
alias knifeattack "puke 600"
defaultbind Q knifeattack
This will make the game start the script 600 whenever you press Q.
PS: If you want to make another script to make a throwable grenade, you don't need to write the "addkeysection "New Actions" NewActions " again. You only need to write this line once.
Now, in all your weapon Ready states, you need to make it jump to another state which uses the knife to attack.
Something like this:
Ready:
PISG A 1 A_WeaponReady
PISG A 0 A_JumpIfInventory("UseKnife", 1, "KnifeAttack")
Loop
This will make the weapon always jump to a state called KnifeAttack if you have the custom inventory item.
KnifeAttack:
KNIF A 2 asoihfoasfh do your stuff
// // // // // // //
// // // // // // //
TNT1 A 0 A_TakeInventory("UseKnife", 1)
Goto Ready
This take inventory line is important to make the DECORATE know that you already performed the knife attack, and prevent it from looping the animation.
-
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Knifing Key
+NOALERT for all your not-alerting-monster needs
use A_AlertMonsters to explicitly alert
use A_AlertMonsters to explicitly alert
RE: Knifing Key
would be cool if someone can make a mod so ppl can knife like counterstrike
RE: Knifing Key
Do you mean that it knifes differently in AltFire?Shoggy wrote: would be cool if someone can make a mod so ppl can knife like counterstrike
RE: Knifing Key
In the game counsterstrike, i believe slashes (primary fire) do about 20-25% damageHece wrote:Do you mean that it knifes differently in AltFire?Shoggy wrote: would be cool if someone can make a mod so ppl can knife like counterstrike
and stabs (alt fire) do about 45-50% damage
Example of counterstrike knifing
The [video] tag is deprecated, please use the [media] tag