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

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

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

Post Reply
(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Sun, 14. Dec 08, 11:25

So I understand you figured out how to return a variable or integer and control which one? But you can only return one thing, right?

I have to say that I like comparing names better, it'll make the system more user friendly because you don't have to give all the sectors their coordinates. And there is less work to modify it for universe map mods. The only down side is that you can't know the difference between the unknown sectors (or any others with the same name), the script can identify those sectors via some sort of id number, but the voice recognition can't (unless you make something for that :roll:).

Anyway did you look at the excel sheet I made? Did I do everything properly?

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

Post by s9ilent » Sun, 14. Dec 08, 12:30

Yes I looked at the xls, and I've copied over all the additions to my sheet :)
(My new sheet has some new changes that I'm still thawing out atm, will upload soon)

As for the ret variables, strictly speaking, it should return both a string and a number, for every single phrase (if the phrases has one). (Note that a single phrase can be comprised of other phrases, but that doesn't really help with sector co-ordinates- as it only returns 1 string, and 1 integer per phrase)
If you don't include a string, the ret string is "" (Null), and if you don't include an integer, the ret integer is 0.

That is a good point you bring up thou, for custom galaxies, using the name would be a better way of doing it. \



And a final comment on the user friendly-ness, to be honest, I need it to be user friendly enough for scripters to be able to use interface their scripts with it, and for users to be able to add their scripts to it (e.g., copy in their phrase(s) to the xls, bam working)



*Last edit for tonight*
Well.. I'm spent.. For today at least. I've hammered out the return variables on both the XML and the actual program it self. There is one thing left I want to do on the XLS, and that is ... wait two things
1) Write up documentation on using it
2) Make it print out the phrase ID's (Right now it just prints "something"), as they are assigned earlier on, and VBA can't really have an "append to array" so I can't effectively save an array of varying size. That, and I can't think of a situation when knowing the list number (which is automatically generated, i.e. random, is more important then its name)

Any way, I'm uploading my prototype voice recognition program, and the mk3 excel sheet. The prototype doesn't do anything with x3 at the moment. All it does is recognise your phrase, and display return all variables.
(Links will be in the original post, 5 minutes from when I last edited this message)

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Sun, 14. Dec 08, 14:42

Sweet, s9ilent ;) It works really good, though I have trained my voice recognition quite a bit now :D

I'll start adding some more commands and report back to you soon :D

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

Post by s9ilent » Tue, 16. Dec 08, 09:09

Tada!!!

Debug version, 100% completed
It is now super user friendly.. welll I've made the window bigger (And thats pretty much the limit of the user friendly ness)

I've taken out the obsolete check box and label.

And most importantly, it now interfaces with the 7742 tfile and log file (07742 log file)

It auto updates every ... 10 seconds on this version (I'm calling this the testing version) simply because, it keeps auto replacing the tfile, so putting it to 3 seconds would make it very hard to "see" it working. (As most phrases are probably 2.5 seconds long, which gives me enough time to see it flash for half a second then Vwoosh gone)

Any way, this is more of a rant post, I'll put the main details in the OP


[I'm updating the main post right now, I'll take this down when its done]

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Tue, 16. Dec 08, 10:05

that's good news s9ilent, I'll try it as soon as I can ;)

Thrandisher
Posts: 357
Joined: Sun, 1. Jul 07, 03:33
x4

Post by Thrandisher » Tue, 16. Dec 08, 10:54

Very nice. Ill try this out in a few day's since im in the middle of a computer crysis. Somehow during a update, i lost access to my system32 directory for 9 hours /grumble.
The mongrels will never get over THIS wall.

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

Post by s9ilent » Wed, 17. Dec 08, 09:38

Day 6

Program is now at Fully functional Beta stages. It works, 100%. But no scripts are X3 TC scripts are set up with it yet.
I'm going to PM a few scripters now to see if they want to set up their scripts with this, and probably see if I can msn them or what ever (as I haven't really done much documentation yet)



My plans for the future are:
Get it compatible with more X3 Scripts
Get feed back
(Other stuff?)

Then implement the improvements/suggestions from feed back
And then call it a full release instead of a beta

*edit*
I'm giving up on PM ing.... user send thingy... exceeded...





Day 7

A sudden though occurred to me... If I make a voice control app that ONLY uses keystrokes, you could still run the game in vanilla mode whilst using the voice recognition.

