EDDI
EDDI copied to clipboard
Way to save variables across sessions
What happens now
You can create State variables that can be used in different scripts, but they are lost when EDDI closes.
What I'd like to happen
I would love a way to store a variable that will be retrieved even if EDDI was closed.
How it can happen
It can be implemented the same way missions and crime & punishment are stored across sessions. It can even have an user interface to see/edit/delete the actual stored variables. This will be perfect for personalities with own settings: Things like 'report temperature' can be stored in that list and edit it there instead inside the scripts.
This is already possible with VoiceAttack to some extent (if you use VoiceAttack). Some users also store configuration preferences in a script and invoke that script when they want to initialize their default configuration settings. Would either of these options suit your current use case?
Yes, that is the way I use now. Just mentioned it as an added feature for the persistent variables.
My goal is to store an aprox. amount of exploration data credits through sessions (along other ideas). I don't use VA, but if it lets you save some variables and load them in your next gaming session, I will gladly use it.
Where I can find an example or documentation about this? Never coded for VA, but I guess I can handle it with some help. Thanks in advance.
At the top right of the VoiceAttack home page, there are links to 'Support' and 'How-To'. These should be able to help you to start with. The Support has links to the VA forum, where people will be able to help with any questions.
There are also some Frontier forum threads for both EDDI and EDDI/VA commands, with people who can help with more Elite/EDDI specific things too.
The thing to remember with VA, is that it is 'reactive'. It can automate almost anything, but it has to have a trigger to do so. It could be a voice command, or a control (keypress, mouse button, etc), or in the case of EDDI, it can trigger from EDDI events and scripts. In your case, it would probably be something like writing the data to a file when the 'Shutdown' event is triggered, and reading it back in when you start your game (just as an example). That's exactly how I used to save/load data for EDDI before certain things were integrated into it. :)
You can use the SetState()
function to save a variable and make it available for both other scripts and VA. If you retrieve that variable in a VA command, VA allows you to persist that saved value between sessions.
You can then use the setstate
VA plugin context to write that variable back to EDDI in a later session.
It's possible to try this process out using the trial version of VA - you are limited on the number of commands that you can create but the plugins are fully functional.
Thank you both for the directions. I will take a look at it, feels like is exactly what I want.