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

MSFS - crop dusting - visual effects on the ground

Messages
15
Country
france
hello all, I want to try to recreate the FS5.1 crop dusting missions where you would fly over terrain and the tiles would change color once you hit them with the spray..
So the aircraft bit and the spray are not the problem, that can be easily done with VFX.
I'm more looking for a solution to have the ground react to the spray.. to keep things simple the field could be a dedicated field where I could setup tiles, or scenery objects (plants, crops maybe) that would change color/apperance as the spray hits them.. now it might not be "the spray" but maybe reacting to the plane flying over could be the start of a solution..
Has anyone any clue about how I could change an object/polygon properties by flying over it ? could that be done by a property of the object or maybe a VFX that would be triggered by the fly over ?

any help appreciated, thanks
 
You may want to consider a worldscript, how to is described here


The animation is gonna consist of hiding the dry plant under the ground and popping the moving wet plant over the ground

Obviously you should add a series of rectangles over your field (doing that per plant is gonna be overkill)
 
Thanks, yep I read that hangar animation post, but initially he wanted it to be based on aircraft distance which would have been great for me to detect flyover, but then it ended up the animation being triggered by a cockpit control, being lights or yoke visibility.. nonetheless interesting
 
The 3d linked above, near the end, contains a sample by me using a proximity trigger 😄😅
 
correct, for you convenience here it is again

The trigger is a defined rectagle, in this case in front of the hangar, an trigger a simboject animation (in this case the hangar doors)
 

Attachments

awesome thanks.. looking at it.. started looking into missions also, trying to run through the "SimpleMission" tutorial, so far managed to crash the sim 3 times just doing what the tutorial says.. it's so convoluted uhh.. but I'm like a dog with a bone in its mouth, I don't let go easy
 
thanks manu, I was able to basicaly create a cube in blender that rises when I fly over it (that was a steep learning curve, very discouraging) now I'm trying to get 2 cubes to rise, eventualy I'll make a script that produces an XML with an array of say 10x5 cubes.
I tried duplicating the following :
- simcontain - to creat a new instance of the simobject
- simmission.rectanglearea - new offset rectangle area
- proximitytrigger - new trigger based on new area
- playblendtreestateaction - action for new simobject

I changed all the GUIDs and also ContainerId, I put x=10 in LocalOffsetXYZ but I can only see the first cube, can't see the second one, any ideas ?
 
noticed I have to completely exit the sim and restart to see any effect of the changes I make to the worldscript.. (working in Notepad++) save project/reopen/clean/rebuild/reopen/reload new flight, nothing seems to refresh changes I make to the XML unless I exit/restart the sim, then I see the changes.. what am I doing wrong ?
 
You are doing nothing wrong, you really need to exit the Sim to desktop and reload 😪
 
so finally after a ton of struggling I got something working.. see video
obviously it's not finished yet, still need to add VFX to the aircraft

it's basically a cube that sits under ground and rises as the plane flies over (but within a box that's not very high of course :) )
I played with the alpha channel, I guess this is very CPU/GPU friendly, versions with more realistic vegetation would be nice but I want a visual cue of the areas that are "validated"
possibly a next evolution would be to transform this into a mission with a time limit.. and lots more cubes.. but as of now adding the cubes is quite time consuming, each has 4 GUIDs, I have a script that copies/paste them and replaces the GUIDs but it's still fidelly..
anyway, back to work
 
You are doing nothing wrong, you really need to exit the Sim to desktop and reload 😪
Yep. Asobo doesn't seem to notice the persistance of memory.
memory.png
 
Now, my current worldscript has a 10x5 array of (container/rectangle/trigger/animation - 4 GUIDs) expanding the array is time consuming to replace each GUID, making the script quite big too .. there has to be a better way..
ideally the script for rectangle/trigger/animation should be part of the simobject so I can just make a scenery and drop my objects like M&Ms on the floor and not have to worry about GUIDs..
any ideas ?
 
ok.. I added a visibility behavior linked to the stall warning, just to see if the process works, it works but it's not refreshed i.e. :
- If I set visibility = stall warning, I start the flight, the aircraft is not stalled, stall warning = false so visibility = false => object not visible
- if I set visibility = NOT(stall warning), I start the flight, the aircraft is not stalled, NOT(stall warning) = true so visibility = true => object visible

but once in flight if I get the stall warning it doesn't change the object visibility.. I checked with the behavior tool, I can see the value change there..
 
Can a simobject access its own global lat/long position ? so I could code in the model XML the required comparison with the aircraft lat/long..
 
ok I used Simvar Watcher to investigate more, so my cubes simobjects can indeed access their own lat/long position with the "PLANE LATITUDE/LONGITUDE" simvars, however I haven't found a way to access the airplane's lat/long from my cube object to compute the distance..
Is it possible within the XML to read simvars from a different simobject ?
otherwise one way to do it would be to create a L:VAR, that the airplane will write its position to, then my cube simobject could read that..
another way would be to have an external module do the job, but I think it's cleaner to keep it all in the sim..
 
ok I've added the following to the aircraft model XML :

XML:
        <Component ID="Update">

            <UseTemplate Name="ASOBO_GT_Update">
            <FREQUENCY>100</FREQUENCY>
            <UPDATE_CODE>
                (A:pLANE LATITUDE, RADIANS) (>L:pB4CROP_PLANE LATITUDE, number)
                (A:pLANE LONGITUDE, RADIANS) (>L:pB4CROP_PLANE LONGITUDE, number)
                (E:SIMULATION TIME, SECONDS) (>L:pB4CROP_DEBUG, number)
            </UPDATE_CODE>
            </UseTemplate>
        </Component>



I can see the new local simvars, but only 3 digits after the decimal, whatever data type of the LVAR I tried (SDK says number), 3 digits doesn't give me enough precision to detect proximity..
I searched and found LVARS are supposed to be doubles data types, so technically up to 15 or so decimals..
where am I loosing precision ?
or is it just the "behaviors" debug window only displaying 3 digits..
 
Last edited by a moderator:
success.. simobject managing its own visibility based on relative distance to plane :
Code:
<Visibility>
                <Parameter>
                    <!--
                    A = airplane pos (PB4CROP_PLANE LONGITUDE/LATITUDE local vars set by the plane's model.xml)
                    B = cube pos
                    r = 6371km =6371000m
                    d = r.arcos (sin LATa.sin LATb + cos LATa.cos LATb.cos(LONa-LONb))
                    d = r.arcos (sin LATplane.sin LATcube + cos LATplane.cos LATcube.cos(LONplane-LONcube))
                    then if d < 10m return true else false
                    -->
                    <Code>
                    (L:pB4CROP_PLANE LONGITUDE, NUMBER) (A:pLANE LONGITUDE, RADIANS) - cos (A:pLANE LATITUDE, RADIANS) cos * (L:pB4CROP_PLANE LATITUDE, NUMBER) cos * (A:pLANE LATITUDE, RADIANS) sin (L:pB4CROP_PLANE LATITUDE, NUMBER) sin * + acos 6371000 * 10 &lt; if{1} els{0}
                    </Code>
                </Parameter>
            </Visibility>
now just need to add altitude criteria
 
Back
Top