Release EDDI Scripts and EDDI enabled VA Commands Thread

Ok, so here is... let's call it version v0.5. :) This is basic, and doesn't consider mission cargo yet, but I wanted to let people have a look at it, as it is at the moment. This will work perfectly well if you are only doing trading or pirating or scavenging (or should do anyway).

Create four new scripts:-

CargoLog_Add
Code:
{_ CargoLog_Add}
{_ Add commodities to the Cargo Log}


{if state.eddi_context_cargo_initialised != "yes": {F("CargoLog_Initialise")}}

{_ Setup arrays}
{set cargo_commodity_array to split(state.eddi_context_cargo_commodity, "+=")}
{set cargo_amount_array to split(state.eddi_context_cargo_amount, "+=")}
{set cargo_power_array to split(state.eddi_context_cargo_power, "+=")}

{if state.eddi_context_last_action = "collect":
    {set amount to 1}
|else:
    {set amount to event.amount}
}

{if event.power: {set power to event.power} |else: {set power to ""}}

{set position to find(cargo_commodity_array, event.commodity, 0)}

{if position > -1:

    {set amount to amount + cargo_amount_array[position]}

    {_ Update array}
    {set cargo_amount_array to union(cargo_amount_array, [position:amount])}

|else:

    {set cargo_commodity_array to cat(cargo_commodity_array, [event.commodity])}
    {set cargo_amount_array to cat(cargo_amount_array, [amount])}
    {set cargo_power_array to cat(cargo_power_array, [power])}

}

{_ Set State variable string seperator}
{if len(cargo_commodity_array) < 2: {set sep to ""} |else: {set sep to "+="}}

{_ Add new item to State variable strings }
{SetState('eddi_context_cargo_commodity', join(cargo_commodity_array, sep))}
{SetState('eddi_context_cargo_amount', join(cargo_amount_array, sep))}
{SetState('eddi_context_cargo_power', join(cargo_power_array, sep))}

CargoLog_Delete
Code:
{_ CargoLog_Delete}
{_ Delete sold or ejected cargo from the log}


{if state.eddi_context_cargo_initialised != "yes": {F("CargoLog_Initialise")}}

{_ Setup arrays}
{set cargo_commodity_array to split(state.eddi_context_cargo_commodity, "+=")}
{set cargo_amount_array to split(state.eddi_context_cargo_amount, "+=")}
{set cargo_power_array to split(state.eddi_context_cargo_power, "+=")}


{if state.eddi_context_last_action = "eject":
    {set position to find(cargo_commodity_array, event.name, 0)}
|else:
    {set position to find(cargo_commodity_array, event.commodity, 0)}
}

{if position > -1:

    {if cast(cargo_amount_array[position], "n") = event.amount:

        {_ Rebuild array strings}
        {if len(cargo_commodity_array) < 3: {set sep to ""} |else: {set sep to "+="}}
        {set cargo_commodity_array to join(except(cargo_commodity_array, [position:""]), sep)}
        {set cargo_amount_array to join(except(cargo_amount_array, [position:""]), sep)}
        {set cargo_power_array to join(except(cargo_power_array, [position:""]), sep)}

        {_ Rewrite State variable strings}
        {SetState('eddi_context_cargo_commodity', cargo_commodity_array)}
        {SetState('eddi_context_cargo_amount', cargo_amount_array)}
        {SetState('eddi_context_cargo_power', cargo_power_array)}

    |else:
        {if len(cargo_commodity_array) < 2: {set sep to ""} |else: {set sep to "+="}}
        {set amount to cargo_amount_array[position] - event.amount}
        {set cargo_amount_array to union(cargo_amount_array, [position:amount])}
        {SetState('eddi_context_cargo_amount', join(cargo_amount_array, sep))}
    } 

|else:
    Cargo not found in database to delete.
}

CargoLog_Initialise
Code:
{_ CargoLog_Initialise}
{_ Setup Cargo Log 'database'}


{SetState('eddi_context_cargo_name', "")}
{SetState('eddi_context_cargo_amount', "")}
{SetState('eddi_context_cargo_power', "")}

{SetState('eddi_context_cargo_initialised', "yes")}

Cargo Log Initialised.

CargoLog_Report
Code:
{_ CargoLog_Report}
{_ Report current cargo manifest}

{_ Setup arrays}
{set cargo_commodity_array to split(state.eddi_context_cargo_commodity, "+=")}
{set cargo_amount_array to split(state.eddi_context_cargo_amount, "+=")}
{set cargo_power_array to split(state.eddi_context_cargo_power, "+=")}


You are carrying {ship.cargocarried} tonnes, from a total of {ship.cargocapacity} {Occasionally ("tonnes")}.

