sluggy2010
Posts: 121
Joined: 10/2/2013 Status: offline
|
Here you go version 1.0f of SeaHag - With regular expressions. I've stamped out any bugs I can find - so let see how you go, enjoy. Don't overwrite your old version yet - just in case..... ------------------------------ Quickie instructions SeaHag Version 1.0f What does SeaHag do? SeaHag is a Speech and Ambient sound module for Command Modern Air Navy Operations. Why call it SeaHag? Command is an honour; respect the role, and it just is....I have my reasons. ------------------------------ What does it need to run? .NET 4.0 same as CMANO Either Microsoft Speech - present in most modern versions of Windows by default. or use eSpeak - http://espeak.sourceforge.net/ or any external speech/other command - use other with care....runs an external process to run any other programs but if you know what you are doing this is VERY powerful, eg transmission to web or syslog or anything else. ------------------------------------ SeaHag uses the CMANO logfiles to monitor the action - so no nasty intrusive programs breaking CMANO - and it does not mess about with CMANO in nasty ways. However if you cant see information you want spoken in the logs - I cannot process it - so no I cant give you voice response for selecting a unit unless the devs send it to the logs. Installation - Extract the zip file to a directory that you want to run SeaHag from - thats it, maybe create a shortcut on your desktop. Start SeaHag and for the first time only click "Default Speech" and "Default Sounds" then click save settings. < YOU MUST DO THIS PART > It can autodetect the side selection and can detect side changes when you load a savegame now. Whats new in 1.0f - Full expanding editing grid for those with complex rulebases. - Ability to test speech items and pass a test line immediately through the engine. ( Handy when working with complex lines ) Put the text in the box next to "Parse Line" and click the button "Parse Line" to test how the rules would process the line if found in the log. ( Do a copy and paste from a log file line - it will need the whole line ) - Autodetect savegame loads and skip old messages until the side change is detected. - New application instance so does not overwrite the old settings files. But does use a new settings file. - Regular expressions - VERY powerful - and sorry - it may be tricky to understand for the uninitiated, cant change that - its just how things are. - * wildcard for replace - changes all occurrences in the line ( put the * in the reduce char box ) - created a workaround for Microsoft dotnet library settings not storing fields which contained just a space. Quickstart - Run SeaHag - ALWAYS BEFORE CMANO - and let it autodetect and do its piece if starting afresh. - Or you can turn off "autodetect side" and it will get the announcements of both (all) sides if you really want it. Only for the first run ....Click DEFAULT SOUND GRID and DEFAULT SPEECH GRID, then click SAVE SETTINGS. ** Note this applies even if you were using an older version ** I could automate this but you never know how people use this so I left it as manual. Then click "START SeaHag" SeaHag will look up the CMANO home directory automatically ( from the registry), it processes the log files automatically and detects new ones on its own and will autoswitch to new log files automatically. ( unless you tell it not to ) by default. New CheckBoxes on the screen. AutoDetect Playerside - as it says - allows auto detection of the playerside by SeaHag. SaveGame Force Wait for Playerside - When SeaHag detects a new logfile it will skip all messages until a side selection line is found, it stops issues when you load a savegame ( Used to cause unwanted messages otherwise ) do not turn this on when autodetect playerside is off - you wont hear anything. Reset Playerside on new file - If you start a new game then CMANO creates a new logfile and now SeaHag clears the playside so it can pick up the new one. So you never really need to mess with SeaHag now - it does most things on its own. ======================= Rule Base Details Each line read from the logfile is parsed down through the rules changing as it goes. REDUCE - These rules look for the trigger text then reduce line length ending at the chosen character. REPLACE - These rules look for the trigger text then replace it with the replacement text - only the 1st occurrence unless you put a * in the reduce char box. You cannot do a REGEX or a REPLACE with nothing - use a space if you want to remove the item. Autolimited to a max of 20 replaces when using a wildcard *. BOTH - Does both actions - a REDUCE then a REPLACE REGEX - runs a regular expression substitution - advanced substitution of strings. FIND - allows SeaHag to speak the line - if you do not have a find then SeaHag will not say anything. REGEX means regular expressions - they are VERY powerful but also hard to learn if you have not seen one before. I am not going to explain regular expressions here - Good references for REGEX are - https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/ewy2t5e0%28v=vs.110%29.aspx And a quick reference card -> here http://download.microsoft.com/download/D/2/4/D240EBF6-A9BA-4E4F-A63F-AEB6DA0B921C/Regular%20expressions%20quick%20reference.pdf There are examples in the default tables, and you can look at those to get used to REGEX lines and how to use them. If you find them too hard - you can get most of the functionality out of the normal SeaHag functions. But you will not be able to do some of the clever manipulations of conditional text. REMEMBER !!! - REDUCES or REPLACES or BOTH or REGEX ( BOTH does a REDUCE then a REPLACE ) - Do NOT trigger speech – only a successful FIND will trigger speech. Generally REDUCE, REPLACE, BOTH and REGEX do NOT want to have repeat prevention turned on - but I have included the option in case its needed. It is FINDS - that you would put repeat prevention times on if you find it too chatty. The speech level box sets the current level of speech and you will notice the rules have a min and max speech level on them - if the level is above the max or below the minimum that rule will not run. ======================================================= The two tabs Speech and Ambient are the trigger filters. A line is passed down through each speech filter line unless a STOP ( Last but one column ) is hit. Reprocess allows you to send the line back to the start of the rules again - auto loop protection is built in at 5 times through the rulebase ======================================================= *NOTE* That older XP users may also benefit from installing the following Microsoft update for Speech, otherwise you will just get the (very)old Microsoft SAM speech. http://www.microsoft.com/en-au/download/details.aspx?id=10121 ======================================================= The application setting are stored in On Win XP - C:\Documents and Settings\<username>\Local Settings\Application Data\SeaHag.exe_<identifier>\1.0.0.0\user.config On Win 7 - C:\Users\<username>\AppData\Local\SeaHag.exe\<identifier>\1.0.0.0\user.config Back this file up if you have added lots of filters or sounds. May change for version updates. You can buy advanced voice synthesis from AT&T, I bought the Audrey Voice - the quality is exceptional. Found it at http://www.nextup.com/attnv.html ======================================================== Use a FIND with a search text of * on its own if you want to find all speech lines – a bit too chatty if you don’t have enough REDUCE filters, other wildcard options are not added as of yet. The default action of a line is to “CONTINUE” to process the table upon a match, a STOP will stop processing the table at that point. Use sound files to add effects which trigger just before the speech to increase immersion. Use a speech REPLACE with the search text of @ to just trigger the sound launch. The continuous flag for ambient sound will cause the sample to automatically loop constantly, good options here are control room or radio chatter. The attached samples are good for control room background noises. The percentage chance of an ambient sound triggering will be tested and if not successful the replay prevention will be added to the next play trigger. This means that if a sound has a 40% chance of playing and a 60 second replay prevention then if the sound DOES or DOES NOT play the replay prevention will not have the possibility of playing for another 60 seconds. If you turn off the voice check box and optionally the "more diagnostics" checkbox you can test filters quickly without waiting for the voice to run. **Remember to turn voice back on, or leave it off if you don't want voice and just use the Ambient and Triggered sound options. *NOTE* The stop button may have to be pressed more that once, the sounds and speech are higher priority that button detection. Thanks Thanks to the Devs for such a great simulation. MP3/MP2/MP1/OGG/WAV/AIFF Files can be used. In theory the files can be any size, but the smaller the better really. My Thanks to the creators of the BASS libraries – awesome library guys thanks. Disclaimer. SeaHag is provided as is, the use of this software is done so solely at your own risk. It is a condition of the use of this software that I am not liable for any damage as a result of its use. Copyright. You may use this software free of charge. You may not charge for its distribution or profit from its distribution in any way. You may not reverse engineer or reduce the binary back to source code form. You may not distribute its source code. You may distribute SeaHag but you may not do so as your own or someone elses work, it took my time to build it. Thank you. Sluggy
Attachment (1)
< Message edited by sluggy -- 1/24/2015 6:11:15 PM >
|