However... atm.. keystrokes is failing.. the game isn't receiving them :S
*edit* Ok I figured out what I would have to do, and it is: write code to hook into the windows api and write a keyboard hook, that essentially controls the keyboard, at a very low level.
Having said that, yeh... I don't particularly feel like doing it. Firstly, because it does seem like HUGE amounts of effort... I mean like learning VB just to write a voice reco interface pshhh easy... Learning how to (and what is) a low level windows API to hook into the keyboard, to interface with said voice reco interface, bah.... tricky... And whilst a keyboard hook would be faster (as opposed to the current 0-3 second lag) and possibly require less cpu/memory, it will probably bring up a million security warnings, and may need more dll files and other misc tidbits. (That, and litigious reasons too...)

So now I'll just be focusing on enhancing the current version, rather then tinkering around with adding new features (unless they seem like really really really cool features)

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

Post by s9ilent » Fri, 19. Dec 08, 00:22

Ok Version two is up

Its now much easier to setup, and features a consolidated "add your own script" thing (all in the excel sheet).
So there is less mucking about with setting up the xml, then a X3TC script, then testing to make sure it all works, debugging two separate files etc etc.

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Fri, 19. Dec 08, 12:10

Alright! nice s9ilent ;) To bad your (probably) not going to add keyboard strokes. That means no opening of the universe or sectors maps or any other menu's for that matter, unless we can make some sort of workaround in the SE :roll::D

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

Post by s9ilent » Sun, 21. Dec 08, 12:10

Hey Jeff/Others who have tried this program (the older versions)

Did you guys have the Microsoft .net 2+ framework installed when you tried it?

*re edit* it works fine in vista.. you just have to run through the tutorial once. Even if you have already trained it.. you have to go through the tutorial.. And apparently.. its always switched on. So. unlike in XP where you turn everything on, in vista, turn dictation off (But apparently that doesn't work well either.... as it still keeps dictating into the dam window)

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Sun, 21. Dec 08, 14:01

Yes I have 1.1 and 2.0 installed at the moment, I already had them when I started using your program ;)

About the dictation, how do you stop dictating? Using a voice command or with a button/key or something? I have also done dictations and voice commands and they didn't mix well :shock: I also had trouble with stopping dictations as it didn't understand that I said "stop dictation", it just kept on writing.

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

Post by s9ilent » Sun, 21. Dec 08, 22:58

Yeh, I'm not 100 % sure how to stop dictation.... On the vista computer, I tried turning off, allow dictation in other windows, but it keeps on dictating away... So in truth I'm 0% sure how to.
On my XP machine, it seems to not dictate, so I'm happy with that.

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

Post by s9ilent » Thu, 25. Dec 08, 11:40

Just a quick status report

With little interest from the modding community :(, I'm just going to make my own scripts for the SVC.

Originally, I was also going to do something with Cycrow's wings hot keys (as replacing hot keys was one of the main reasons for making this), it'd actually be easier/more robust to just make a new script from the ground up (as most of Cycrow's script actually deals with selecting a wing first, then issuing orders, where as with SVC, you say the wing and the command in a single line)

Any way, In the second post is the list of the scripts I intend to make

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Thu, 25. Dec 08, 13:37

The scripts sound good ;)

The reason I haven't written anything is more that I kinda lost interest in TC, for the moment that is. I'm 100% sure my interest will comeback, it always does. I just have periods that I'm completely addicted to it and then for a while I've had enough and then after another while I'm addicted again :D I don't seem to lose interest for the forums though.

Anyway good luck with the scripts, I'm going to think up some ideas as well (sooner or later :shock:).

Edit: I also like to let you know that the interest on youtube doesn't seem to fade. I still get many views of people who haven't watched it before, so the whole voice recognition thing does seem to interest people. Maybe the SVC just needs scripts to catch on ;)

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Tue, 30. Dec 08, 16:44

Hi S9ilent I've been thinking about a script for SVC, but I've run into a problem. I can't quite figure out what I need to do to make my script work with SVC.

I understand the parts in the excel sheet, it's just in TC it self that I don't understand it. The name of the script and what input it gets are the parts I can't figure out.

I'll give an example and explain where I don't understand it, that's easier for me and for you (I think).
I want to make a jump command so the phrase in the excel is going to look something like this:

{cname} jump me to [the] [{gate}] ... {sector} (example: Computer jump me to the north gate of Argon Prime)

Now the output of that should look something like this, right?

Code: Select all

1                just one phrase
jumpmecmd        the name of the phrase
11               number of returned variables for this phrase
3                number of properties
                 property 1, computer name
4
computer
gate             property 2, the gate, returns a number
1
north
sector           property 3, the sector, returns a string
0
Argon Prime
I understand all this, but now we go to X3 and here is where I get confused.
One of your scripts reads in this data and then calls a script and puts the variables in a array, right? the script file in this case would be "jumpmecmd.xml", right? and it would get handed a array that would look like this, right?

Code: Select all

