• 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.

Control scenery elements

Messages
187
Country
hungary
Hello,

my question is, how is it possible to interact with scenery elements through a DLL or something? What i would like to do is protecting the BGL files for "illegal" usage. As you can see in many sceneries (like by publishers FSDreamTeam, Cloud9) the scenery won't load until the correct registration informations are entered. They have a DLL file which check that. Okay, coding a DLL is one thing but how can you implement code into the BGL? It must be some code in the BGL file as well (i think) because if you remove their DLL file from FS, the scenery does not appear however it is in the right directory and worked before. How could a BGL 'make decisions' about things like appear or disappear the scenery elements? :) They did that..

regards,
Lambda
 
Hi,

It is not easy to interact with scenery from a DLL file. I guess they might be using the user variables that are available in FS to be written from outside. These can then be checked in the scenery as well. But it might also be that they found another work around.
 
Hmm interesting. But i have never heard about monitoring user variables in FSX. I remember that it can be done in FS2k4 by modifying the ASM code. Do you know the way or a direction to start how it can be achieved in FSX?
 
You would have to use the FS2004 techniques in that case. For FSX scenery it is not possible to add conditions on the display. The sceneries you are refering to might not be 100% made with the FSX SDK.
 
Could you not add code to the modeldefs.xml that checks the status of L variables and determines visibility based upon that, as animations do? You can then write to those C variables in a DLL to control them.

Si
 
Arno: yeah, maybe. I will check that.


Simon853: sounds good but a bit difficult to me, i'm not familiar with animations. But perhaps a good idea.


If anybody else have any solution or slant, don't hesitate to share :)
 
hello again,

so the variable monitoring method should be work in fs2004 i checked. My problem is that how is it possible to read and write the scenery variables with an external application or DLL? i read this topic and it seems to me that those variables work, but they can not be read or write through FSInterrogate (fsuipc), however most of them are available in FSInterrogate. For example if i give a value to the 031A variable in SCASM with SetVar, this can be checked in the same scenery with IfVarRange command. But FSInterrogate can not see the value of this variable (just zero byte) however the SetVar command already made a value. Why?
 
... they can not be read or write through FSInterrogate (fsuipc), however most of them are available in FSInterrogate. For example if i give a value to the 031A variable in SCASM with SetVar, this can be checked in the same scenery with IfVarRange command. But FSInterrogate can not see the value of this variable (just zero byte) however the SetVar command already made a value. Why?

FSUIPC has no access to those values in FSX. It was on my list of requirements of SimConnect during FSX development, but unfortunately it was one of the many on the list which never made it before the code was frozen.

FSInterrogate merely lists whatever it is told to list by the FSI data file supplied with it. The items in it apply variously to different versions of FS, from FS98 to FSX via CFS1 and CFS2. The fact that they are listed doesn't mean anything. The proper reference for FSUIPC4 offsets is the FSUIPC4 Offsets Status document, supplied in the SDK also.

Regards,

Pete
 
Could you not add code to the modeldefs.xml that checks the status of L variables and determines visibility based upon that, as animations do? You can then write to those C variables in a DLL to control them.

If you get that working for normal scenery objects (not SimObjects), you are my hero :D.
 
Back
Top