Simple taunt system? (just sounds, no sprites)
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Simple taunt system? (just sounds, no sprites)
I was wondering how to create a simple taunt system. I have some taunts I created.
-
- Posts: 153
- Joined: Tue Mar 14, 2017 5:18 pm
- Location: Western North Southlandia (East Side)
Re: Simple taunt system? (just sounds, no sprites)
WildWeasel made it as an alt-fire to Melee Attacks in his Diaz mods. It's a very cheap (and fun) way to alert monsters and draw them in.
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
Good idea, but I woud like to make it use a the KEYCONF system.
-
-
- Posts: 1446
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
Re: Simple taunt system? (just sounds, no sprites)
HXRTC Project has such system.
1. ACS
2. Decorate
(this actor is given to player at start: Player.StartItem "HXRTCPlayerTauntingAction", 0x7FFFFFFF)
1. ACS
Code: Select all
#library "taunting"
#include "zcommon.acs"
// SCRIPTS
Script "Taunting" (void)
{
if (UseInventory("HXRTCPlayerTauntingAction"))
{
terminate;
}
}
Code: Select all
ACTOR HXRTCPlayerTauntingAction : CustomInventory
{
Inventory.MaxAmount 0x7FFFFFFF
-INVENTORY.INVBAR
-COUNTITEM
States
{
Use:
TNT1 A 0 A_PlaySound("PlayerTaunting", 2)
TNT1 A 0 A_AlertMonsters
Fail
}
}
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
never used acs, ill try it. how do I make it a hotkey in the KEYCONF?
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Re: Simple taunt system? (just sounds, no sprites)
Here's a way to do it without inventory items, playerpawn replacements or potentially cheat-disabled ACS script puking.
Define the taunt action in a ZScript eventhandler:
Define some sounds to use in SNDINFO:
Enable the ZScript event handler in MAPINFO:
Set a key for it in KEYCONF (same principle works for the ACS+Decorate version, just replace the netevent with using the item):
Define the taunt action in a ZScript eventhandler:
Code: Select all
class TauntHandler:EventHandler{
override void NetworkProcess(ConsoleEvent e){
//check to ensure the acting player can taunt
let ppp=playerpawn(players[e.player].mo);
if(!ppp)return;
if(
e.name~=="taunt"
&&ppp.health>0 //delete if you want corpses taunting the enemy
){
ppp.A_PlaySound("*taunt",CHAN_VOICE);
ppp.A_TakeInventory("powerfrightener");
ppp.A_AlertMonsters();
}
}
Code: Select all
$playersound player male *taunt swivethyselfm
$playersound player female *taunt swivethyselff
Code: Select all
addeventhandlers="TauntHandler"
Code: Select all
//this creates a command to activate the netevent
//though you could probably just call this directly too
alias taunt "netevent taunt";
//adds the taunt to the menu (optional)
addmenukey "Taunt" taunt
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
This is what I get when I put in the eventhandler in mapinfo.
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Re: Simple taunt system? (just sounds, no sprites)
Which version of GZDoom are you using, and can you show the Mapinfo lump?
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
I currently updated it to v3.3.2.
Code: Select all
gameinfo
{
PlayerClasses = "Kennic"
}
AddEventHandlers = "TauntHandler"
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Re: Simple taunt system? (just sounds, no sprites)
That line belongs in the gameinfo block.
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
Now I get another error, Script error, "SE.pk3:acs/taunt.txt" line 1:
Expected '{', got 'TauntHandler:EventHandler"
Expected '{', got 'TauntHandler:EventHandler"
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Re: Simple taunt system? (just sounds, no sprites)
It's ZScript not ACS, so it should go into the zscript.txt (or a filed #included in it).
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
Its one error after another.
"1 errors while parsing SE.pk3:zscript.txt"
"Script error, "SE.pk3:zscript.txt" line 17:
Unexpected end of file
Expecting '.' or 'class' or identifier or 'native' or 'ui' or 'play' or 'version' or 'color' or 'clearscope' or 'int8' or 'uint8' or 'int16' or 'uint16' or 'int' or 'uint' or 'bool' or 'float' or 'double' or 'vector2' or 'vector3' or 'name' or 'sound' or 'state' or 'let' or '@' or 'readonly' or 'map' or 'array' or 'void' or 'action' or 'deprecated' or 'static' or 'private' or 'protected' or 'latent' or 'final' or 'meta' or 'transient' or 'virtual' or 'override' or 'vararg' or 'virtualscope"
"1 errors while parsing SE.pk3:zscript.txt"
"Script error, "SE.pk3:zscript.txt" line 17:
Unexpected end of file
Expecting '.' or 'class' or identifier or 'native' or 'ui' or 'play' or 'version' or 'color' or 'clearscope' or 'int8' or 'uint8' or 'int16' or 'uint16' or 'int' or 'uint' or 'bool' or 'float' or 'double' or 'vector2' or 'vector3' or 'name' or 'sound' or 'state' or 'let' or '@' or 'readonly' or 'map' or 'array' or 'void' or 'action' or 'deprecated' or 'static' or 'private' or 'protected' or 'latent' or 'final' or 'meta' or 'transient' or 'virtual' or 'override' or 'vararg' or 'virtualscope"
-
- Posts: 532
- Joined: Tue Jun 17, 2014 11:22 pm
- Graphics Processor: nVidia (Legacy GZDoom)
Re: Simple taunt system? (just sounds, no sprites)
And this is the code I copied earlier that is causing the current issue:
Code: Select all
class TauntHandler:EventHandler
{
override void NetworkProcess(ConsoleEvent e)
{
//check to ensure the acting player can taunt
let ppp=playerpawn(players[e.player].mo);
if(!ppp)return;
if(
e.name~=="taunt"
&&ppp.health>0 //delete if you want corpses taunting the enemy
){
ppp.A_PlaySound("*taunt",CHAN_VOICE);
ppp.A_TakeInventory("powerfrightener");
ppp.A_AlertMonsters();
}
}
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Re: Simple taunt system? (just sounds, no sprites)
Sorry, should've been this
[multiple deletes and reposts later] FOR FUCK'S SAKE here I'll attach the txt file the forum can't take multiple tabs for whatever stupid reason
[multiple deletes and reposts later] FOR FUCK'S SAKE here I'll attach the txt file the forum can't take multiple tabs for whatever stupid reason
You do not have the required permissions to view the files attached to this post.