Release EDDI Scripts and EDDI enabled VA Commands Thread

I'm not sure about using VA for it, but I have the following that works in an EDDI script:
Code:
{for compartment in ship.compartments:
    {if find(compartment.module.name, "Docking") > -1:
        {set dockComp to true}
        {if compartment.module.enabled:
            {set dockCompOn to true}
        }
    }
}
I then check and use the dockComp and dockCompOn variables to do what I need. I'm fairly sure you can do something very similar to this in VA, at least the logic should be much the same. I'll look into it, but I'm sure someone will come along with a proper answer before I can, and if not, maybe you can figure it out from this before me. :)

I love you and I want to have your babies ;o)
 
I'm not sure about using VA for it, but I have the following that works in an EDDI script:
Code:
{for compartment in ship.compartments:
    {if find(compartment.module.name, "Docking") > -1:
        {set dockComp to true}
        {if compartment.module.enabled:
            {set dockCompOn to true}
        }
    }
}
I then check and use the dockComp and dockCompOn variables to do what I need. I'm fairly sure you can do something very similar to this in VA, at least the logic should be much the same. I'll look into it, but I'm sure someone will come along with a proper answer before I can, and if not, maybe you can figure it out from this before me. :)
Now i'm curious: for what this useful for?
 
I love you and I want to have your babies ;o)
Haha! 😂

Well, I've had a look over the VA commands, and I can't figure out how to access the array of 'ship.compartments'. Seems VA doesn't do arrays, and I wasn't able to access 'ship.compartments' to find the module names. I may be doing things wrong as I'm quite the beginner, and not great at VA. It may be better to set those variables as State variables in EDDI, then access them from VA.

Now i'm curious: for what this useful for?
I use that code in my 'Docking granted' and 'Undocked' EDDI scripts. In the first, I use it to simply to say "Auto dock engaged/activated" when the docking computer starts the docking process. It's the same for the 'Undocking' script, I use it to say "Auto launch in progress/activated" (for the Advanced Docking Computer). I need to know if the computer is installed and online before I can get EDDI to say those lines.

The code (or something very similar) is used in a few default scripts, which is where I got it from and then modified it to suite my needs. :)
 
Last edited:
I'm not sure about using VA for it, but I have the following that works in an EDDI script:
Code:
{for compartment in ship.compartments:
    {if find(compartment.module.name, "Docking") > -1:
        {set dockComp to true}
        {if compartment.module.enabled:
            {set dockCompOn to true}
        }
    }
}
I then check and use the dockComp and dockCompOn variables to do what I need. I'm fairly sure you can do something very similar to this in VA, at least the logic should be much the same. I'll look into it, but I'm sure someone will come along with a proper answer before I can, and if not, maybe you can figure it out from this before me. :)

@Darkcyde. I've shamelessly nicked your code and have put it into the ship loadout event in EDDI. What's the syntax to check the dockComp and dockCompOn variables in VA?

Cheers.
This works for VoiceAttack:
Code:
Begin Integer Compare : [Ship compartments] Has Been Set
    Start Loop : Repeat From 1 to [Ship compartments]
        Begin Text Compare : [{TXT:Ship compartment {INT:n} module}] Contains 'Docking'
            __ Do something or set a variable indicating you have a docking computer here __
        End Condition
    End Loop
End Condition
 
@Darkcyde. I've shamelessly nicked your code and have put it into the ship loadout event in EDDI. What's the syntax to check the dockComp and dockCompOn variables in VA?

Cheers.
If you set them as State variables in EDDI (so {SetState('dockComp', true)} for example) then in VA you can just do an IF statement, Begin Boolean Compare : [EDDI state dockComp] Equals True then inside this, run all you code for when it's True.

As a docking computer can be turned off, it probably best to set the State variable back to false when you've finished docking. That way, when you next go to dock in a ship that doesn't have one, it should work correctly.
 
This works for VoiceAttack:
Code:
Begin Integer Compare : [Ship compartments] Has Been Set
    Start Loop : Repeat From 1 to [Ship compartments]
        Begin Text Compare : [{TXT:Ship compartment {INT:n} module}] Contains 'Docking'
            __ Do something or set a variable indicating you have a docking computer here __
        End Condition
    End Loop
End Condition
Ahhh, I didn't know you could do a '... From 1 to [Ship compartments]' I tried to be too literal in my conversion to VA, so no wonder I couldn't do it. Thank you very much for the info! :) I'm going to save this for the future, it may come in handy for me one day.
 
Ok, after a whole Sunday in translating what i hope will be promoted as the "default italian" personality, some of my scripts sounded weird. It took me some hours before checking the log file, and i discovered that all my double-quoted strings were written exactly in that way, double quoted, so, for example, a script like this
Code:
"Welcome back"
{F('honorific')}
"."
produces this phrase:
Code:
"Welcome back" "commander" "."
🤨
Obviously it sounded weird!

