• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 visibility conditions for scenery objects

Christian Bahr

Resource contributor
Messages
951
Country
germany
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
 
Messages
5,214
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.
 
Messages
576
Country
france
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
Messages
951
Country
germany
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
Messages
951
Country
germany
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.
 
Messages
57
Country
ukraine
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

  • Wind.JPG
    Wind.JPG
    40 KB · Views: 376
Last edited by a moderator:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
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,
 
Messages
57
Country
ukraine
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
Messages
32,858
Country
netherlands
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.
 
Messages
57
Country
ukraine
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.
 
Messages
57
Country
ukraine
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
Messages
32,858
Country
netherlands
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.
 
Messages
57
Country
ukraine
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.
 
Messages
1,132
Country
us-texas
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.
 
Messages
54
Country
spain
Hi, I can't understand the file structure to objects with visibility conditions.
My scenery is as addon with their xml file in E:\Users\ARV187\Documents\Prepar3D v4 Add-ons\LEAR_ARV187\add-on.xml

XML:
<?xml version="1.0" encoding="utf-8"?>
<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
  <AddOn.Name>LEAR Argavirtual</AddOn.Name>
  <AddOn.Description>LEAR aerodromo de Argavirtual by ARV187</AddOn.Description>
  <AddOn.Component>
    <Category>Scenery</Category>
    <Path>scenery</Path>
    <Name>LEAR scenery</Name>
    <Layer>161</Layer>
  </AddOn.Component>
  <AddOn.Component>
    <Category>Texture</Category>
    <Path>texture</Path>
  </AddOn.Component>
</SimBase.Document>

I exported the mdl and bgl file with modeldef.xml:
XML:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo>
  <PartInfo>
    <Name>rain</Name>
    <Visibility>
      <Parameter>
        <Code>
          (O:Weather.AmbientPrecipState, mask) 4.0 == if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>
</ModelInfo>

So I have modeldef.xml, charco.mdl & charco.bgl in E:\Users\ARV187\Documents\Prepar3D v4 Add-ons\LEAR_ARV187\scenery\

With ADE I inserted the bgl file in scenery.

How is the folder structure to this is working?

Thanks!!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,858
Country
netherlands
Hi,

The sim only needs the bgl file. The mdl is I side the bgl and the relevant modeldef definitions are stored in the mdl file.
 
Top