11,3,,4,computer,gate,1,north,sector,0,Argon Prime
So the script I write needs an argument of the array type. Do I understand all this correctly? And where is the plugin.svc.add script for? Do I need to write a setup script with a call to that script or something?
A bit more explanation on how to setup a script with SVC would be nice. You have the excel stuff covered and most other stuff, but the setup is not so clear ;)

Edit: sorry for the load of text, hopefully you can understand my problem and help me a bit, thanks in advance ;)

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

Post by s9ilent » Tue, 30. Dec 08, 22:10

Thats almost correct, it returns
jumpmecmd, 11,3,,4,computer,gate,1,north,sector,0,Argon Prime

(I included the phrase name, in case you had one script, that could be called by two different phrases and you wanted the script to differentiate between the two)

If you add your phrase, and say it in the modders program, then press stop, it'll create the tfile which you can look at. It will pretty much send the entire array from 50- the last entry (for that one phrase, then 100- last, 150-last etc)





And lastly, for the svc.add, no you don't need to call this any more, its automatic. As long as you added your script to the config page of the xls document, it'll work fine.
eg.
Script name = plugin.jeff.jumpme (with out the .xml)
Phrase name = jumpmecmd
When you run the excel sheet, it creates a second tfile with the script names and associated phrase names. When you start the SVC prog, it copies that tfile over, and then the x3tc AL plugin script, will "run it" each time you start/load a game.

Although, if you want it to load mid game... (a feature I probably should've included for debug purposes...)
Recreate the excel file (i.e. add your things to the worksheets, press run)
Then re-open the SVC (it'll copy over the files at start up/when you press the stop start button)
then call the plugin.svc.main.add (no arguments)

Calling that last script will get it to re-read the script/phrasename tfile (7743), and re-create the global array storing that information (overwriting the previous ones)
As for the structure of the 7743 tfile it self, it pretty much has scriptnames from 1-999, and phrase names from 1001-1999. (And the size 0). But it shouldn't really matter, it is automated by the plugin.svc.add, the worksheet, and the SVC





Although, this does bring up several new ideas.
1) An in-game debug menu. With options... reload script/phrasename and.... that's all I can think of...
Well... actually.. one new idea and that was it.
But I have also pretty much completed the "X3 common names sheet", it now stands at 650~ lines. Although, some items had to be removed, due to either being not used in game (to reduce clutter) or because two things had the same name (which causes an error) (Has no new functionality, just more text)
Ill upload the new excel sheet, but it's still a WIP.
http://members.optuszoo.com.au/whyistha ... rolmk3.xls
The main additions are... completed the lasers missiles and ships (with the return number being the objects subtype) and sectors (where the return is 1XXYY -to prevent issues with 0102 becoming 102, or 0000 becoming 0)



Yeh and sorry about the poor doco's, I'm not v. good with explaining things. Ill try to improve it.
Which parts of the instructions needs to be improved. Step 4 & 5?

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Wed, 31. Dec 08, 11:03

Nice s9ilent, the sheet looks good and I think I know everything to make the script now ;) I already started adding the sectors and stuff as well, but I didn't make them ready for pronouncing (replacing numbers with words and stuff), so thanks for adding them and the script/phrase name system, it makes things a lot easier ;)

btw, looking at your missile loading phrase I just thought it would be more efficient to add a wild card at the end of the phrase instead of all the [missile] things in the commons, haven't tested that though.

about the documentation, I think it's quite clear, but I don't really get what step 4 & 5 are :? as you don't really use steps in your documentation to explain everything :roll: If you want I can write up something with all the information in your documentation and what I know now.

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

Post by s9ilent » Wed, 31. Dec 08, 15:16

Hrmm.. that's a good idea, Ill put on optional wild cards then.

(The weird thing about a wild card thou, is that they can't be blank, in that if you put in a wild card, you actually have to say a junk word for the phrase to be recognised)

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) » Wed, 31. Dec 08, 16:18

aahh.. I didn't know that *adds that to documentation*, that said though a wild card as optional, is that possible? Like this: [...]

Edit: Another question s9ilent, your sectors list should return this to X3:TC, right? (without the rest of the phrase stuffs and everything ;))

sectors,10000,Kingdom End

But what happens when a wild card is involved, like in "Xenon Sector One ... One". Do you get the wild card as thee dots, like this:

sectors,10507,Xenon Sector One ... One

Or does the computer enter what it thinks should be there? For example:

sectors,10507,Xenon Sector One zero One

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

Post by s9ilent » Wed, 31. Dec 08, 22:45

Yes optional wild cards work fine

And if you use a wild card, it returns
xxx ... yyyy
So "Xenon Sector One ... One", so it is probably best to use the numbers instead.

Post Reply

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