Simple taunt system? (just sounds, no sprites)

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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.

Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Sun May 06, 2018 5:24 pm

I was wondering how to create a simple taunt system. I have some taunts I created.
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby NeoTerraNova » Sun May 06, 2018 6:05 pm

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.
User avatar
NeoTerraNova
 
Joined: 14 Mar 2017
Location: Western North Southlandia (East Side)

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 4:02 am

Good idea, but I woud like to make it use a the KEYCONF system.
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby m8f » Mon May 07, 2018 4:20 am

HXRTC Project has such system.
1. ACS
Code: Select allExpand view
#library "taunting"
#include "zcommon.acs"

// SCRIPTS

Script "Taunting" (void)
{
        if (UseInventory("HXRTCPlayerTauntingAction"))
        {
                terminate;
        }
}


2. Decorate
Code: Select allExpand view
ACTOR HXRTCPlayerTauntingAction : CustomInventory
{
        Inventory.MaxAmount 0x7FFFFFFF
        -INVENTORY.INVBAR
        -COUNTITEM
        States
        {
        Use:
                TNT1 A 0 A_PlaySound("PlayerTaunting", 2)
                TNT1 A 0 A_AlertMonsters
                Fail
        }
}

(this actor is given to player at start: Player.StartItem "HXRTCPlayerTauntingAction", 0x7FFFFFFF)
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 3:13 pm

never used acs, ill try it. how do I make it a hotkey in the KEYCONF?
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby Matt » Mon May 07, 2018 4:13 pm

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:
Code: Select allExpand view
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>//delete if you want corpses taunting the enemy
        ){
            ppp.A_PlaySound("*taunt",CHAN_VOICE);
            ppp.A_TakeInventory("powerfrightener");
            ppp.A_AlertMonsters();
        }
}


Define some sounds to use in SNDINFO:
Code: Select allExpand view
$playersound    player    male    *taunt        swivethyselfm
$playersound    player    female    
*taunt        swivethyselff


Enable the ZScript event handler in MAPINFO:
Code: Select allExpand view
addeventhandlers="TauntHandler"


Set a key for it in KEYCONF (same principle works for the ACS+Decorate version, just replace the netevent with using the item):
Code: Select allExpand view
//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
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 5:15 pm

This is what I get when I put in the eventhandler in mapinfo.
Image
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby wildweasel » Mon May 07, 2018 6:13 pm

Which version of GZDoom are you using, and can you show the Mapinfo lump?
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 16 Jul 2003

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 6:31 pm

I currently updated it to v3.3.2.

Code: Select allExpand view
gameinfo
{
   PlayerClasses = "Kennic"
}

   AddEventHandlers = "TauntHandler"
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby wildweasel » Mon May 07, 2018 6:34 pm

That line belongs in the gameinfo block.
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 16 Jul 2003

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 7:02 pm

Now I get another error, Script error, "SE.pk3:acs/taunt.txt" line 1:
Expected '{', got 'TauntHandler:EventHandler"
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby Matt » Mon May 07, 2018 7:19 pm

It's ZScript not ACS, so it should go into the zscript.txt (or a filed #included in it).
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 7:36 pm

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"
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby Graaicko » Mon May 07, 2018 7:40 pm

And this is the code I copied earlier that is causing the current issue:

Code: Select allExpand view
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();
        }
}
User avatar
Graaicko
I don't do requests. Working on Shadow Elite. I miss Windows 7. :(
 
Joined: 18 Jun 2014
Location: Somewhere, somehow.
Discord: private
Twitch ID: lol why?
Github ID: gitgud, pleb
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: Simple taunt system? (just sounds, no sprites)

Postby Matt » Mon May 07, 2018 11:31 pm

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
Attachments
taunthandlerzscript.txt
(423 Bytes) Downloaded 63 times
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest