Page 1 of 1
Knifing Key
Posted: Wed Jun 20, 2012 5:23 am
by Hece
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?
RE: Knifing Key
Posted: Wed Jun 20, 2012 6:31 am
by Sergeant_Mark_IV
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.
RE: Knifing Key
Posted: Wed Jun 20, 2012 8:14 am
by Ijon Tichy
+NOALERT for all your not-alerting-monster needs
use A_AlertMonsters to explicitly alert
RE: Knifing Key
Posted: Wed Jun 20, 2012 3:47 pm
by Shoggy
would be cool if someone can make a mod so ppl can knife like counterstrike
RE: Knifing Key
Posted: Thu Jun 21, 2012 6:44 am
by Hece
Shoggy wrote:
would be cool if someone can make a mod so ppl can knife like counterstrike
Do you mean that it knifes differently in AltFire?
RE: Knifing Key
Posted: Mon Jun 25, 2012 4:31 pm
by Shoggy
Hece wrote:
Shoggy wrote:
would be cool if someone can make a mod so ppl can knife like counterstrike
Do you mean that it knifes differently in AltFire?
In the game counsterstrike, i believe slashes (primary fire) do about 20-25% damage
and stabs (alt fire) do about 45-50% damage
Example of counterstrike knifing
The [video] tag is deprecated, please use the [media] tag