Author Topic: EDDi command ship loadout  (Read 1031 times)

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
EDDi command ship loadout
« on: April 04, 2022, 10:17:00 PM »
I am trying to get this command to find if there is a docking computer on my ship from the loadout eddi event. I an not sure what I am doing wrong.


Execute external plugin, 'EDDI 4.0.1' using context '((ship Loadout))'
Begin Text Compare : [{TXT:EDDI ship loadout compartments <10> module name}] Equals '"int_dockingcomputer_advanced"'
    Say, 'yes'
Else If Text Compare : [{TXT:EDDI ship loadout compartments <10> module name}] Does Not Equal '"int_dockingcomputer_advanced"'
    Say, 'no'
End Condition

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: EDDi command ship loadout
« Reply #1 on: April 05, 2022, 08:35:23 AM »
Have you read the documentation on EDDI's VoiceAttack plugin?

  • Variables should be updated automatically by the plugin without needing to call it
  • There is no "EDDI" in the variable names
  • There is no such variable as "ship loadout compartments"
  • "<index>" is used to indicate where the number goes, I.E. you want to replace all of it, including the "<>" characters
  • There is also no need to check both whether a value equals another value, and then again whether a value does not equal that same other value; if one is true, the other logically cannot be true, so an Else rather than an Else If will achieve the same result.

You can use the "Write a Value to the Event Log" action to see the value of a variable (using the relevant token for that variable type), to make sure it contains the value you think it does (and that it contains a value at all; if it doesn't, you may be using an incorrect variable name, or the data you're requesting isn't available in the current game state).

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: EDDi command ship loadout
« Reply #2 on: April 05, 2022, 11:44:33 AM »
Believe me I have read it, the question do I understand it? appears to be no. I have spent the last 3 days reading the suggested instructions, some of your post that seem similar to what I was doing. I will go back and with the info you provided I will try and see where I went wrong Thanks

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: EDDi command ship loadout
« Reply #3 on: April 05, 2022, 02:12:23 PM »
So I saw the part that there is not ship loadout event.

These are not variables?
To respond to this event in VoiceAttack, create a command entitled ((EDDI ship loadout)). VoiceAttack variables will be generated to allow you to access the event information.

The following VoiceAttack variables are available for this event:

    {INT:EDDI ship loadout compartments} - The compartments (objects) of the ship

    {INT:EDDI ship loadout compartments <index> module ammoinclip}

    {INT:EDDI ship loadout compartments <index> module ammoinhopper}

    {INT:EDDI ship loadout compartments <index> module class}

    {INT:EDDI ship loadout compartments <index> module clipcapacity}

    {BOOL:EDDI ship loadout compartments <index> module enabled}

    {INT:EDDI ship loadout compartments <index> module engineerlevel}

    {DEC:EDDI ship loadout compartments <index> module engineerquality}

    {TXT:EDDI ship loadout compartments <index> module grade}

    {DEC:EDDI ship loadout compartments <index> module health}

    {INT:EDDI ship loadout compartments <index> module hoppercapacity}

    {BOOL:EDDI ship loadout compartments <index> module hot}

    {TXT:EDDI ship loadout compartments <index> module invariant name}

    {TXT:EDDI ship loadout compartments <index> module modification}

    {BOOL:EDDI ship loadout compartments <index> module modified}

    {TXT:EDDI ship loadout compartments <index> module mount}

    {TXT:EDDI ship loadout compartments <index> module name}

You have to type "ship" in the search to find them

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: EDDi command ship loadout
« Reply #4 on: April 05, 2022, 02:25:53 PM »
I assumed you were attempting to use the variables listed under "Ship Variables" on https://github.com/EDCD/EDDI/blob/develop/VoiceAttack-Integration.md

In case of the event, you'd want to name your command "((EDDI ship loadout))", as noted on https://github.com/EDCD/EDDI/wiki/Ship-loadout-event, so the EDDI plugin can trigger it (again, there is no need to call the plugin manually).

Once it is triggered, the listed variables (which are wrapped in tokens) should indeed be available. As mentioned, you'd want to replace "<index>" with a number.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: EDDi command ship loadout
« Reply #5 on: April 05, 2022, 02:29:58 PM »
I created the ((ship loadout)) event. But with all my searching I could not find out what the index was referencing. I assumed it was the module slot the docking computer was in.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: EDDi command ship loadout
« Reply #6 on: April 05, 2022, 04:48:15 PM »
...have you tried entering a number like 0, and looking at the values of the variables?

As mentioned earlier, if you're not sure what value a variable has, use the "Write a Value to the Event Log" action to check. This is one of the most basic principles of debugging.


The "EDDI ship loadout compartments" integer variable should contain the amount of "compartments", so if that number is 5, indices 0 to 4 should be valid.

E.G. if you then have a look at the value of the "EDDI ship loadout compartments 0 module name" text variable, that should be the name of the first module.