cmdrmcdonald / EliteDangerousDataProvider

Apache License 2.0
133 stars 31 forks source link

EDDI Died Event #276

Open BeBumble opened 7 years ago

BeBumble commented 7 years ago

is it possible to get the variables for the Died Event though to VA?

Working on a PvP log event so I can have a text file log of who's killed me, where and when. I got the where and when but not the who and their ranks. Looks like this event isn't complete from what I can tell with my testing in VA and EDDI standalone itself

Tkael commented 7 years ago

At current, array variables are not passed to VoiceAttack. Here are some comments from JGM on the subject: https://forums.frontier.co.uk/showthread.php/294579-EDDI-Windows-app-for-immersion-and-more?p=4684863&viewfull=1#post4684863 A workaround would be to set up a 'Died' cottle script that indexes the values into a delimited list then use the SetState function to pass that delimited list to VoiceAttack.

BeBumble commented 7 years ago

Ok this work around you speak off I have no idea on. I've only been scripting using VA and have no idea about other programming languages etc. Even this SetState function your talking about I have no clue on.

Thanks for replying though & hopefully either EDDI will get updated somehow or some kind person would be able to program/script something that I could use

Bee safe, if not bee badass ö7

Tkael commented 7 years ago

Ok. Here's a 1st pass at a cottle script to send the comma separated lists to VoiceAttack:

{if len(event.ships) > 0:

    {_ Set up empty lists _}

    {set commander to []}
    {set ship to []}
    {set rating to []}

    {_ Build a list of commanders, ships, and rankings _}

    {for cmdr in event.commanders:
        {set commander to cat(commander, [cmdr])}
    }
    {for cmdr in event.ships:
        {set ship to cat(ship, [cmdr])}   
    }
    {for cmdr in event.ratings:
        {set rating to cat(rating, [cmdr])}         
    }

    {_ Iterate through each list & create comma separated lists _}

    {set cur to 0}
    {set delimiter to: 
        {if cur > 0: 
            {return ","}
        |else:
            {return ""}
        }
    }

    {while cur < len(commander):
       {set commanders to cat(delimiter, commander[cur])}
       {set ships to cat(delimiter, ship[cur])}
       {set ratings to cat(delimiter, rating[cur])}
       {set cur to cur + 1}
    }

    {_ Send the output to VoiceAttack _}

    {SetState('died commanders', commanders)}
    {SetState('died ships', ships)}
    {SetState('died ratings', ratings)}

}

You would access the variables in VoiceAttack as described here: https://github.com/cmdrmcdonald/EliteDangerousDataProvider/wiki/VoiceAttack-Integration For example: {TXT:EDDI state died commanders} should allow you to access a list of commanders. Note that you may need to do some additional cleanup for NPCs - NPCs will show a code like '$ShipName_Military_Federation;' in place of a name.

Let me know if this works for you and close the issue if it does.

BeBumble commented 7 years ago

VERY cool and thanks, will test it out as soon as I'm able