I don't have any experince with scripting, but i'll try. Any hint on where to find examples of similar checks?
The 'Swapout check' script does a fair bit with compartments, so that would probably be a good place to look for inspiration.
I don't have any experince with scripting, but i'll try. Any hint on where to find examples of similar checks?
I actually have the code to do this, but EDDI isn't always standalone. If it is started through VoiceAttack it causes problems. I need to talk to the VoiceAttack devs to see of there are any ways around this.
I'm pleased to announce the release of EDDI 2.1. .
Is there a .VAP file with this?
The 'Swapout check' script does a fair bit with compartments, so that would probably be a good place to look for inspiration.
{set oldshiphadbay to 0}
{set newshiphasbay to 0}
{if len(event.storedshipid) = 19:
{set oldshiphadbay to 1}
|elif len(event.storedshipid) = 23:
{set oldshiphadbay to 1}
|elif len(event.storedshipid) = 44:
{set oldshiphadbay to 1}
|elif len(event.storedshipid) = 57:
{set oldshiphadbay to 1}
|elif len(event.storedshipid) = 99:
{set oldshiphadbay to 1}
}
{if len(event.shipid) = 19:
{set newshiphasbay to 1}
|elif len(event.shipid) = 23:
{set newshiphasbay to 1}
|elif len(event.shipid) = 44:
{set newshiphasbay to 1}
|elif len(event.shipid) = 57:
{set newshiphasbay to 1}
|elif len(event.shipid) = 99:
{set newshiphasbay to 1}
}
{if newshiphasbay = 1:
{if oldshiphadbay = 0:
Remember to activate your Crew and set the number of bays accordingly.}
}
Thanks mate! As i did not completely get the module part, i fiddled together this one:
Code:{set oldshiphadbay to 0} {set newshiphasbay to 0} {if len(event.storedshipid) = 19: {set oldshiphadbay to 1} |elif len(event.storedshipid) = 23: {set oldshiphadbay to 1} |elif len(event.storedshipid) = 44: {set oldshiphadbay to 1} |elif len(event.storedshipid) = 57: {set oldshiphadbay to 1} |elif len(event.storedshipid) = 99: {set oldshiphadbay to 1} } {if len(event.shipid) = 19: {set newshiphasbay to 1} |elif len(event.shipid) = 23: {set newshiphasbay to 1} |elif len(event.shipid) = 44: {set newshiphasbay to 1} |elif len(event.shipid) = 57: {set newshiphasbay to 1} |elif len(event.shipid) = 99: {set newshiphasbay to 1} } {if newshiphasbay = 1: {if oldshiphadbay = 0: Remember to activate your Crew and set the number of bays accordingly.} }
Of course, far from efficient, but at least it's working.
Not too shabby for a first try, me thinks.
Any optimization tips would be welcome.
{set modulefound to 0}
{for compartment in ship.compartments:
{if compartment.module.name = "Fighter Hangar":
{set modulefound to 1}
}
}
{if modulefound = 1:
{if state.fighterbay = 0:
{SetState("fighterbaywas", 0)}
|else:
{SetState("fighterbaywas", 1)}
}
{SetState("fighterbay", 1)}
|else:
{if state.fighterbay = 0:
{SetState("fighterbaywas", 0)}
|else:
{SetState("fighterbaywas", 1)}
}
{SetState("fighterbay", 0)}
}
{_ Check for the presence of a fighter bay _}
{F("Fighter bay check")}
{_ Check for the presence of a fighter bay _}
{F("Fighter bay check")}
{if state.fighterbay = 1:
{if state.fighterbaywas = 0:
{Pause(1000)}
{OneOf("Ready for fighter crew assignments.", "Fighter crew ready for new assignments.")}
}
}
{set fighterbay to false}
{for compartment in ship.compartments:
{if compartment.module.name = "Fighter Hangar":
{set fighterbay to true}
}
}
{SetState("fighterbay", fighterbay)}
{set fighterbaywas to state.fighterbay}
{_ Check for the presence of a fighter bay _}
{F("Fighter bay check")}
{if state.fighterbay && !fighterbaywas:
{Pause(1000)}
{OneOf("Ready for fighter crew assignments.", "Fighter crew ready for new assignments.")}
}
Begin Boolean Compare : [EDDI state fighterbay] Equals False
Say, 'Unable to comply. Fighter bay not installed'
End Condition - Exit when condition met
Execute command, '((Deploy Fighter))' (and wait until it completes)
Set Boolean [test_bool] to True
Set Text [State variable] to 'test_bool'
Execute external plugin, 'EDDI 2.1.0' and wait for return
Set integer [test_int] value to 4
Set Text [State variable] to 'test_int'
Execute external plugin, 'EDDI 2.1.0' and wait for return
Set decimal [test_dec] value to 3.14
Set Text [State variable] to 'test_dec'
Execute external plugin, 'EDDI 2.1.0' and wait for return
Set Text [test_txt] to 'this is a test'
Set Text [State variable] to 'test_txt'
Execute external plugin, 'EDDI 2.1.0' and wait for return
Set Text [Script] to 'State test'
Execute external plugin, 'EDDI 2.1.0' and wait for return
Write '[Blue] Test Boolean = {BOOL:EDDI state test_bool}' to log
Write '[Blue] Test Integer = {INT:EDDI state test_int}' to log
Write '[Blue] Test Decimal = {DEC:EDDI state test_dec}' to log
Write '[Blue] Test Text = {TXT:EDDI state test_txt}' to log
Write '[Blue] Test Two Boolean = {BOOL:EDDI state test2_bool}' to log
Write '[Blue] Test Two Integer = {INT:EDDI state test2_int}' to log
Write '[Blue] Test Two Decimal = {DEC:EDDI state test2_dec}' to log
Write '[Blue] Test Two Text = {TXT:EDDI state test2_txt}' to log
Test boolean is {state.test_bool}.
{Pause(1000)}
Test integer is {state.test_int}.
{Pause(1000)}
Test decimal is {state.test_dec}.
{Pause(1000)}
Test text is {state.test_txt}.
{set test2_bool to false}
{SetState("test2_bool", test2_bool)}
{SetState("test2_int", 7)}
{SetState("test2_dec", 2.72)}
{SetState("test2_txt", "This is another test")}
{Pause(3000)}
Test two boolean is {state.test2_bool}.
{Pause(1000)}
Test two integer is {state.test2_int}.
{Pause(1000)}
Test two decimal is {state.test2_dec}.
{Pause(1000)}
Test two text is {state.test2_txt}.
Test Boolean = True
Test Integer = 4
Test Decimal = 3.14
Test Text = this is a test
Test Two Boolean = Not set
Test Two Integer = Not set
Test Two Decimal = Not set
Test Two Text = Not set
I'm pleased to announce the release of EDDI 2.1.
I downloaded EDDI yesterday and installed. This morning when I invoked VA and the profile was told 2.1 is available. Followed the link in this forom which downloaded the (seemingly) identical EDDI.exe and copied the extracted EDDI folder into the VA Apps folder overwriting the old one. When starting VA it still tells me version 1.4.0 initialised.
What have I done wrong?
{set insurance to round(ship.value * cmdr.insurance / 100)}
{set covereds to round((cmdr.credits / insurance - 0.51))}
{if covereds = 0:
Danger: you do not have enough credits to cover your insurance excess.
|elif covereds = 1:
Caution: you only have enough credits to cover a single insurance excess.
|elif covereds < 4:
Note: you only have enough credits to cover {covereds} insurance excesses.
|else:
You have enough credits to cover round({covereds}) insurance excesses.
}
I downloaded your GENUINE "little" Tool today.
Managed to set it up with VA and did a quicktest to stow the landing gear automatically after undocking from a station with ((EDDI undocked)). Followed your instruction from the video on Page1 exactly. But the script is never triggeredBug?
To checkI created another event with ((EDDI entered normal space)) to just play a sound. This worked well.
jgm,
The ability to access state variables created within a speech responder script from Voice Attack appears to not behave as expected after updating from 2.1.0-b3 to 2.1.0-final.
I tested the functionality with the following speech responder and Voice Attack scripts:
Voice Attack 'State variable test':
Code:Set Boolean [test_bool] to True Set Text [State variable] to 'test_bool' Execute external plugin, 'EDDI 2.1.0' and wait for return Set integer [test_int] value to 4 Set Text [State variable] to 'test_int' Execute external plugin, 'EDDI 2.1.0' and wait for return Set decimal [test_dec] value to 3.14 Set Text [State variable] to 'test_dec' Execute external plugin, 'EDDI 2.1.0' and wait for return Set Text [test_txt] to 'this is a test' Set Text [State variable] to 'test_txt' Execute external plugin, 'EDDI 2.1.0' and wait for return Set Text [Script] to 'State test' Execute external plugin, 'EDDI 2.1.0' and wait for return Write '[Blue] Test Boolean = {BOOL:EDDI state test_bool}' to log Write '[Blue] Test Integer = {INT:EDDI state test_int}' to log Write '[Blue] Test Decimal = {DEC:EDDI state test_dec}' to log Write '[Blue] Test Text = {TXT:EDDI state test_txt}' to log Write '[Blue] Test Two Boolean = {BOOL:EDDI state test2_bool}' to log Write '[Blue] Test Two Integer = {INT:EDDI state test2_int}' to log Write '[Blue] Test Two Decimal = {DEC:EDDI state test2_dec}' to log Write '[Blue] Test Two Text = {TXT:EDDI state test2_txt}' to log
Speech responder 'State test':
Code:Test boolean is {state.test_bool}. {Pause(1000)} Test integer is {state.test_int}. {Pause(1000)} Test decimal is {state.test_dec}. {Pause(1000)} Test text is {state.test_txt}. {set test2_bool to false} {SetState("test2_bool", test2_bool)} {SetState("test2_int", 7)} {SetState("test2_dec", 2.72)} {SetState("test2_txt", "This is another test")} {Pause(3000)} Test two boolean is {state.test2_bool}. {Pause(1000)} Test two integer is {state.test2_int}. {Pause(1000)} Test two decimal is {state.test2_dec}. {Pause(1000)} Test two text is {state.test2_txt}.
The speech responder script behaved (verbally) exactly of written/expected. Voice Attack produced the following results:
Code:Test Boolean = True Test Integer = 4 Test Decimal = 3.14 Test Text = this is a test Test Two Boolean = Not set Test Two Integer = Not set Test Two Decimal = Not set Test Two Text = Not set
As you can see, EDDI state variables can be accessed from Voice Attack when Voice Attack creates the states variables, but not when the speech responder does.
In my circumstance, this has 'broken' some speech responder/VA scripts that were previously working and used regularly in 2.1.0-b3.
I keep getting a 0 for cmdr.insurance.