EDCD / EDDI

Companion application for Elite Dangerous
Other
440 stars 81 forks source link

State variables set to void at end (or start?) of scripts #2554

Closed Darkcyde13 closed 1 year ago

Darkcyde13 commented 1 year ago

What's Wrong (please be as specific as possible)

Expected

State variables to persist between scripts.

Observed

State variables are set to void when next required for use.

Steps to reproduce

  1. Create a script that sets a State variable. For example 'eddi_context_body_name'.
  2. Run the script to set the State variable.
  3. Run a script the makes use of this variable. For example 'Body report'
  4. Observe that the State variable is no longer populated, and is set as void.

Configuration

My Investigation

Investigation Notes

As reported on the forum here by user Ultra Fluffy, it seems that State variables are being set to void either at the start or end of a script (I'm not sure which).

I have added the following lines at the very start and ends of these scripts (in a fresh copy of the default personality): Glide - G: {state.eddi_context_body_name}, {state.eddi_context_system_name}. Entered normal space - ENS: {state.eddi_context_body_name}, {state.eddi_context_system_name}. Touchdown - TD: {state.eddi_context_body_name}, {state.eddi_context_system_name}.

These have resulted in the following output:

Silcarius has entered supercruise. ENS:,. left supercruise near Planet Iah Bulu A 2. ENS: Iah Bulu A 2, Iah Bulu. G:,. Glide mode engaged. Planet A 2 is a low gravity world, at 0.31 G. G: Iah Bulu A 2, Iah Bulu. G:,. Glide completed. G: Iah Bulu A 2, Iah Bulu. TD:,. Touchdown on Planet A 2. TD: Iah Bulu A 2, Iah Bulu.

As you can see, at the start of each script, the state variables are blank (after some simple testing, I found they are void), but at the end they are populated correctly. Them being populated at the end is correct, as they are set in 'Entered normal space' and 'Glide' scripts. However, the 'Touchdown' script does not set them, yet they are still void at the start, and populated at the end, so that has me very confused as to what is happening here.

The EDDI log doesn't show anything out of the ordinary, so I don't know whats causing it. This has been tested with EDDI standalone and as a VA plugin, both exhibit the same behaviour.

EDDI Logs

eddi.log

Player journals

N/A

Darkcyde13 commented 1 year ago

I'm wondering if this is limited to certain state variables, or certain events? The reason being, that I'm using state variables in my updated Bond awarded script, and they are working fine between executions of this script.

Tkael commented 1 year ago

The values are being saved properly to the underlying dictionary but there seems to be a problem with the way that we're re-passing the information back through the script resolver that is is preventing Cottle's rendering engine from being able to access the values. 🤔