[RESOLVED] [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Discussion related to Mission design and creation.
Locked
dexton
Posts: 12
Joined: Thu Jan 11, 2018 7:42 pm

[RESOLVED] [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by dexton »

P3D Team,

I am trying to use several SetGaugeVariableAction actions in my scenario XML file.

For example, say I want to set the gauge var L:SomeVariable to True:

<SimMission.SetGaugeVariableAction InstanceId="{49812E42-3A16-408C-82C4-40248B83485F}">
<Descr>SetSomeVariableToTrueAction</Descr>
<GaugeVariableName>SomeVariable</GaugeVariableName>
<GaugeVariableValue>1.000000</GaugeVariableValue>
<GaugeVariableUnits>boolean</GaugeVariableUnits>
</SimMission.SetGaugeVariableAction>

This is the desired XML code that works as intended. However, in the SimDirector GUI, you can't really set a "cutom" gauge var. You are given a drop down list with a search box. Eg. I cannot enter "SomeVariable"

Image

Normally this wouldn't be an issue because I can simply edit the XML file manually to set the variable. No big deal. However, whenever I edit the XML manually, then save the project in SimDirector, it resets the GaugeVariableName property in the XML to the first item in the list in the GUI.

Image

For instance, here it would always reset it to map_ZoomStep when saving the project. So whenever I edit my projects in SimDirector, I must manually go back and edit the SetGaugeVariableAction actions and set the GaugeVariableName property again.

Hopefully this is an easy fix.
Thanks, dexton.
David Love-Brice
Posts: 25
Joined: Tue Apr 11, 2017 5:11 am
Location: Sale, VIC, AU
Contact:

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by David Love-Brice »

Hi Dexton,

Speaking from using SetGaugeVariable actions on a regular basis, they're really good for custom userownship variables such as Lvars and some C++ variables.

If for some reason SimDirector can't find the variable in the userownship avionics, it would likely cause SimDirector to reference the topmost variable it can find.

Have you tried using a script action instead and adding in code there, such as 1 (>L:Somevariable,bool)

Please correct me if I've got the wrong end of the stick though! lol
David Love-Brice
Prepar3D Courseware Lead, AIR 5428
Lockheed Martin Australia
dexton
Posts: 12
Joined: Thu Jan 11, 2018 7:42 pm

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by dexton »

David,

Thanks for your fast reply. I didn't actually think of using a script action to load the vars first. That's a great idea. I will try that and post my results. I am running with a bit of an interesting situation where I need to declare the variables in the mission itself.

Thanks again,
Dexton
dexton
Posts: 12
Joined: Thu Jan 11, 2018 7:42 pm

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by dexton »

Seems like this won't actually solve my issue because unreferenced actions aren't called when you are in the Sim Editor mode. This means any ScriptAction I have unreferenced won't actually get called to set the vars until I enter Preview Scenario mode or normal P3D itself.
David Love-Brice
Posts: 25
Joined: Tue Apr 11, 2017 5:11 am
Location: Sale, VIC, AU
Contact:

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by David Love-Brice »

No problem,

Generally, SetGaugeVariable only loads variables specific to the user aircraft. SetPropertyVariable uses P3D variables as listed in the SDK and ScriptActions allow XML and LUA code to be used.

I use script triggers and actions for variables that aren't picked up by SimDirector but I know exist in the aircraft, sometimes it's hit and miss. ;) Worth a go though.

Though, based on your last reply, are you trying to create variables that don't exist as part of the aircraft software? Something specific to your SimDirector exercise?
David Love-Brice
Prepar3D Courseware Lead, AIR 5428
Lockheed Martin Australia
David Love-Brice
Posts: 25
Joined: Tue Apr 11, 2017 5:11 am
Location: Sale, VIC, AU
Contact:

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by David Love-Brice »

Dexton,

I've drafted up a quick sample to try. Try the SimDirector exercise on the link below;

https://www.dropbox.com/s/dglzbh8ribewu ... 1.zip?dl=0

This is a simple chain which uses a scriptaction to set three Lvars (TEST1,2 and 3). It then initialises a script trigger to see if the variables match the ones set by the scriptaction, and if they match, it displays a message onscreen. I've added dialogue in as well to help track the process when played back.

The downside to this is that you can't use a PropertyTrigger action to look for the Lvars that aren't set until the simulation starts, (as you stated) but if you keep a track of your Lvars and the conditions you want them to be, you can manage them fairly easily using Script actions and script triggers.

And as a plus point, to my knowledge, script triggers don't get overwritten on re-load. :)
David Love-Brice
Prepar3D Courseware Lead, AIR 5428
Lockheed Martin Australia
dexton
Posts: 12
Joined: Thu Jan 11, 2018 7:42 pm

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by dexton »

David,

You're the man! I think the best work around would be like you said to just use ScriptAction/ScriptTrigger instead of SetGaugeVariableAction/PropertyTrigger, etc. Seems to work great and doesn't override when saving.
David Love-Brice
Posts: 25
Joined: Tue Apr 11, 2017 5:11 am
Location: Sale, VIC, AU
Contact:

Re: [Bug] v4.4 SetGaugeVariableAction gets overridden on saving

Post by David Love-Brice »

Fantastic stuff. :) Thanks for the puzzle, it's shed light on a new process that I hadn't considered either. ;)
David Love-Brice
Prepar3D Courseware Lead, AIR 5428
Lockheed Martin Australia
Locked