Is this normal? i thought that the quotes were eliminated in the final output, unless escaped.
 
Excellent.
This works for VoiceAttack:
Code:
Begin Integer Compare : [Ship compartments] Has Been Set
    Start Loop : Repeat From 1 to [Ship compartments]
        Begin Text Compare : [{TXT:Ship compartment {INT:n} module}] Contains 'Docking'
            __ Do something or set a variable indicating you have a docking computer here __
        End Condition
    End Loop
End Condition
Put this into my script and it works like a dream.

Many thanks.
 
Ok, after a whole Sunday in translating what i hope will be promoted as the "default italian" personality, some of my scripts sounded weird. It took me some hours before checking the log file, and i discovered that all my double-quoted strings were written exactly in that way, double quoted, so, for example, a script like this
Code:
"Welcome back"
{F('honorific')}
"."
produces this phrase:
Code:
"Welcome back" "commander" "."
🤨
Obviously it sounded weird!

Is this normal? i thought that the quotes were eliminated in the final output, unless escaped.
I'm afraid that is normal. Text not enclosed in curly brackets is rendered exactly as written.
 
Excellent.

Put this into my script and it works like a dream.

Many thanks.
I take it back. I thought it was working, but although [Ship compartments] has been set (it gets past the "if" test), it has a value of 0. I tested it in the both the called command and the calling command and it's set to 0 in both. In the called command, [{TXT:Ship compartment {INT:n} module}] (within the loop) is not set.

I'm looking at it, but I can't see a reason.
 
I take it back. I thought it was working, but although [Ship compartments] has been set (it gets past the "if" test), it has a value of 0. I tested it in the both the called command and the calling command and it's set to 0 in both. In the called command, [{TXT:Ship compartment {INT:n} module}] (within the loop) is not set.

I'm looking at it, but I can't see a reason.
The variables for your ship don't begin to be set unless you're in-game triggering events. Ideally you'd invoke this after a Ship loadout event in-game for the most up-to-date data.
 
Yes. I tried docking/undocking and going into/out of the outfitting screen. Currently, the ship loadout event doesn't do anything (either in EDDI or VA). Do I need to set anything in it? I'm sure it's me doing something stupid.

Here's what I have. I'm preparing to look silly.

Log file:

4:06:32.105 False
4:06:32.096 kount is : 0 | Not set --- Docking
4:06:32.091 kount is : 1 | Not set --- Docking
4:06:32.089 Ship compartments = 0
4:06:32.020 compartments: 0
4:06:32.018 Recognized : 'testing'

Calling procedure code:

Execute command, 'IsModuleInstalled' (by name) - passing values (and wait until it completes)
Write [Blue] '{BOOL:>>ModuleInstalled}' to log
Write [Blue] 'compartments: {INT:Ship compartments}' to log

/code

Called procedure code:

Check that the relelvant module is fitted.
Begin Text Compare : [~passedText1] Has Been Set
Set Boolean [>>ModuleInstalled] to False
Begin Integer Compare : [Ship compartments] Has Been Set
Write [Orange] 'Ship compartments = {INT:Ship compartments}' to log
Start Loop : Repeat From 1 to [Ship compartments]
Write [Orange] 'kount is : {INT:kount} | {TXT:Ship compartment {INT:kount} module} --- {TXT:~passedText1}' to log
Begin Text Compare : [{TXT:Ship compartment {INT:kount} module}] Contains '{TXT:~passedText1}'
Set Boolean [>>ModuleInstalled] to True
End Condition
End Loop
End Condition
End Condition

/code

Any ideas?
 
Last edited:
Yes. I tried docking/undocking and going into/out of the outfitting screen. Currently, the ship loadout event doesn't do anything (either in EDDI or VA). Do I need to set anything in it? I'm sure it's me doing something stupid.

Here's what I have. I'm preparing to look silly.

Log file:

4:06:32.105 False
4:06:32.096 kount is : 0 | Not set --- Docking
4:06:32.091 kount is : 1 | Not set --- Docking
4:06:32.089 Ship compartments = 0
4:06:32.020 compartments: 0
4:06:32.018 Recognized : 'testing'

Calling procedure code:

Execute command, 'IsModuleInstalled' (by name) - passing values (and wait until it completes)
Write [Blue] '{BOOL:>>ModuleInstalled}' to log
Write [Blue] 'compartments: {INT:Ship compartments}' to log

/code

Called procedure code:

