Serious Sam 4

Serious Sam 4

28 ratings
Taunts/Voicelines for Player Models
3
2
   
Award
Favorite
Favorited
Unfavorite
Content: Player Models
Type: Additions
File Size
Posted
Updated
1.510 MB
14 Apr, 2021 @ 6:59am
17 May, 2021 @ 6:06am
2 Change Notes ( view )

Subscribe to download
Taunts/Voicelines for Player Models

Description
This mod adds the ability to play custom animations ("Taunts") and sounds ("Voicelines") on player models. This mod doesn't add taunts/voicelines to any existing models, it is simply an instrument to enable this feature. Creators of player models should add taunts to their models if they wish so.

To invoke the Taunts/Voiceline selection menu, hold the "Taunts/Voicelines" key which you should bind in the Keyboard settings first:

When the menu is open, move the mouse around to select one of the taunts/voicelines and release the key to play it.
Note that the host of the game must have this mod in order for it to work.

Basic setup
If you are a modder who wishes to add Taunts to your model, simply add them as animations named as one of the following: "Taunt01", "Taunt02", "Taunt03" or "Taunt04". Similar for voicelines - you should add them to your model's Sound Scheme as terms named "Voiceline01", "Voiceline02" and so on. Then, if such animations/sounds exist, they will be played by the script when the user selects them.

Note that taunt animations override all bones, even if not all bones are used in the animation, so account for that. If you want the player to be unable to move while playing the animation, create new custom envelope named "ModelMover" in your animation.

You can also make taunt animation cancellable by pressing movement keys. To implement this, in the taunt animation add "Throw macro event" event, choose frame X and insert TauntCanStop into the event name field. Now, when you character plays a taunt animation, you will be able to cancel it after frame X has been reached, by pressing movement keys.

Testing in SED: Unfortunately, Serious Editor does not support custom player commands, so you can't have the "Taunts/Voicelines" key in there. To test your taunts/voicelines right in the editor, place a script on a map with the following line of code:
worldGlobals.bDebugTaunts = true
After doing that, you can invoke the taunts menu in SED by holding the "Sprint" key (Left Shift).

Advanced setup
This mod also allows to (1) set up custom names for the taunts/voicelines (displayed in the selection wheel) and (2) spawn projectiles and health/armor items during taunting.

For this, you will need to create a script and save it into the folder Content/SeriousSam4/Scripts/CustomWorldScripts containing the code in the following form:
if (worldGlobals.TV_CustomParams == nil) then worldGlobals.TV_CustomParams = {} end worldGlobals.TV_CustomParams[strModelPath] = { Taunt01 = TableWithParams, Taunt02 = TableWithParams02, ... }

where TableWithParams are Lua tables containing certain additional information about the Taunt/Voiceline for the model by the path strModelPath. Let us look at an example:

worldGlobals.TV_CustomParams["Content/SeriousSam4/Models/Player/Pans/Tea/Tea.mdl"] = { Taunt01 = {name = "Shoot\nRocket", proj = "Content/SeriousSam4/Databases/Projectiles/Rocket_Player.ep", projVel = 300, projSource = "TauntProjectile01", }, Taunt02 = {name = "Spawn Medkit", item = "Health25", itemSource = "TauntProjectile01", itemVel = {0,5,-5}, }, }

Here, each table with params contains 4 fields.
name is an optional field specifying the name under which the Taunt/Voiceline will be displayed in the wheel. Note the \n - this is the newline character ro display the name on two lines.

proj is an optional field specifying the path to the projectile which may (or may not) be fired during this taunt. If this field is set, the next two fields projSource and projVel must also be set, specifying the source attachment of the projectile and its launch velocity.

item is an optional field specifying the type of a Health/Armor item which may (or may not) be spawned during this taunt. It can assume one of the 6 values: "Health10", "Health25", "Health50", "Armor10", "Armor25", "Armor50". If this field is set, the next two fields itemSource and itemVel must also be set, specifying the source attachment of the item spawn and its launch velocity. Note that here the velocity is a table of three numbers specifying the vector of the launch velocity of the item (relative to the model orientation).

After setting up such a script and saving it in Content/SeriousSam4/Scripts/CustomWorldScripts, you must add a macro event TauntProjectile into your taunt animation to launch a projectile, or a macro event TauntItem to spawn an item.

Host bans/cleanup
If you want to disable taunt projectile/item spawning in the game, host should type "!ban taunt projectiles" or "!ban taunt items" in game chat correspondingly. To enable them back again, host should use "!unban taunt projectiles" or "!unban taunt items". If the host wishes to delete all items spammed by the player models using this mod, he/she can use "!clear taunt items" in chat.

Thanks
To Soulmyr for redrawing CT's weapon wheel textures cause I couldn't find them lol.
To Pan for testing the mod on his Pvt. Tea player model.

Known issues
Each time you open the Taunts/Voicelines menu, your console will spam a bunch of errors about the "dynamically spawned text effects which is not supported". Sorry about that.
1 Comments
Pan 14 Apr, 2021 @ 7:44am 
Thank you for creating this, Kuber! This'll help give player models even more personality and in such an easy to script way, too! The host options are great for those that don't want it too so it's a win for everyone.