Moderators: GZDoom Developers, Raze Developers
[addmenukey] Y
script 1 (Playsound)
{
Y (Random (1, 10));
}
$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
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.
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.
}
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:
- Code: Select all • Expand view
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.
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:
- Code: Select all • Expand view
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.
}
Only sndinfo looks it's set-up correctly.
gameinfo
{
playerclasses = "AxePlayer"
}
script "taunt" (void)
{
PlaySound(TID, "AxePlayer");
}
[addmenukey] Y
addkeysection
addmenukey "Taunt" oneliner
alias oneliner "puke taunt"
defaultbind "Y" "oneliner"
$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
#library "TAUNTACS"
TAUNTSCR
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:
- Code: Select all • Expand view
#library "TAUNTACS"
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:
- Code: Select all • Expand view
TAUNTSCR
That's it. Your code should now run.
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.
Return to Assets (and other stuff)
Users browsing this forum: No registered users and 0 guests