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

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

Post by s9ilent »

On the top left?


Could you send a screen shot? If its at the bottom, then that would be the... .. the.. text thingy.. .. subtitles! thats it. But the top?

Ok.. re uploaded. Fixed

Dam read text :S grrr... I dont like pointers :S they confuse me :S
Dukoth
Posts: 13
Joined: Sun, 12. Apr 09, 09:51
x4

Post by Dukoth »

I would just like to say that this is a great idea

and I'm getting the same bug, every thing seems to work, but nothing happens in game
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Ok, I tweaked the x3 add script again. I think its because changing between the old version and the new version wouldn't update it self. But now it should run fine.

Tested and good :)

(I really wish someone would've said it still didn't work sooner :S)
SoniG
Posts: 14
Joined: Sat, 21. Feb 09, 17:31

Post by SoniG »

Hey, seems I have something similiar. I tried a new game and it worked perfect, but if I use it in an loaded game (where I didnt used your proggy before) it doesnt work.

Anyways this program is wonderfull! Couldnt wish for more :D
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

So does it work now, or not?
SoniG
Posts: 14
Joined: Sat, 21. Feb 09, 17:31

Post by SoniG »

Seems like I missed your update (downloaded day before, tried it yesterday):D, seems to work fine now. Thanks!
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Awesome cakes :)
amirite
Posts: 243
Joined: Thu, 23. Oct 08, 22:01

Post by amirite »

This mod is so great, I've seen it tons of times but never got around to using it until now.This will be awesome for issuing large complex groups of commands easily. Couple of questions:

Is it currently possible to issue orders to any ship? ie outside of the sector, etc. I can order around my wings just find but only because the target selector for them is so straightforward. Is there currently a way to, say, tell a specific TL in Legend's Home to fly to Montalaar?

Also, do you have any plans to impliment any redundancy features to this, so that different phrasing will accomplish similar commands? This is already intuitive on it's own but if people were able to just relax and give commands as they think of them while still having the game understand, that'd be invaluable.
-TEVE
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Currently, the only to order ships from a different sector is by designating the ship first, then ordering it.
But to designate the target you must have done it in sector first.

i.e.
V: {cname} designate {shortident} [{numbers}] {numbers}
R: Defines your current target as XXXX # #
Example: Betty/Shiela/Phyllis designate Alpha/Beta/Bravo/...Epsilon/Echo 0-9 0-9



I'll write up a new script for the generic commands to reach different sectors today/tommorowish





As for the redundancy feature. I don't plant to, but you easily can. For example, if add a redundant command for this command:

V: {shipid} {commands}
{shipid} is the target you defined above (p.s Bravo 01 = Bravo 1)
{commands} = ..., follow me, ...
Eg: Bravo one follow me


Say you wanted to say "form on my wing" as well as "follow me", then you would open up the excel sheet (voicecontrol mk4) find follow me in {commands} (just use ctr-f to find it), and then add in another line.

e.g. find this

Code: Select all

		follow me	5
make it this

Code: Select all

		follow me	5
		form on my wing	5
(The number in the next column, tells the game to run command 5, i.e. follow me)









As a sort of general note, I did originally intend this for other modders to use, so the existing commands are more just like demo-commands. (i.e. I put very little thought into them)
So if you have any suggestions for addition commands/different text feed back, then post away :)
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

So long and thanks for all the fish.

:( Well looks like my time will be cut short.
I'm not going to be able to finish up all the things I wanted to do with this script :(


The main one being integrating keyboard commands, via the voice reco. I've learnt how, and its done like this: (Vb Net)

Code: Select all

Public Class Form1

    Declare Function keybd_event Lib "user32" Alias "keybd_event" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) As Long
    Private Declare Function VkKeyScan Lib "user32" Alias "VkKeyScanA" (ByVal input As Byte) As Integer
    Private Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long

    'Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer

    Const vk_release = &H2 ' Release key
    Const vk_extend = 224 ' Release key

    Const k_num = 69







    Private Sub tap(ByVal code As Integer)
        keybd_event(0, code, 0, 0)
        keybd_event(0, code, vk_release, 0)
    End Sub
    Private Sub hold(ByVal code As Integer)
        keybd_event(0, code, vk_extend, 0)
    End Sub
    Private Sub release(ByVal code As Integer)
        keybd_event(0, code, vk_release, 0)
    End Sub

End Class
And the code variable is a number, and is the ... 'hardware scancode' for the key board.
http://download.microsoft.com/download/ ... ancode.doc
Thats the microsoft doco on scan codes. (Its the usual standard used by keyboards) If your using a non standard keyboard (Typically non qwerty types ones) then you will have to research the scan codes your self, but they might be the same ones in this link

