One-Liners / Taunt button?
Moderators: GZDoom Developers, Raze 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.
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.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
One-Liners / Taunt button?
I have a set of 40 one-liners recorded and ready for my player character to use when taunting a monster. But the problem is, I don't know how to make a taunt command in the code? I need there to be a particular key that can be pressed and it will allow the game to randomly pick a one-liner from my list of 40 each time it is pressed. I have seen brutal doom (i think) use a taunt button so is there a way I can include it in mine?
Also, I wonder if it is possible to have a similar feature for when you dispatch a monster - ie; a monster pops up and says "i'll kill you" and when you kill it, your player comes back with a cocky one-liner randomly picked from a selection of responses. Is this possible? Thing of something along the lines of ASH from EVIL DEAD.
Please help, it is much appreciated. Thank you in advance.
Also, I wonder if it is possible to have a similar feature for when you dispatch a monster - ie; a monster pops up and says "i'll kill you" and when you kill it, your player comes back with a cocky one-liner randomly picked from a selection of responses. Is this possible? Thing of something along the lines of ASH from EVIL DEAD.
Please help, it is much appreciated. Thank you in advance.
-
- Admin
- Posts: 6190
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: One-Liners / Taunt button?
For the taunt key:
1. [wiki]SNDINFO[/wiki] - Define your sounds with logical names
2. [wiki]KEYCONF[/wiki] - Create a [addmenukey] which will execute a script on a buttonpress.
3. [wiki]ACS[/wiki] - Set up the script which will be executed when you press the button.
--a. [wiki]Random[/wiki] - Pick a random number
--b. [wiki]A quick beginner's guide to ACS[/wiki] - See "flow control" For if/then statements to decide which sound based on the random number
--c. [wiki]PlaySound[/wiki] - The ACS command to play your defined sounds.
For the monster deaths, have the monsters call a similar script in their death state to play different sounds.
1. [wiki]SNDINFO[/wiki] - Define your sounds with logical names
2. [wiki]KEYCONF[/wiki] - Create a [addmenukey] which will execute a script on a buttonpress.
3. [wiki]ACS[/wiki] - Set up the script which will be executed when you press the button.
--a. [wiki]Random[/wiki] - Pick a random number
--b. [wiki]A quick beginner's guide to ACS[/wiki] - See "flow control" For if/then statements to decide which sound based on the random number
--c. [wiki]PlaySound[/wiki] - The ACS command to play your defined sounds.
For the monster deaths, have the monsters call a similar script in their death state to play different sounds.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Thank you so much for the quick response ... do you have any examples I can look at?
-
- Admin
- Posts: 6190
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: One-Liners / Taunt button?
Not really, I'm at work right now. Sorry.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Oh thank you anyway. I'm really having trouble getting this to work. I'm pretty certain I'm doing the whole coding set up wrong. If anyone can show me an example I would be so grateful.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Okay, I'm not having any luck. If anyone out there knows how to help me structure this they would be the bomb for helping me. I've spent about God-knows how many hours on this so far and still nothing. I have now over 70 one-liners all in the wad but no way to get them working. I know it has something to do with what Caligari87 posted but I really don't know where to start.
Please help if you can.
This is my code so far:
KEYCONF
ACS
SNDINFO
I know I'm doing this wrong.... badly. I need the Y button to play random one-liners. What am I doing wrong here?
Please help if you can.
This is my code so far:
KEYCONF
Code: Select all
[addmenukey] Y
Code: Select all
script 1 (Playsound)
{
Y (Random (1, 10));
}
Code: Select all
$random Taunts/Ash { Taunts/Taunt01 Taunts/Taunt02 Taunts/Taunt03 Taunts/Taunt04 }
ash/taunt01 ASHT01
ash/taunt02 ASHT02
ash/taunt03 ASHT03
ash/taunt04 ASHT04
ash/taunt05 ASHT05
ash/taunt06 ASHT06
ash/taunt07 ASHT07
ash/taunt08 ASHT08
ash/taunt09 ASHT09
ash/taunt10 ASHT10
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Can anyone help me with this? I'm still having Hell getting this to work.
-
- Posts: 1556
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: One-Liners / Taunt button?
You should start at wiki, acs reference...
1. You have defined a key, but you have not defined what your key should do. How the engine should.know, that pressing a Y should trigger the script?
It should look like this:
2. Script could have a OPEN, ENTEr, etc. (playsound) is nonsense. Looks like you really dont know how ro set up a script. So, open zdoom wiki, head over to "ACS reference" and read the basics.
Soo, you want a user called script. Something like this:
Only sndinfo looks it's set-up correctly.
1. You have defined a key, but you have not defined what your key should do. How the engine should.know, that pressing a Y should trigger the script?
It should look like this:
Code: Select all
alias player_taunt "pukename taunt" //"player_taunt " is a menu reference, "pukename..." is console command referencing the script you want
defaultBind "K" "player_taunt " //defaultbind with the menu reference
addMenuKey "Taunt" player_taunt //and this allows you to re-assign the key to your desire.
Soo, you want a user called script. Something like this:
Code: Select all
script "taunt" (void) //you want the user to call the script, so "(void)" is a thing here.
{
PlaySound(TID, "yoursound"); //the sound has to beplayed from something. For player taunts, I advise you use the player's TID. So unique TID for player is a good thing to have.
}
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Thank you so much for your response. Where about to I put these code examples? In the WAD, do they go in Language, KEYCONF, SNDINFO, etc...? or do I make a whole ACS entry with all of this inside it?ramon.dexter wrote:You should start at wiki, acs reference...
1. You have defined a key, but you have not defined what your key should do. How the engine should.know, that pressing a Y should trigger the script?
It should look like this:2. Script could have a OPEN, ENTEr, etc. (playsound) is nonsense. Looks like you really dont know how ro set up a script. So, open zdoom wiki, head over to "ACS reference" and read the basics.Code: Select all
alias player_taunt "pukename taunt" //"player_taunt " is a menu reference, "pukename..." is console command referencing the script you want defaultBind "K" "player_taunt " //defaultbind with the menu reference addMenuKey "Taunt" player_taunt //and this allows you to re-assign the key to your desire.
Soo, you want a user called script. Something like this:Only sndinfo looks it's set-up correctly.Code: Select all
script "taunt" (void) //you want the user to call the script, so "(void)" is a thing here. { PlaySound(TID, "yoursound"); //the sound has to beplayed from something. For player taunts, I advise you use the player's TID. So unique TID for player is a good thing to have. }
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Okay I still can't get it working. Here is my complete code setup.
MAPINFO
LOADACS
KEYCONF
SNDINFO
What is wrong with this? I tried to follow it well but something just ain't having it. Help please.
Thanks in advance.
MAPINFO
Code: Select all
gameinfo
{
playerclasses = "AxePlayer"
}
Code: Select all
script "taunt" (void)
{
PlaySound(TID, "AxePlayer");
}
Code: Select all
[addmenukey] Y
addkeysection
addmenukey "Taunt" oneliner
alias oneliner "puke taunt"
defaultbind "Y" "oneliner"
Code: Select all
$random Taunt/Ash { Taunts/Taunt01 Taunts/Taunt02 Taunts/Taunt03 Taunts/Taunt04 Taunts/Taunt05 Taunts/Taunt06 Taunts/Taunt07 Taunts/Taunt08 Taunts/Taunt09 Taunts/Taunt10 }
ash/taunt01 ASHT01
ash/taunt02 ASHT02
ash/taunt03 ASHT03
ash/taunt04 ASHT04
ash/taunt05 ASHT05
ash/taunt06 ASHT06
ash/taunt07 ASHT07
ash/taunt08 ASHT08
ash/taunt09 ASHT09
ash/taunt10 ASHT10
Thanks in advance.
-
- 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: One-Liners / Taunt button?
LOADACS isn't where to put ACS code. You need to create an ACS script (name it anything you like, like TAUNTSCR or something), make sure it's defined as a library at the top:
Remember what the library name is! Then compile it, and rename the output (it'll probably come up as a lump named BEHAVIOR, or TAUNTSCR.o in /scripts/ if it's a PK3 file) to match the #library name.
Then just add this to LOADACS:
That's it. Your code should now run.
Code: Select all
#library "TAUNTACS"
Then just add this to LOADACS:
Code: Select all
TAUNTSCR
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
Thank you so much. But how do I compile this? I've done as you said, made a new entry and did the #library "TAUNTACS" but it just saved as a random text file. How do I compile it? When I click compile I'm getting an error. I've attached a screenshot of it.wildweasel wrote:LOADACS isn't where to put ACS code. You need to create an ACS script (name it anything you like, like TAUNTSCR or something), make sure it's defined as a library at the top:Remember what the library name is! Then compile it, and rename the output (it'll probably come up as a lump named BEHAVIOR, or TAUNTSCR.o in /scripts/ if it's a PK3 file) to match the #library name.Code: Select all
#library "TAUNTACS"
Then just add this to LOADACS:That's it. Your code should now run.Code: Select all
TAUNTSCR
Also, where do I add TAUNTSCR in the LOADACS? Just on its own or somewhere particular?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
edit: i just downloaded an acc compiler but now its doing nothing. I click on it, nothing happens. Screen flashes for a millisecond and nothing happens.
-
- 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: One-Liners / Taunt button?
You have to tell SLADE where ACC is, and then compile it from within there. TAUNTSCR is just the source code for your script; GZDoom does nothing with it on its own, and you technically don't even need to have it in your file, but it's usually a nice courtesy to leave it in there after you've compiled it.
-
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
Re: One-Liners / Taunt button?
But I downloaded the ACC program, told the SLADE where it is in the preferences... but now when I click on the "compile ACS" it just makes the screen give a very quick flicker white and nothing happens. Like it didn't do anything. No lump has been made to my knowledge. Its not in my wad, or any folders connected to it? Do you know why its doing this?wildweasel wrote:You have to tell SLADE where ACC is, and then compile it from within there. TAUNTSCR is just the source code for your script; GZDoom does nothing with it on its own, and you technically don't even need to have it in your file, but it's usually a nice courtesy to leave it in there after you've compiled it.
There is a file at the very bottom of my wad with the same name ie; TAUNTSCR but its called "unknown" and its not triggering my Y button to taunt in game. Am I missing something am I doing something wrong here? Where do I add the TAUNTACS into the LOADAcs file?
Thanks in advance.