{if len(cargo_commodity_array) > 0:
    Cargo Manifest is as follows.
    {set position to 0}
    {for cargo in cargo_commodity_array:
        {cargo_amount_array[position]} tonnes of {cargo}.
        {set position to position + 1}
    }
}

To use them...

Add {F("CargoLog_Add")} to the following events:-
Commodity Collected
Commodity Purchased
Power Commodity Obtained

Add {F("CargoLog_Delete")} to the following events:-
Commodity Ejected
Commodity Sold
Power Commodity Delivered

I've only tested these with the EDDI test button so far, but my testing seems to show that it will work in-game OK.

Next up is working on mission cargo! :D

-=] Darkcyde [=-


EDIT: Forgot to say, CargoLog_Report must be called manually as I haven't created a VA command for it yet. I was using it for testing mainly, but it works well enough for a basic report.

Very good job on the mission script so far.

One problem I'm having is that it always reports as having 0 cargo. The ship.cargocarried variable always seems to return 0. I believe that this variable was broken with latest updates to ED.

Is there a way to substitute your cargo carried total amount for this variable?

And now for the wish list LOL. Is there a way to add limpets to the cargo script?
 
Thanks for checking this out for me. I will just have to stay more focused in open zones on looking for other players vs just the mission.
 
Very good job on the mission script so far.

One problem I'm having is that it always reports as having 0 cargo. The ship.cargocarried variable always seems to return 0. I believe that this variable was broken with latest updates to ED.

Is there a way to substitute your cargo carried total amount for this variable?

And now for the wish list LOL. Is there a way to add limpets to the cargo script?

Haha! Funny you should ask for that, as I added them in last night just before I went to bed! ;) I do have to work out a calculation for them though, as I couldn't find a way to show when you have used one, so no record of the number going down. Shouldn't be too hard though, I think I can add a small 're-adjustment' function to the report to sort it out.

I hope to have a release ready later tonight. Fingers-crossed!
 
Haha! Funny you should ask for that, as I added them in last night just before I went to bed! ;) I do have to work out a calculation for them though, as I couldn't find a way to show when you have used one, so no record of the number going down. Shouldn't be too hard though, I think I can add a small 're-adjustment' function to the report to sort it out.

I hope to have a release ready later tonight. Fingers-crossed!

The only way you can detect use of a limpet is through Voice Attack, by tracking Fire Groups, intercepting Primary/Secondary Fire buttons being pressed, and calling a speech responder script to decrement the count.
 
The only way you can detect use of a limpet is through Voice Attack, by tracking Fire Groups, intercepting Primary/Secondary Fire buttons being pressed, and calling a speech responder script to decrement the count.

Ah ok, makes sense. I was thinking of something more along the lines of adjusting the stored amount when reporting. I lifted (and modified) this from the Limpets check script:-

Code:
{_ Check and account for any Limpets on board. Total up cargo carried}
{set cargocarried to 0}
{set limpets to 0}
{for cargo in ship.cargo:
    {set cargocarried to cargocarried + cargo.amount}
    {if cargo.commodity.name = "Limpet":
        {set position to find(cargo_commodity_array, "Limpet", 0)}
        {set cargo_amount_array to union(cargo_amount_array, [position:cargo.amount])}
    }
}

This seems to work, but the ship.cargo doesn't get updated very often at all. I may add this as a 'fail-safe' for those that don't use VA, although I'm not sure how useful it could be, if at all.
 
Better late then never! Latest version now available in my sig below. :D

Note that the CargoLog is still a work in progress.
 
Last edited:
Better late then never! Latest version now available in my sig below. :D

Note that the CargoLog is still a work in progress.

Question my Cargo 'checker' in Voice Attack , is saying , You are not using any of the tonnes of cargo space, when I do have cargo on-board nearly full

is there a reason for this, has something changed ?

As I not sure if EDDI Cargo log is relevant to this issue, thought I would ask.

Quick Ship status
Execute external plugin, 'EDDI 2.3.0' and wait for return
Begin Decimal Compare : [bounty] Does Not Equal 0
Set Text [script] to 'You have been fined by {TXT:EDDI fine incurred faction} for the crime of {TXT:EDDI fine incurred crimetype} against {TXT:EDDI fine incurred victim}.'
Execute external plugin, 'EDDI 2.3.0' and wait for return
End Condition
Say, 'Checking [internal bays' or 'the ship holds]' (and wait until it completes)
Pause 1 second
Begin Integer Compare : [Ship cargo capacity] Equals [Ship cargo carried]
Set Text [script] to 'You are using all of the {INT:Ship cargo capacity} tonnes of cargo space.'
Else If Integer Compare : [Ship cargo carried] Equals 0
Set Text [script] to 'You are not using any of the {INT:Ship cargo capacity} tonnes of cargo space.'
Else
Set Text [script] to 'You are using {INT:Ship cargo carried} of the {INT:Ship cargo capacity} tonnes of cargo space.'
End Condition
Execute external plugin, 'EDDI 2.3.0' and wait for return
Set Text [script] to [Not Set]
Say, 'Commander, the {TXT:Ship model (spoken)}, [is fit for space flight' or 'has checked out' or 'is good to go]' (and wait until it completes)
Play random sound (3 items - suppress repeats)
 
