S9ilent's Vocal Control *29/03/2015*

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

MikeMaMan
Posts: 5
Joined: Fri, 20. Feb 09, 02:39

Post by MikeMaMan »

I have DVD version with patch 2.0. But does it matter? I think this error relates to SAPI engine, but not to the game itself. Because i get error before i start the game.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

That error was handle was put in by me, but chances are it is not actually sapi related. (As that entire block of code, gives that error, but I have a feeling its failing trying to read the registry)

I'm putting in more error handles now to diagnose exactly where it breaks


p.s If it is sapi related, then there isn't anything that I can do about it :S
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Ok, new version uploaded


This one is more resize friendly.

The DEBUG version no longer exists, instead, there is a setting in the SVC beta program to turn on/off the output. (It is strongly recommended you turn this off when actually using it, as it will grow to a huge size)

The program size is saved on exit (as is the output on/off)

The path is saved on exit. On re-opening, if it doesn't exist, it will attempt to find it again, other wise it will prompt you to type in the path.

Added some multi lingual compatibility. Note, SAPI (The core recognition part, is still limited to 3? languages, but I've just made it CAPABLE of working with multiple languages. Whether or not it will recognise them I don't know)

New error handle to try and catch that SAPI 5.1 error.

I've added in a counter, as to prevent the same commands being read multiple times when SETA is activated. Although, you are still recommended to turn it off when not in use, as it will still do 10x the checks at 10x SETA (although it will stop these checks in the first few lines, it still has to check them)






On an unrelated note
I decided to give the SVC a go at foreign (english letter based) languages.
alle Schiffe nehmen mein Ziel in Angriff
(But I said it as : all ships nihne-men ziel in anger-if, and it worked... But its a heuristic victory as I'm probably saying it wrong.. I wish bablefish could speak:S sif by psychic)
My best possible solution for if you wanted to truly use a foreign language, is to hack up your language, and convert it into the SAPI "sounds" (Its like an alphabet, but instead of letters, it has sounds)

On another side note
sendkeys failure
directinput failure
sendinput failure
postmessage failure
sendmessage failure
keyboard hook failure

For the life of me I can not figure out how to do keystrokes with VB net :S!!!
(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) »

long time since I've been here :) and there is a new version :D

I still didn't try to make something in autoit, but I did do a lot of research and I have grown quite confident that it is possible to make a good speech recognition program with it. I think I'll take a look at it sometime soon... I think I said that before... a long time ago xD

Anyway it's good to see this didn't end up all dusty and deserted ;)
SieurNewT
Posts: 662
Joined: Tue, 13. Apr 04, 18:45
x4

Post by SieurNewT »

hello

great new for the languages works!! i will try tonight to see what happen
New Config : Intel 8400 & 4Ghz , 4GB DRR2 on Asus P5Q Pro, ATI 4850 and Win XP 32 bits SP3.

Old config AMD 64 3400 1Mo, MSI k8n neo plat, 7800 GS+ Bliss, 2 GB RAM 3200
SieurNewT
Posts: 662
Joined: Tue, 13. Apr 04, 18:45
x4

Post by SieurNewT »

so i tried the new one, noticed it add the xx33 file to /t but need to change the code inside to 33 ... but with or without editing i still dont see the script full name in IA plugins but only file name, maybe i do something wrong ?

also did you have any screenshot of what should appear as order feedback ?
New Config : Intel 8400 & 4Ghz , 4GB DRR2 on Asus P5Q Pro, ATI 4850 and Win XP 32 bits SP3.

Old config AMD 64 3400 1Mo, MSI k8n neo plat, 7800 GS+ Bliss, 2 GB RAM 3200
User avatar
-[e1337e.weazel]-
Posts: 468
Joined: Sat, 31. Jan 04, 17:40
x3tc

Post by -[e1337e.weazel]- »

I´m using "Nuance Dragon Naturaly Speaking 10 GERMAN", how can i use it with your script or how can i modulate your script that it works with "NDNS 10" in german?
***modified*** und stolz drauf
"Je dunkler der Keks, desto bunter die Seite!"
[ external image ]
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

AFAIK, Dragon uses SAPI. So long story short. You can't really (as I'm stuck using SAPI 5.1, and not 5.3)

Although, I encourage you to try and see if it works any way. i.e. Open up the voicecontrolmk4 Add a few german words to it and see if it can pick them up



After a bit more trial and error I can add a new item to the fail list

sendkeys failure
directinput failure
sendinput failure
postmessage failure
sendmessage failure
keyboard hook failure
kbd_event failure
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

omg omg omg omg!!!

I'm getting there

Keyboard event did something in X3!!!

Whilst it is typing a in notepad, it is pressing esc in X3. but the good news is that IS actually doing something in x3!


Now.. to decode the code...
20 = t
19 = r
18 = e
I'm confused.. maybe in.. *confused...*


It has come to my attention.. that a scan code.. is apparently, the keys position on the key board!
However.. I don't know what that means for different keyboards...

Does anyone have vbnet and a g15 keyboard and who wants to test it?
Maclane
Posts: 60
Joined: Fri, 23. Jan 09, 09:21
x3tc

Post by Maclane »

