Git Product home page Git Product logo

voice_commands's Introduction

Voice Commands

This plugin adds voice commands that function like the "Take Cover!" and "Medic!" alerts. The default setup has 6 different voices each with 14 voice commands.

Default voices Default commands for menu 1 Default commands for menu 2
Scientist Follow me Yes
Barney I'm with you No
Otis Help Cheer
Soldier Run away Hello
Bodyguard Stop Thanks
Gman Taunt You're welcome
Chit-chat Sorry

Each command has its own sprite and a collection of sound clips that are chosen randomly. Monsters will react to the sound of your commands, and will follow/unfollow you if you use the "Follow me", "help" and "Stop" commands while looking at them. If you die, the only thing you can do is make death gurgles (there's a sprite for that, too).

All voices and commands are fully customizable. You can add, remove, or rearrange commands and voices as you see fit. Just don't remove or rename the "Follow me", "Help", or "Stop" commands if you want monster following to work.

Currently up to 4 different menus are supported, 2 are there by default.

Usage

Say ".vc X" to open a command menu (where X = 1 or 2).
Say ".vc global X" to open a command menu in global mode (everyone can hear you).
Say ".vc voice" to select a different voice.
Say ".vc pitch X" to change your voice pitch (where X = 1-255).
Say ".vc vol X" to adjust all voice volumes (where X = 0-100).

I recommend binding the ".vc 1" and ".vc 2" commands to keys (I use Z and X).

If you repeat ".vc X" before choosing a command, the menu will flip orders. This is so you don't have to stretch your index finger to reach the 5, 6, and 7 number keys. If you repeat ".vc X" one more time, you will enter global mode. This is so you don't have to bind more than 2 keys for this plugin.

CVars

as_command vc.delay 2.5
as_command vc.enable_global 1
as_command vc.enable_gain 1
as_command vc.global_gain 0
as_command vc.falloff 1.0
as_command vc.monster_reactions 1
as_command vc.use_sentences 1
as_command vc.debug 0

vc.delay sets how long players have to wait (seconds) before using another command. Use this to prevent spam.
vc.enable_global enables/disables global commands which can be heard anywhere in the map.
vc.enable_gain amplifies voices by playing multiple overlapping sounds. Keep this on or else the default voices won't have equal volumes.
vc.global_gain adds extra gain to all sound files (0-6). Has no effect if gain is disabled.
vc.falloff adjusts how far non-global commands can be heard (2 = near, 1 = normal, 0.5 = far, 0 = global)
vc.monster_reactions enables monster responses to voice commands (e.g. follow player, detect noise).
vc.use_sentences controls the use of sentence lines. Set to 0 for maps that override the default sentences (as_command in map cfg)
vc.debug shows sound details in chat and plays files in order instead of randomly. Use this to test your own sounds.

Server impact

The default setup includes 59 custom sounds and 15 custom sprites. The total size of these files is 662 KB, which will take a little over a minute to download if you don't have fastdl set up. By disabling the Gman voice, the download is reduced to 206 KB.

In total, there are 456 sounds and 15 sprites that are precached when the plugin loads. In previous versions of Sven Co-op this would be unacceptable because the precache limit was around 512. As of SC 5.0, the precache limit has been increased to 8192, so this isn't an issue anymore. If needed, you can greatly reduce the amount of content that is precached by disabling some of the default voices.

Known issues

  • Sometimes a command will play multiple instances of a sound that are slightly off-sync. Set "enable_gain" to "0" in VoiceCommands.cfg to fix this. Note that sounds may be too quiet to hear if you do this.

  • Sometimes sounds get mixed up on a dedicated server (you hear an alien sound when you try to say "yes"). Delete your server's soundcache (svencoop/maps/soundcache) and change the level to fix that.

  • The sprites are kind of shitty and don't all make sense.

Adding your own voice or command

  1. Add a new entry to the [voices] list in VoiceCommands.cfg, let's call it "Billy" for example.
  2. Create a new text file with the same name (case sensitive) in the "voices" directory ("Billy.txt")
  3. Copy the contents of "Bodyguard.txt" into your new file.
  4. At this point you can either erase all of sound file paths or edit them in place.

The format of each line is "Volume : File path". Volume can be a number between 0 and 6. 1 = default volume, 2 = double volume, 0.5 = half volume

To test your sound files, set "debug_mode" to "1" in VoiceCommands.cfg. This will play command sounds in order, and give you info for each sound you play.

If you want to add a new command, follow these steps

  1. Add a new entry to either [command_menu_1] or [command_menu_2] in VoiceCommands.cfg, let's call it "Stand on me" The format for commands is "Command name : Sprite file". The sprite file is what will display above player heads when you use the command.
  2. Add your new command type (case sensitive) to every voice.txt in the "voices" folder.
  3. For each voice, add new sound entries under your new command name. Example:
[Stand on me]
2 : voice_commands/barney/standonme1.ogg
4 : voice_commands/barney/standonme2.ogg

voice_commands's People

Contributors

incognico avatar wootguy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

svcino

voice_commands's Issues

Voice_commands

How to upload, what to write, where to put it? More details, I don't understand!
Where to save Cvars do you need amx mod??
HELP I'M A NOOB

ERROR: Failed to add include file '../SoundCache/StartSoundMsg'!

I first downloaded the release version then the source code to overwrite them with the recent version of it.
However, i checked why it was not working and in the AngelScript log file, this is what it happens:

ERROR: Failed to add include file '../SoundCache/StartSoundMsg'!
ERROR: Failed to add plugin 'VoiceCommands'!

use_sentences 0 probably doesn't need to use PrecacheGeneric

It might be enough to just use PrecacheSound, and that might avoid FSB_OVERFLOW on a map that overrides default sentences. I'm guessing if any map ever does this it's because there's a million things precached and so use_sentences 0 would just crash the map.

New version crashes the game

I'm triying to run the new version (default version, not edited) and I can't, game crash with the folowing message:
Fatal error Sven Co-op has crashed unexpectedly. A crash report has been submitted automatically. we apogolize for the inconvenience.

I was able to reload the plugin before it crash and got this on AS logs:

ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (91, 94) : Can't implicitly convert from 'int' to 'SOUND_CHANNEL&'.
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (351, 11) : Multiple matching signatures to 'CBaseMonster::StartPlayerFollowing(CBasePlayer@&)'
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (353, 11) : Multiple matching signatures to 'CBaseMonster::StopPlayerFollowing(const bool)'
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (441, 13) : Use of uninitialized global variable 'channels'.
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (442, 10) : Use of uninitialized global variable 'channels'.
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (449, 24) : Use of uninitialized global variable 'channels'.
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (450, 41) : Use of uninitialized global variable 'channels'.
ERROR: d:/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/voice_commands/VoiceCommands.as (479, 41) : Use of uninitialized global variable 'channels'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.