Last edited:
Question my Cargo 'checker' in Voice Attack , is saying , You are not using any of the tonnes of cargo space, when I do have cargo on-board nearly full

is there a reason for this, has something changed ?

As I not sure if EDDI Cargo log is relevant to this issue, thought I would ask.

Quick Ship status
Execute external plugin, 'EDDI 2.3.0' and wait for return
Begin Decimal Compare : [bounty] Does Not Equal 0
Set Text [script] to 'You have been fined by {TXT:EDDI fine incurred faction} for the crime of {TXT:EDDI fine incurred crimetype} against {TXT:EDDI fine incurred victim}.'
Execute external plugin, 'EDDI 2.3.0' and wait for return
End Condition
Say, 'Checking [internal bays' or 'the ship holds]' (and wait until it completes)
Pause 1 second
Begin Integer Compare : [Ship cargo capacity] Equals [Ship cargo carried]
Set Text [script] to 'You are using all of the {INT:Ship cargo capacity} tonnes of cargo space.'
Else If Integer Compare : [Ship cargo carried] Equals 0
Set Text [script] to 'You are not using any of the {INT:Ship cargo capacity} tonnes of cargo space.'
Else
Set Text [script] to 'You are using {INT:Ship cargo carried} of the {INT:Ship cargo capacity} tonnes of cargo space.'
End Condition
Execute external plugin, 'EDDI 2.3.0' and wait for return
Set Text [script] to [Not Set]
Say, 'Commander, the {TXT:Ship model (spoken)}, [is fit for space flight' or 'has checked out' or 'is good to go]' (and wait until it completes)
Play random sound (3 items - suppress repeats)
Hi sutex,

Unfortunately, that particular EDDI internal variable, 'cargo carried', broke with the latest EDDI release, and now always returns zero. This affects EDDI and VA.


