Hi Bazslaz,
you are welcome
. For the latest profile of Darcyde, you can find a link in his signature at the end of his posts.
you are welcome
{_ Context}
{SetState(event.station)}
{set station to token(StationDetails(event.station).model," ",1)}
{Pause(330)}
{F("Honorific")}. the
{event.station} {OneOf("Hails us","welcomes us","greed us","Receives us","Sees us")}.
,
Cmdrs i managed to get my ship return the station name but i want it to say its type (idf its possible!) how can i accomplish this?
Essentially untested, but this should work:
The if statement ensures that it'll only speak if EDDI has acquired the relevant object details.{_ Context}{set station to StationDetails(event.station)}
{if station:
{Pause(330)}
{F("Honorific")}, the
{station.model} {OneOf("Hails us","welcomes us","greed us","Receives us","Sees us")}.
}
Fair warning - you should add a larger pause or EDDI will probably start talking over the station traffic controller.
I miss the ship cargo info that was available in earlier versions of ED. I'd like to create a script that can read out what cargo I'm currently carrying. The item and amount is reported in the cargo purchased event. I'm thinking that an array can be created to store this info and then report it. Unfortunately creating an array is way over my head. Does anyone have any ideas and examples of how to report on ship cargo carried?
This shouldn't be too difficult, just adding and deleting from an array, much like the Missions system was at the beginning. I'll see what I can come up with, unless someone beats me to it!(Hoodathunk? lol
)
EDIT: Turns out this isn't quite as straight-forward as I thought. :/ This may take a little longer than I expected.
Lol, on vacation visiting grand daughter ( and son too, I suppose).
Will take a look at this too when I get back.
FWIW, If Darkcyde says it's looking like a challenge, take him at his word!
Yeah, it was all going well last night, until I got to the part of ejecting cargo. There is no info on exactly which cargo is being ejected. Let me explain....
Imagine you have 2 tonnes of gold, and you pickup another 3 tonnes illegally (stolen). This is easy to store in the array. I had planned to make them two entries, one with the stolen flag. However, what happens if you try to eject 2 tonnes? There is no information in the 'Commodity ejected' event to say which two tonnes of the five you are carrying, gets ejected. Is it two of the stolen ones? Two of the legal ones? One of each?
I had big (above average sized?) plans for this feature, but the lack of available info in the ejection event kind of cripples the idea. Right now, I think the best we can do is a simple log of what we are carrying, and not differentiate between stolen and legal.
I think the hardest part to do will be mission cargo, and what happens when you abandon a mission and steal the cargo. Trying to make that an independent part (so you don't need the Mission System) will be the big challenge. It may be that the Mission System is required for the Cargo system to work fully.
I'll see if I can get this done in the next couple of days. At least a v1.0 anyway.![]()
Would it be possible to just track the item and count of cargo, and ignore the stolen status?
For example, then you purchase and sell cargo, the type and amount is reported by the event. When you accept at turn in a cargo mission the item and amount is reported by the event. When you pick up cargo in space the type and amount is recorded.
At it's core it seems like it would be adding a subtracting to an array. Which for all I can tell is magic LOL.
The older versions of ED and EDDI were able to report just the capacity of cargo you were carrying. I'd be happy if that feature was available. I like to run a preflight check before launching and hear how much and if possible the cargo I'm carrying.
{_ 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}
{_ 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}
{_ 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}
{_ 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}
}
}
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!
-=] 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.
Yeah, it was all going well last night, until I got to the part of ejecting cargo. There is no info on exactly which cargo is being ejected. Let me explain....
Imagine you have 2 tonnes of gold, and you pickup another 3 tonnes illegally (stolen). This is easy to store in the array. I had planned to make them two entries, one with the stolen flag. However, what happens if you try to eject 2 tonnes? There is no information in the 'Commodity ejected' event to say which two tonnes of the five you are carrying, gets ejected. Is it two of the stolen ones? Two of the legal ones? One of each?
I had big (above average sized?) plans for this feature, but the lack of available info in the ejection event kind of cripples the idea. Right now, I think the best we can do is a simple log of what we are carrying, and not differentiate between stolen and legal.
I think the hardest part to do will be mission cargo, and what happens when you abandon a mission and steal the cargo. Trying to make that an independent part (so you don't need the Mission System) will be the big challenge. It may be that the Mission System is required for the Cargo system to work fully.
I'll see if I can get this done in the next couple of days. At least a v1.0 anyway.![]()
Hi All you great people who do stuff like this for us plebs out there.
I love using EDDI. It adds just enough without being too much if you get me.
One thing I have noticed though is that it's started to to the txt to speech thing for all messages and not just for ones send directly to me.
Before it would only speak out the message directed to me or from my wing but now it's blabbering all the local messages about guys getting scanned and how good are those bloody cruise liners!!
Is there a way to stop this and make it ignore the local chatter. I don't want to turn local off as I like the 'background' chatter of it.
Cheers in advance.
{_ Context }
{SetState('eddi_context_last_subject', 'message')}
{SetState('eddi_context_last_action', 'receive')}
{SetState('eddi_context_message_name', event.from)}
{SetState('eddi_context_message_content', event.message)}
{if event.player = true:
{if event.message = "o7":
{event.from} salutes
{if event.channel = "player":
you
}.
|elif state.verbose:
Message received from {event.source} {event.from}. Message reads: {event.message}.
}
}
DarkCycle,
Two questions for you, I notice in your default profile you have a folder for Scripts and one for Functions. Do both get entered into EDDI Speech Responder?
Also I get the message There is a problem with the script expected end of file found. when i paste the Body Report into in Speech Responder
I echo Madraxx573 in thanking all of you that devote your time to helping all of us non tech folks with your work.
Does anyone have a script that would notify them of another player starts attacking them? Sometimes I am in an open zone and I am so focused on finding a mission object I do not notice i am being attacked until they have knocked my shields down 10 to 20 percent.
Unfortunately, there is no event for coming under attack by a player, only for NPC attacks. There is also nothing to register hits to your shields (that I can find), only an event for taking hull damage, and by then you'd have already noticed. I had a quick look over any VA variables, but there doesn't seem to be anything there either. Of course, I may have missed something, so if anyone else knows of a way to achieve this functionality, I'd be glad to hear it.