I don't have a G15-Keyboard but I have VB 2008 Express Edition and Windows Vista (german).

May I ask you to post the vb-code für your keyboard-event? I would try and test a littlebit on my own.

Tried with sendkeys-method too, but for any reason X3TC didn't either receive or handle the keys. I was as confused as you were. :?

Greets
Mac
User avatar
-[e1337e.weazel]-
Posts: 468
Joined: Sat, 31. Jan 04, 17:40
x3tc

Post by -[e1337e.weazel]- »

I tried to run with Dragon NS, but when I run SVC and start Recognition i got the response "Failed to load grammar. It is possible that your audio device is used by other." :( But i also got this response when i unload DNS.


btw: What about to add phrases to handle the monitors?
And i miss "autopilot off" and "SETA on", "SETA off"
***modified*** und stolz drauf
"Je dunkler der Keks, desto bunter die Seite!"
[ external image ]
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Failed to load grammar means that:
The grammar file, i.e. What words the program should recognize, is not working. Have you modified the x3tc.xml, or use the voicecontrolmk4.xls to make a new file?

Similarly, do you have 2 of the programs open or is something else using the file?



As for the other requests, I only just learnt how to control the keyboard today, I'm going to work on it tommorow
User avatar
-[e1337e.weazel]-
Posts: 468
Joined: Sat, 31. Jan 04, 17:40
x3tc

Post by -[e1337e.weazel]- »

Sorry, it should mean: "Failed to activate the grammar."

I didn´t touch the x3tc.xml, but i translated the phrases in the voicecontrolmk4.xls into german.
***modified*** und stolz drauf
"Je dunkler der Keks, desto bunter die Seite!"
[ external image ]
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Are all the characters pure english?

I.e. a-z, no funky characters?
Oh and when you did translate it, did it bring up any errors when you pressed run?
User avatar
-[e1337e.weazel]-
Posts: 468
Joined: Sat, 31. Jan 04, 17:40
x3tc

Post by -[e1337e.weazel]- »

Ok thanks for your help and for a great idea, i dont want to waste your time to find my errors. I have uninstalled Microsofts voice recognition.
I found in DNS the editor to create own commands. I will create a list of command recordings for DNS to control X3. Short and easy way to make it work for me (i hope).

edit: hm ok, to set commands with shortcuts is no problem, but i don´t know how i can set command strings with variables like sectors. e.g.: "Computer fly to Sektor Argon Prime"
***modified*** und stolz drauf
"Je dunkler der Keks, desto bunter die Seite!"
[ external image ]
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

To do that, you have to use lists

e.g. You would have a top level phrase with:

phrasename (next colum)
Computer fly to (then goto the next colum)
{sectors}

In the curly braces. As the curly braces tells the compiler to use the list called "sectors", which is the list of all sectors. (The Sectors list already exists, I've made it and put it in the X3 Common names sheet, although you may need to translate that)


Code: Select all

Phrase Name		Phrase	
flysect		computer fly to sector	{sectors}







On a different note,
Status Update
I've now mastered all the important X3 keystrokes
However, in doing so I've encounted a potential flaw...
X3 has a maximum number of key presses per second (or maybe my computer is laggy, in either case the result is the same)
After a bit more research, it is lag related. I'm going to assume you can only send one key per frame
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Just a quick question to everyone out there (who are (intending) to use the program)



Now that I know how to do hotkeys, would you prefer if you could blind phrases to hotkeys in the excel sheet, or in the actual program?

And... Would you require hotkeys bound to existing phrases, or will hotkey'ed phrases be separate?
(e.g. Do normal phrases that return variables to the script editor, need to be hotkey-able as well?)
Danson615
Posts: 15
Joined: Thu, 18. Dec 08, 23:09

Post by Danson615 »

Hi S9ilent,

I have installed your program but I cannot seem to get it to work :(

I have activated the Microsoft voice recognition software, trained it excessively, and installed your scripts according to the instructions you provided.

I get no errors from the SVC Beta, and when I activate "Full Output", my voice commands are registering just fine. When I boot x3 Terran Conflict, your script appears under Artificial Life settings, and this option is set to "yes". I have also turned on subtitles.

Yet nothing works.

Everything is working fine in the SVCBeta.exe, but the commands are not transmitting into the game.

For example, I say "All fighters follow me"; the command is recognized in the SVCBeta.exe program, but nothing happens in the game itself (all the fighters just sit there).

Am I doing something wrong? If I am running an incompatible Mod or script, would this interfere with your script?

Thank you.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Eeeek, I made an error in my script

(A new feature overwrote and old variable)

Just download the SVC program again, unzip it right over the old one, run it, (it'll copy over the new script when you run it) and viola





The bug was... I put in a second counter, but it saved on top of the phrase names, instead in the count variable.
hoax1210au
Posts: 24
Joined: Thu, 13. Sep 07, 10:49
x3tc

Post by hoax1210au »

s9ilent Thanks for creating this mod.

However like Danson615 I am getting problems as well. The SVC Beta program is recognizing my voice commands but in the game nothing happens. I have installed according to your instructions enabled subtitles, and AI etc.

One thing though on the top left hand corner a little text box appears and expands (to the right) when I give a command but this has no text it's just a empty text box.

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”