Essentially, by calling these, (tap, hold/release) you can emulate keys. These keys will not show up in windows based apps, but only in games (e.g. in x3).
If you want it to show up in windows apps, then you use the first argument as well in the keybd_event.
You can only send one scancode at a time with the code argument. But with sending keys to windows, I think you can send a few.




Here is a link to the source of the actual SVC Beta program.
It currently does not utilize key presses. (For the XLS sheet to make the xml file, just dl the main download, from the original post in this thread)

http://members.optuszoo.com.au/whyistha ... source.zip
As said above, it was made in vb net express (the latest one.. I think)
Spectral-Fremen
Posts: 67
Joined: Tue, 30. Jun 09, 08:18
x4

Post by Spectral-Fremen »

I just found this, it looks sweet!
What happened to the project?
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I'm taking a LOA -leave of absence- from gaming in general. It's still there, it still works. I just won't be implementing the upgrades (namely the keystrokes thingy)
Firestar_Jes
Posts: 3
Joined: Wed, 13. Dec 06, 18:25
x3tc

Continue project?

Post by Firestar_Jes »

Hi

As i found this a very interesting project, i was wondering if there was enough interest in it, if there is i am willing to continue this project. With s9ilent's permission of course...

I don't know alot about X3 Scripting, but i am a Software developer, so i can pick that up rather quickly.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Well if you really want the source code is... somewhere (look back on the previous page). Although to be honest... other then adding keypresses, I don't really see how much further you can take this..

Although I am currently currently re-coding this into c# for an education exercise.
Firestar_Jes
Posts: 3
Joined: Wed, 13. Dec 06, 18:25
x3tc

Post by Firestar_Jes »

Well wouldn't want to take it away from you, but i thought of mainly adding more scripts to it, and getting the Key press functions included. I would probably have converted it to C# too, a great language to use, and the one i mainly use in my work.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Ok the C# conversion is done (it was actually done a day or so ago) and I've re-learnt how to do keypresses... but once again.. the question is what is the best way to do key presses...


Would you guys prefer if:
a) The program works out key presses from the phrase name. E.g. phrase "xxxx_key_esc" would result in an escape key being pressed each time its recognised.
Advantages: All config is consolidated in the excel sheet (or .xml file, if you made the grammar directly)
Disadvantages: Not very robust, you will be limited in what keys you can send. I'll have to make a compiler of sorts to turn all the key_xxx's into actual hardware scan codes (I'll need to do this any way.. I guess)

b) Put it into a menu in the SVC program it self. This will make it a two step process. 1) Adds the phrase to the xls/xml. 2) With the program, register a sequence of numbers with each phrase name.
Advantages: Can be more robust
Disadvantages: Is a two step process. I will still need to write a key-> scan code thingy, but it will probably be a GUI of sorts in some sort of select table.


c) Other suggestions?
Firestar_Jes
Posts: 3
Joined: Wed, 13. Dec 06, 18:25
x3tc

Post by Firestar_Jes »

Hi

i don't know if you can do this, but i think it would be cool to have a phrase ex. "Activate Hyperdrive" which would then send the keys SHIFT+j to the game.

edit: after reading you message again, this seems to be what your second option is like, so i guess i would prefer that.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Either case can do it, I'm just wondering whether it is better to have a consolidated but less robust method, or a two step but very robust method.
mrxenon
Posts: 4
Joined: Wed, 14. Jun 06, 18:24

Post by mrxenon »

i dont work for me :( i trained vista speak but it don't work on german :( i really would enjoy to play x3 with voice commands... but nothing happens when i say something. i only hear the beep from vista voicehear.. or how it call on english xD sorry forgot... everything is turned on but it dont work...

please help me xD
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I'm using the SAPI 5.1 system (as it is the only one that is available to all users, not just users of vista and onwards)
Meaning that the supported languages are :
* Simplified Chinese
* English
* Japanese
http://support.microsoft.com/kb/318741


Which means that your going to have to use the English recognition (although you can type in any word for it to recognise, but given that it is in english, it not work 100%, so you may have to compensate for that by spelling words incorrectly e.g. Kampfgruppen -> calmph groupen)


Having said that, I'm not to sure how/if you can change languages in vista (presumably you can?). It would help if you could describe exactly what steps you've done to set it up, and possibly provide screenshot(s) to help explain it.

Also, do any errors come up? Or does it appear to run fine (except for the part how it doesn't pick up any thing)

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