EDDI icon indicating copy to clipboard operation
EDDI copied to clipboard

Way to save variables across sessions

Open Transcan opened this issue 2 years ago • 5 comments

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.

Transcan avatar May 31 '22 13:05 Transcan

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?

Tkael avatar Jun 02 '22 03:06 Tkael

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.

Transcan avatar Jun 03 '22 23:06 Transcan

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. :)

Darkcyde13 avatar Jun 04 '22 12:06 Darkcyde13

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.

Tkael avatar Jun 05 '22 10:06 Tkael

Thank you both for the directions. I will take a look at it, feels like is exactly what I want.

Transcan avatar Jun 05 '22 10:06 Transcan