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.
 
Hi,
Давайте я покажу пример. Я загрузил простой объект windsock:

Теперь в редакторе иерархии я выбираю верхний узел. И в правой панели я щелкаю правой кнопкой мыши на преобразовании и выбираю добавить анимацию:
Затем щелкните правой кнопкой мыши на анимацию, которая была добавлена, и нажмите кнопку «Изменить анимацию». В форме, которая появляется В этой форме вы можете добавить 5 необходимых ключей. Каждый с поворотом вокруг оси Z на 0, 90, 180, 270 и 0 градусов.

В редакторе иерархии не забудьте установить тип анимации (я не добавил анимацию ветра в свою модель, но это должно быть легко сделать).

Now export to MDL and you should be fine. The entire object will rotate around its axis. If you tag it with the wind animation it will move with the wind.
Could you tell me which type of animation to choose for the wind?
Unfortunately, I did not find it in the type of animation.
Searched in the section that highlighted in yellow.
 

Attachments

Last edited by a moderator:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Like I wrote in that post above, the wind animation is a custom animation that you need to add to your modeldef.xml yourself. So it is not an animation that is available by default.

I don't have an example of the animation definition right away, but you can probably find it somewhere on the forum,
 
Hi
As I understand it, the changes are added to the modeldef file located along the path: \ Lockheed Martin \ Prepar3D v4 SDK 4.5.12.30293 \ Modeling \ 3ds Max \ bin
Objects are added: <Animation name> and <PartInfo>. As an example, I took them from a post in No. 98 "rhumbaflappy".
But when I select the type of animation that I added in the hierarchy, I don’t see it.
Maybe I added it wrong?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Is MCX pointed to that same modeldef.xml file?

And be aware that animations need a second line at the top of the modeldef.xml file, not only the part definition.
 
I haven’t selected that file. In the settings I have another SDK 4.3 registered Now appeared in the type of animation. I export to the simulator and check the windsock. Thanks Anro! I would also like to consult on the creation of ALS. What topic should I ask questions about? There are a lot of them and I got lost in them.
 
Many thanks to Arno and everyone who described the possibility of creating windscok animations depending on the wind in such detail. Everything worked out. And 360 degree rotation and change of position depending on weather conditions

 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
I haven’t selected that file. In the settings I have another SDK 4.3 registered Now appeared in the type of animation. I export to the simulator and check the windsock. Thanks Anro! I would also like to consult on the creation of ALS. What topic should I ask questions about? There are a lot of them and I got lost in them.
Good to see you got it working.

If you have a ALS question, just start a new thread for it.
 
I think that over the weekend I will create a new topic on ALS. In it, I will briefly write how I do what I do not like in my results and ask for options on how to do it right and better.
Thanks Arno.
 
Hi all,

OK, we now know how to animate windsocks, make seasonal textures (also for groundpoly), and more stuff depending on E an O variables. Nice.
But I am stuck on the jetways!
When I attribute the "jetwayhoodextend" animation to the,for the time being, simple jetway (only the last part moves forward) it does move in MCX but does NOT in P3D4.
When I add the "retract" part as well, it does not even move anymore in MCX either.
I changed the animation GUID to the GUID my jetway has (like Tom suggested) but that is also a 'no go'.
Then Arno said (contradictory to Tom) that I do not need a trigger when 'you make them with the proper jet way animations you can just use the Ctrl-J jet way command to let them dock to your aircraft. You need to use the specific animations FS has for that, so no need to change guids'. But did not specify what these specific animations are.
The custom jetway is a scenery object and I can only (AFAIK) add a 'part info' if needed but then I am stuck on the code to use.
Can somebody tell me if it is possible at all for a scenery object without having to rely on SODE to do the job for me? And if so, what would be the modeldef entry to make it work in P3D4?
I attach the model (the animation does not stick, it reverts to unknown when I change the GUID to the model GUID).
Thanks,

Roby
Remember that for hood extension/retraction......the clock midpoint is the maximum extended position...then as clock progresses it returns to its retracted position. That's a CTL-J requirement.
 
Top