P3D v4 visibility conditions for scenery objects

Christian Bahr

Resource contributor
1. Is it possible to trigger a jetway animation on a scenery object in P3D4 without the use of SODE (that relies on making it a SimObject);
Short answer: Yes, it is possible :)

What you mean is the start of an animation depending on the distance of the user to the object. But how exactly does that work is still to find out. But the "Object Variables" of the P3D clearly state this:

WorldBase.Latitude: The latitude of the object. Units = Radians
WorldBase.Longitude: The longitude of the object. Units = Radians
 
Sleepless in Balkbrug (not in Seattle :))!

No, Christian, what I mean is either the use of the Ctrl+J (preferrably), the frequency setting or if nothing else works, the boundary box (like possible in FSX with FSDS and what you translate into 'the distance of the user to the object').
As for the WorldBase.Latitude, Longitude and Altitude, if that was coded as a min/max radian for the jetway, then how would this jetway know whether a simobject would be inside of its radial?
The other way around would not either transmit the location of the SimObject to the jetway scenery object (if I would even know how to).
I am afraid your possibility of doing it is also based on SODE?
Converting location coords in radians is not a big problem but what good does it serve?
In short , I am still baffled.
 
Hello all
so i have to make my own visibility conditions for a simobject and not scenery object
and for that, I need my condition to use my own custom var
so i created a DLL that creates a simobject that holds variables (a dummy)
i made my XML code and attached to vis conditions to an other simobject not controlled by the DLL

it seems like the new simobject can't access the Vars i made
any thoughts?

here are my XML codes that i used to test:


XML:
  <PartInfo>
    <Name>DLL true</Name>
     <Visibility>
         <Parameter>
            <Code>(A:MyVar, degrees) 2 == if{ 1 } els{ 0 }</Code>
        </Parameter>
    </Visibility>
  </PartInfo>
 
    <PartInfo>
    <Name>DLL false</Name>
     <Visibility>
         <Parameter>
            <Code>(A:MyVar, degrees) 1 == if{ 1 } els{ 0 }</Code>
        </Parameter>
    </Visibility>
  </PartInfo>
and here is the C++ code i made


C++:
                if (FAILED(MyDummy->TriggerProperty(TEXT("MyVar"), TEXT("degrees"), (double)2, 0)))
                {
                    OutputDebugString(TEXT("Failed to Trigger Property SetMyTestVariable.\n"));
                }
                double vis = 0;
                // Get values using properties
                if (FAILED(MyDummy->GetProperty(TEXT("MyVar"), TEXT("degrees"), vis)))
                {
                    OutputDebugString(TEXT("Failed to Get Property MyTestVariable.\n"));
                }
from the Visual studio debugger, it says that the vis var is equal to 2
but in sim nothing happens


PS. the simobject MDL is two boxes color-coded, one has first condition and the sec has the second

thnx in advance :)
 

Christian Bahr

Resource contributor
I'm not sure if that's up to it. But all PartInfo names I know have an underscore, like this:

<PartInfo>
<Name>DLL_true</Name>
<Visibility>
<Parameter>
<Code>(A:MyVar, degrees) 2 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</PartInfo>

<PartInfo>
<Name>DLL_false</Name>
<Visibility>
<Parameter>
<Code>(A:MyVar, degrees) 1 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</PartInfo>
 

Christian Bahr

Resource contributor
Sleepless in Balkbrug (not in Seattle :))!

No, Christian, what I mean is either the use of the Ctrl+J (preferrably), the frequency setting or if nothing else works, the boundary box (like possible in FSX with FSDS and what you translate into 'the distance of the user to the object').
As for the WorldBase.Latitude, Longitude and Altitude, if that was coded as a min/max radian for the jetway, then how would this jetway know whether a simobject would be inside of its radial?
The other way around would not either transmit the location of the SimObject to the jetway scenery object (if I would even know how to).
I am afraid your possibility of doing it is also based on SODE?
Converting location coords in radians is not a big problem but what good does it serve?
In short , I am still baffled.
Hi Roby!

When it comes to asking about animated and distance-dependent jetways, I'm not much help because I'm not familiar with animated jetways :(

If you ask for animations that are distance-dependent, I do not use SODE. For this purpose, a friendly developer has programmed an Animation-Controller (P3Dv4_Windpark.exe), the Contoller was exclusively included in all P3Dv4 Bahrometrix sceneries. For example, he controls a Follow-Me Vehicle that drives at the EDLE Essen/Muelheim airport and reacts dynamically to the user plane - it stops when you get in the way of the vehicle :)

The question of the coordinates in radians is the big question of price. Maybe someone can read out and learn about the simconnect DLLs, which allows for a distance-dependent control of objects. It would be conceivable, for example, that a hangar gate opens automatically as soon as you get into a previously defined distance. It would be perfect if such a function can put into its BGL files, similar to how it works with the Visibility Code.
 
Top