-=] Darkcyde [=-
 
Last edited:
Better late then never! Latest version now available in my sig below. :D

Note that the CargoLog is still a work in progress.

I'm getting an error with the Missions_Failed script: There is a problem with the script: expected expression, found }

Code:
{_ Missions_Failed }
{_ Change status of failed missions }
{_ Finds the failed mission and changes status from "no" to "yes" }


{_ Convert missionid to a string so it can be compared }
{set missionid to cast(event.missionid, "s")}

{set mission_missionid to split(state.eddi_context_mission_missionid, "+=")}

{_ Find position of missionid in text array }
{set position to find(mission_missionid, missionid)}

{if position > -1:

    {_ Change mission failure status }
    {SetState('eddi_context_mission_failed', token(state.eddi_context_mission_failed, "+=", position, "yes")}

|else:
   Mission not found in database for status change.
}
 
I'm getting an error with the Missions_Failed script: There is a problem with the script: expected expression, found }

Code:
{_ Missions_Failed }
{_ Change status of failed missions }
{_ Finds the failed mission and changes status from "no" to "yes" }


{_ Convert missionid to a string so it can be compared }
{set missionid to cast(event.missionid, "s")}

{set mission_missionid to split(state.eddi_context_mission_missionid, "+=")}

{_ Find position of missionid in text array }
{set position to find(mission_missionid, missionid)}

{if position > -1:

    {_ Change mission failure status }
    {SetState('eddi_context_mission_failed', token(state.eddi_context_mission_failed, "+=", position, "yes")}

|else:
   Mission not found in database for status change.
}

Ah yes, sorry, I hadn't tested that script. To fix, add a second ) at the end of the SetState line, just after the "yes". So it looks like this "yes"))}

Thank for catching that! :)

-=] Darkcyde [=-
 
Ah yes, sorry, I hadn't tested that script. To fix, add a second ) at the end of the SetState line, just after the "yes". So it looks like this "yes"))}

Thank for catching that! :)

-=] Darkcyde [=-

Good catch! Darkcyde i wanna thank you 1999x for that awesome script pack! Rly made my missions a lot more interesting!
One thing though im gettin this error in VA, prob something i missed but i cant figure out why EDDI is searching for these .txt files! Is this created and populated as we use the script?

gefOXXh.png


VA get me a voice alert each time i start the profile "mission loaded" "fines loaded" so i think this must be working?
Thank you again for the excellent work sir! [alien]
 
Good catch! Darkcyde i wanna thank you 1999x for that awesome script pack! Rly made my missions a lot more interesting!
One thing though im gettin this error in VA, prob something i missed but i cant figure out why EDDI is searching for these .txt files! Is this created and populated as we use the script?

https://i.imgur.com/gefOXXh.png

VA get me a voice alert each time i start the profile "mission loaded" "fines loaded" so i think this must be working?
Thank you again for the excellent work sir! [alien]

It's been a while since I started the missions system, so the files have existed for me for ages (even if they are empty). They should be created when you accept your first mission, as VA registers the 'Mission accepted' event and then updates the files, creating them if necessary. Try accepting a mission, then closing VA and reopening it.

I've looked over the scripts, and I've made a change to the VA start up (in VA, not the one I made in EDDI) where it now checks to see if the mission system has been initialised. If it hasn't, then it will run the initialisation, which then creates all the files. If it has been initialised, then it will load the saved files. Hopefully this should fix this kind of thing in future.

For those that don't use VA, and only wish to use the mission system for the current play session (so no saving), I've added an initialisation check to the start of the Missions_Add function, just to be sure it's all ready for use.

I'll see about uploading the fixed version in the next 24 hours. If anyone finds anything else before that, just let me know so I can see about fixing it before then. :)

Thanks for the feedback guys!

-=] Darkcyde [=-
 
Last edited:
Hello me again! So i'm noticing everytime i switch ships EDDI says "you are carrying"

and mostly there's nothing on my cargo... so it just warns me for nothing... This is the Cargo Inventory Script:

You are carrying
{set count to 1}
{for cargo in ship.cargo:
{cargo.amount} tonne{if cargo.amount != 1:s} of {cargo.commodity.name}

{if cargo.commodity.stolen: {set stolen to true}}
{if cargo.commodity.illegal: {set illegal to true}}

{if count = len(ship.cargo) - 1: and |else:,}
{set count to count + 1}

}

{if stolen: Warning: You are carrying stolen goods.}
{if illegal: Warning: You are carrying goods that are illegal in this jurisdiction.}

Is there a way to make EDDI don't say the state above checking prior if there's some cargo or not on the ship?
like an

|else:
{ship.cargo} = 0

... possible?
 
Hello me again! So i'm noticing everytime i switch ships EDDI says "you are carrying"

and mostly there's nothing on my cargo... so it just warns me for nothing... This is the Cargo Inventory Script:



Is there a way to make EDDI don't say the state above checking prior if there's some cargo or not on the ship?
like an

|else:
{ship.cargo} = 0

... possible?

Yeah, I quickly realised this would be a problem. And as I say, this is still a work in progress. However, I have made a few updates to the whole Cargo Log today already, and this was one of the things I've changed. It was only a temporary test anyway. Now it's used to calculate the number of Limpets you are carrying, and report if any cargo is stolen or illegal.

Unfortunately, this event doesn't trigger very often, so using it to adjust the number of Limpets in the Cargo Log isn't the best solution. There is no way to know when a Limpet is used (and so removed from your cargo) in EDDI, so this is all I have until I (or someone else) can write a better way to update the number of Limpets when they are actually used.

I hope to get the updated version out in a few hours or so.
 
Big thx! Darkcyde!

//One thing i did was simply erase the "You are carrying" sentence so theres no IVONA speak on my end! Not robust, not the best but kinda works lol...
Waiting for your update for this INCREDIBLE pack! o7
 
Big thx! Darkcyde!

//One thing i did was simply erase the "You are carrying" sentence so theres no IVONA speak on my end! Not robust, not the best but kinda works lol...
Waiting for your update for this INCREDIBLE pack! o7

That would be one way to do it! lol

And you can wait no longer, as it's now available in my sig below! :D

It would have been sooner, but home-made Toffee Apple & Cinnamon Cookies happened. :p
 
Last edited:
That would be one way to do it! lol

And you can wait no longer, as it's now available in my sig below! :D

It would have been sooner, but home-made Toffee Apple & Cinnamon Cookies happened. :p

SWEEEEEET morning gift them! just downloaded it! Big thx once more Darkcyde!
 
Random question - which of the responders is the one that tells you about the upcoming system as you're jumping? That's my favorite and while I've looked through the list I can't figure out which one it is. I turned off a ton of them and might have disabled it not knowing which one it is.

~X
 
Random question - which of the responders is the one that tells you about the upcoming system as you're jumping? That's my favorite and while I've looked through the list I can't figure out which one it is. I turned off a ton of them and might have disabled it not knowing which one it is.

~X

It's 'FSD Engaged'. :)
 
Back
Top Bottom