Check that the relelvant module is fitted.
Begin Text Compare : [~passedText1] Has Been Set
Set Boolean [>>ModuleInstalled] to False
Begin Integer Compare : [Ship compartments] Has Been Set
Write [Orange] 'Ship compartments = {INT:Ship compartments}' to log
Start Loop : Repeat From 1 to [Ship compartments]
Write [Orange] 'kount is : {INT:kount} | {TXT:Ship compartment {INT:kount} module} --- {TXT:~passedText1}' to log
Begin Text Compare : [{TXT:Ship compartment {INT:kount} module}] Contains '{TXT:~passedText1}'
Set Boolean [>>ModuleInstalled] to True
End Condition
End Loop
End Condition
End Condition

/code

Any ideas?
I've just tried that code out, and (after a few tries because I don't know VA well) I've managed to get it working. I didn't even need to log into game. The only thing I can think of that isn't mentioned above, is that you need to set the indexer to 'n' (or whatever variable you want to use) in the 'Repeat' command. This may be obvious for some people, but it wasn't for a beginner like me ;) . After I had figured that out, it all worked fine for me.

1618939105336.png

In working it out, I added a few extra test lines, but this is what I got without even logging into game...
1618939243997.png

The 9 is the number of compartments, then I got it to report each iteration and what was found in that slot, plus the report of finding my docking computer. Seems mine is in my last slot (slot size 1, so it reports from the biggest slot size, going down).

EDIT: Here's a screen shot of my code:
1618939944601.png
 
Last edited:
Hmmmm! The obvious difference is that your code says "using indexer n" and mine doesn't. I've set the indexer name to "kount" (I'm a programmer and it's what I always use), but it comes up without the "indexer" bit. I tried setting the indexer to "n", but it made no difference. What loop command did you use? I used "Add a loop start/Repeat a certain number of times".

I'm officially confused.
 
Hmmmm! The obvious difference is that your code says "using indexer n" and mine doesn't. I've set the indexer name to "kount" (I'm a programmer and it's what I always use), but it comes up without the "indexer" bit. I tried setting the indexer to "n", but it made no difference. What loop command did you use? I used "Add a loop start/Repeat a certain number of times".

I'm officially confused.
I used the same, 'Repeat certain number of times (For Loop)'. When I started, I didn't have the indexer, and I added that after I wasn't getting any results. I don't think it matters what you choose to call the indexer, as long as you use the same throughout the command.

I just tried adding another loop in the same way, using an indexer of 'test', and when I clicked OK, it was added to the command just like in my image, saying '...using indexer [test]'. I'm not sure why it wouldn't be appearing for you, but it does sound like that may be the root cause. :unsure:

Like I say though, I'm a noob when it comes to VA. I'm much better with EDDI scripting. ;)

EDIT: If it's not the indexer, maybe it's something to do with the passing of variables? Have you tried the code just the way T'kael had it originally, without the passing parts?
 
Hmmmm! The obvious difference is that your code says "using indexer n" and mine doesn't. I've set the indexer name to "kount" (I'm a programmer and it's what I always use), but it comes up without the "indexer" bit. I tried setting the indexer to "n", but it made no difference. What loop command did you use? I used "Add a loop start/Repeat a certain number of times".

I'm officially confused.

I used the same, 'Repeat certain number of times (For Loop)'. When I started, I didn't have the indexer, and I added that after I wasn't getting any results. I don't think it matters what you choose to call the indexer, as long as you use the same throughout the command.

I just tried adding another loop in the same way, using an indexer of 'test', and when I clicked OK, it was added to the command just like in my image, saying '...using indexer [test]'. I'm not sure why it wouldn't be appearing for you, but it does sound like that may be the root cause. :unsure:

Like I say though, I'm a noob when it comes to VA. I'm much better with EDDI scripting. ;)

EDIT: If it's not the indexer, maybe it's something to do with the passing of variables? Have you tried the code just the way T'kael had it originally, without the passing parts?
The VoiceAttack beta adds "using indexer ...". I set up my example up using n as my indexer like Darkcyde showed but kount should work just as well. 🤔
 
The former (70%) event is removed from the speech queue in favor of the latter (60%) because only the more recent of the two events is still relevant. Note that this only filters queued speech, not active speech. I've added Docking denied and Docking requested to do this on the next release.
Can i suggest to add lights, limpet launched, and perhaps material inventory report?
(i may do this request again for other scripts, in the near future ;) )
 
Can i suggest to add lights, limpet launched, and perhaps material inventory report?
(i may do this request again for other scripts, in the near future ;) )
Lights is good because it describes a state change where the old state no longer contains any useful information for the current context. I'm less certain about the other two you proposed.

I looked through our events list and identified a handful of events which I think are appropriate to add to the list. Adding the following:
  • Cargo scoop
  • Glide
  • Hardpoints
  • Landing gear
  • Lights
  • Near surface
  • Silent running
  • SRV turret deployable
 
Top Bottom