Simple taunt system? (just sounds, no sprites)

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!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Simple taunt system? (just sounds, no sprites)

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

by Graaicko » Tue May 08, 2018 11:03 am

I know, that was absolute herpes. It finally works though. Here is a video. Don't mind the sky textures. lol

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

by Matt » Tue May 08, 2018 1:36 am

Works for me. What version of GZDoom?

EDIT: This is unworkable at this rate - exchanging snippets and error messages like this I have no idea what you did or did not do on your end so code that works for me may work for you and code that works for you might not work for me. Here, just look at this and figure it out.
Attachments
fuckyourself.zip
(1.03 KiB) Downloaded 138 times

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

by Graaicko » Tue May 08, 2018 12:28 am

Still get this bullshit error.
Image

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

by 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 138 times

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

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

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();
        }
}

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

by 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"

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

by 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).

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

by 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"

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

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

That line belongs in the gameinfo block.

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

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

I currently updated it to v3.3.2.

Code: Select all

gameinfo
{
   PlayerClasses = "Kennic"
}

   AddEventHandlers = "TauntHandler"

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

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

Which version of GZDoom are you using, and can you show the Mapinfo lump?

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

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

This is what I get when I put in the eventhandler in mapinfo.
Image

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

by 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 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();
        }
}
Define some sounds to use in SNDINFO:

Code: Select all

$playersound    player    male    *taunt        swivethyselfm
$playersound    player    female    *taunt        swivethyselff
Enable the ZScript event handler in MAPINFO:

Code: Select all

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 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

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

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

never used acs, ill try it. how do I make it a hotkey in the KEYCONF?

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

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

HXRTC Project has such system.
1. ACS

Code: Select all

#library "taunting"
#include "zcommon.acs"

// SCRIPTS

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

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
        }
}
(this actor is given to player at start: Player.StartItem "HXRTCPlayerTauntingAction", 0x7FFFFFFF)

Top