Author Topic: Replacing commands that are referenced by other commands results in error  (Read 5420 times)

RedMonster

  • Guest
I had set up a group of keybind commands that were used as a centralized library to quickly update when keybinds were changed without having to go into each and every spoken command and update the key presses. One thought I had was that if I saved multiple versions of these keybind files (in this case, for Star Citizen 2.3 and 2.4) that I could just import the keybinds for the desired version.

The problem I have run into is that, when replacing commands, the command ID for the keybind actually changes, so all of the functions/commands that reference it return the error "COMMAND COULD NOT BE FOUND"

I have seen the "execute command by name" option but didn't think it would be as efficient to use that option. Any ideas how to get over this?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
I did some testing, and it turns out the GUID of commands is regenerated every export. I'd assume when exporting commands referencing other commands, the export updates the referenced GUID so it still works, which can't happen if you're only exporting the referenced commands.

To prevent mismatches, you'd have to export referencing commands as well, so you can import them again, together. Of course, this will prevent modification in the interim, so it's hardly a solution.


Alternatively, if you're just switching between sets of keybinds, while it's not as "neat", you could have a check in the commands themselves:

Code: [Select]
Begin Text Compare : [StarCitizenVersion] Equals '2.3'
    Press A key and hold for 0,06 seconds and release
Else If Text Compare : [StarCitizenVersion] Equals '2.4'
    Press B key and hold for 0,06 seconds and release
Else
    Press C key and hold for 0,06 seconds and release
End Condition

I'm assuming you have a "setup" command that runs on profile load, within which you could specify which version you're using.

Rhaedas

  • Jr. Member
  • **
  • Posts: 72
Pfeil typed his as I was responding, think we're suggesting the same thing.

So you're putting them into a different profile, and when you make those changes in that profile it's not carrying over to the main?

What if you had the various commands as their own command, protected by voice disabling and/or some name convention, like ((<name>)) or <some non-verbal character><name>. Now, each command would have the keybinds for all the versions set, with a test for the version being used. That test variable could be set at the beginning, and you could have VA automatically default to one of them until you change it.

If you need more clarification I can go more into depth. But obviously there's more going on underneath than just the command name matching, so different profiles embedded won't work if you change them.