Author Topic: Simplifying a huge command, possible wildcard?  (Read 3067 times)

Malic

  • Full Member
  • ***
  • Posts: 102
Simplifying a huge command, possible wildcard?
« on: June 06, 2018, 03:05:29 AM »
I play Elite Dangerous in VR, and myself and friend have put together a series of commands that is supposed to help not only VR users so we dont have to take the headset off to type, but anyone else that wants to use this functionality.

Quote
Target
Location of
Distance to

are prefixes, and then this is the suffix:

Quote
home;sol;earth;brestla;bastanien;sirius;deciat;eurybia;khun;maia;jauques;colonia;marrow pea;act in our;achenar;meene;hodack;prism;sagittarius a star;do you quandary;diaguandri;wu guinagi;will go on re;vasukili;yoru;engineer elvira;martuuk;elvira martuuk;engineer dweller;the dweller;engineer liz;ryder;liz ryder;engineer felicity;felicity;farseer;felicity farseer;engineer tod;mcquinn;tod mcquinn;tod the blaster;engineer zacariah;zacariah;zacariah nemo;engineer lei;lei cheung;engineer hera;hera tani;engineer juri;juri ishmak;engineer selene;selene jean;engineer marco;marco qwent;engineer ram;ram tah;engineer bro;bro tarquin;engineer bris;colonel bris deker;engineer didi;didi vaterman;engineer palin;professor palin;engineer lori;nguri;soontil relics;metal alloys;xihe;biomorphic companions;kamitra;kamitra cigars;mick turner base;sisters refuge;unknown probe;coal 70;zero point;jameson's crashed cobra;davs hope;hillary depot; colonia route station 1; amundsen terminal; colonia route station 2; eagle's landing; colonia route station 3; eudaemon anchorage; colonia route station 4; sacaqawea space port; colonia route station 5; gagarin gate; colonia route station 6; caravanserai station; colonia route station 7; polo harbour; colonia route station 8; vihara gate; colonia route station 9;fircolonia;st crashed ship;second crashed ship;third crashed ship;old thargoid scout;unregistered derelict;alcatraz class prison ship;aquarius class tanker;banner class bulk cargo ship;bellmarsh class prison ship;bowman class science vessel;cave johnson memorial lab;demeter class agricultural vessel;dionysus class agricultural vessel;aie anzac honour;gordon class bulk cargo ship;henry class bulk cargo ship;hercules class bulk cargo ship;hogan class bulk cargo ship;lowell class science vessel;naphtha class tanker;riker class prison ship;sagan class tourist ship;samson class bulk cargo ship;samson class cargo ship;the gnosis;gnosis megaship;thomas class bulk cargo ship;dove enigma;dove enigma megaship;tilialas lament;the harmony;harmony megaship;fishers rest;fishers rest megaship;the midas;midas megaship;the indra;indra megaship;damaged henry cargo ship;damaged naphta tanker;damaged sanchez science vessel;damaged dionysus agricultural vessel;dmaged samson megaship;damaged aquarius tanker;damaged demeter class agricultural vessel;damaged thomas class cargo ship;damaged gordon class cargo ship;damaged hogan class cargo ship;nemb megaship;the zurara;zurara megaship;the cete;cete megaship;generation ship lycaon;generation ship venusian;generation ship hyperion;generation ship odysseus;generation ship thetis;generation ship pleione;generation ship atlas;generation ship lazarus;generation ship artemis;generation ship [1..9];federation rank [1..2];empire rank [1..2];mega barnicle [1..10];barnacle forest [1..10];inra [base;site] [1..10];thargoid site [1..240];alien ruins;guardian ruins [1..298]; eagle eye [1..6]

We have a google speadsheet with all the listing of "all the known special things" in the Elite galaxy that is downloaded when the user uses an update command, and downloads as a CSV file to the users computer.

When the user then says "Target Earth" it would type "Sol" in to the selected text field in game.
If they say "Distance to Earth" it uses a plugin to determine your XYZ and then does math to give you straight line distance to Sol, etc

Here is the question:

That suffix command is massive, and the issue with it, is that whenever something new is found in Elite, and we update the spreadsheet with the data, we have to push a new version of this single command out with the new location name on it so the user can use it.

Is there any idea to possibly simplify this, to make it a wildcard, so we would not have to update this for every little thing and/or make it so I could possibly point the "when I say" bit at something else for it to scan though and compare to what we have?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Simplifying a huge command, possible wildcard?
« Reply #1 on: June 06, 2018, 07:32:48 AM »
Command names can contain/exist entirely of variables, the main caveat is that you need to reload the profile to update the contents(Every time VoiceAttack starts, as the initial state of all variables is "Not Set").

I use something like this snippet in my profile startup command:
Code: [Select]
Set Text [commandName] to 'My command'
Begin Boolean Compare : [>>InitOnce] Equals False
    Set Boolean [>>InitOnce] to True
    Reset the active profile
End Condition

This will reload the profile(preserving all global or ">>" prefixed variable values); Given a command with the "When I say" value of "{TXT:commandName}", that command can now be executed by speaking "my command".


You can change the value of the variable at any time using your update command, and reload the profile at any time(keeping in mind ">" prefix and command-scoped variable values will be discarded, and running commands will terminate) to update the command name.


I should mention this functionality is considered experimental, so odd behavior may occur(I've not seen any yet personally, though).

Malic

  • Full Member
  • ***
  • Posts: 102
Re: Simplifying a huge command, possible wildcard?
« Reply #2 on: June 11, 2018, 09:24:34 PM »
I have been pulling my hair out trying to get this to work, do you happen to have a .vap with these two commands so I can see how you are triggering it?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Simplifying a huge command, possible wildcard?
« Reply #3 on: June 12, 2018, 09:16:20 AM »
An example profile is attached(the "Profile setup" command is intended to run when the profile loads, so either import it as a profile as manually set it up that way if you import the commands into an existing profile).


I did make two changes:

Code: [Select]
Begin Condition : [>>initOnce] Equals False OR [{CMDACTION}] Does Not Equal 'Profile'
Allows you to execute the "Profile setup" command manually, if required for whatever reason, but still prevents the command from looping on profile load(or letting the variable remain uninitialized).


And, the command name variable is now also profile-scoped(designated by the ">>" prefix), which just makes sense(it allows you to use the same command verbatim without worrying about variable name conflicts across profiles).