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

Animation on camera distance (SimObject and WorldScript)

Messages
36
Hi guys!

Hope you are all doing well.

I have this worldscript to open and close the barrier so when the aircraft gets near that barrier it is opening and as soon as it leaves it is closing.
What I want to do is to implement a function IF thats actually possible so when I approach the barrier with drone / developer camera it will open and as soon as I leave certain area it will close.

Also, what I was testing is when the animation kicks for opening and I leave that area immediately with the aircraft the animation goes very fast to the end frame of the opening animation and it starts the animation for closing the barrier in normal speed instead of just start lowering the barrier from the state I left the area, I think you get my point so let say the barrier is opened around 40% and I leave that area I want the barrier to go down from 40% to 0% not from 40% to 100% very fast and then from 100% to 0% in normal speed.

<?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document Type="MissionFile" version="1,0" id="Worker">
<Title>barrier-shs-script</Title> <!-- any title here -->
<Filename>barrier-shs-script.spb</Filename> <!-- the name of this xml file, but with spb-->
<WorldBase.Flight>
<SimContain.Container InstanceId="{e88f05bb-00e5-49cc-860a-40882c5b0f60}"> <!-- any guid here: GUID1 this is the reference to the simobject-->
<ContainerID>2146778315</ContainerID> <!-- any number-->
<WorldBase.IsOnGround>true</WorldBase.IsOnGround><!-- wheter the simobject is placed on the ground or not-->
<WorldBase.SimplifiedSimMode>AI</WorldBase.SimplifiedSimMode><!-- dunno-->
<WorldBase.ContainerTitle>SHS_Clutter_Barriers_003</WorldBase.ContainerTitle><!-- the name of the simobject -->
<WorldBase.LocalOffsetXYZ>0.000,0.000,0.000,0.000</WorldBase.LocalOffsetXYZ> <!-- distance of the simobject from the placed script in meters, Y is the vertical axis-->
<SimBase.Descr>Barrier003</SimBase.Descr> <!-- any description -->
<WorldBase.Orientation>0.000,0.000,0.000</WorldBase.Orientation> <!-- orientation of the simobject -->
</SimContain.Container>
<SimMission.RectangleArea InstanceId="{be31bcce-b14b-4d90-8daf-673a7b7b455a}"> <!-- any guid here: GUID2 this is the reference to the trigger, a rectangle area-->
<Length>30.000</Length> <!-- rectangle trigger dimensions -->
<Width>45.000</Width><!-- rectangle trigger dimensions -->
<Height>15.000</Height><!-- rectangle trigger dimensions -->
<WorldBase.Orientation>0.000,0.000,0.000</WorldBase.Orientation><!-- rectangle orientation-->
<WorldBase.InitRelativeToWorldObject>
<IsOnGround>true</IsOnGround>
<OffsetXYZ>0.000,0.000,0.000,0.000</OffsetXYZ>
<Orientation>0.000,0.000,0.000</Orientation>
<NodeName>Barrier_v3_1</NodeName> <!-- any node name -->
<ObjectReference InstanceId="{e88f05bb-00e5-49cc-860a-40882c5b0f60}" id="Container" /><!-- GUID1-->
</WorldBase.InitRelativeToWorldObject>
</SimMission.RectangleArea>
<SimMission.ProximityTrigger InstanceId="{1987d00a-164e-436c-9632-db09789e9413}"><!-- any guid here-->
<OneShot>false</OneShot><!-- if true, actions triggered only once-->
<ObjectFilter>User</ObjectFilter><!-- can specify other simbojects?-->
<Areas>
<WorldBase.ObjectReference InstanceId="{be31bcce-b14b-4d90-8daf-673a7b7b455a}" id="RectangleArea" /> <!-- GUID2-->
</Areas>
<OnEnterActions>
<WorldBase.ObjectReference InstanceId="{53ba50aa-0df9-4cae-ac4e-633d4809c09f}" id="PlayBlendTreeStateAction" /> <!-- any guid here: GUID3-->
</OnEnterActions>
<OnExitActions>
<WorldBase.ObjectReference InstanceId="{ed161105-2e1e-438d-87a5-bcd3656fa32f}" id="PlayBlendTreeStateAction" /> <!-- any guid here: GUID4-->
</OnExitActions>
</SimMission.ProximityTrigger>
<SimMission.PlayBlendTreeStateAction InstanceId="{53ba50aa-0df9-4cae-ac4e-633d4809c09f}"> <!-- GUID3-->
<BlendTreeStateName>open-barrier</BlendTreeStateName> <!-- blendtreestate name from the model .xml-->
<WorldBase.ObjectReferenceList>
<ObjectReference InstanceId="{e88f05bb-00e5-49cc-860a-40882c5b0f60}" id="Container" /><!-- GUID1-->
</WorldBase.ObjectReferenceList>
</SimMission.PlayBlendTreeStateAction>
<SimMission.PlayBlendTreeStateAction InstanceId="{ed161105-2e1e-438d-87a5-bcd3656fa32f}"> <!-- GUID4-->
<BlendTreeStateName>close-barrier</BlendTreeStateName> <!-- blendtreestate name from the model .xml-->
<WorldBase.ObjectReferenceList>
<ObjectReference InstanceId="{e88f05bb-00e5-49cc-860a-40882c5b0f60}" id="Container" /><!-- GUID1-->
</WorldBase.ObjectReferenceList>
</SimMission.PlayBlendTreeStateAction>
</WorldBase.Flight>
</SimBase.Document>

the actual model's xml.

<?xml version="1.0" encoding="utf-8"?>

<ModelInfo guid="{bd139765-922e-418a-8a10-7647ac461e7f}" version="1.1">

<LODS>

<LOD minSize="0" ModelFile="SHS_Clutter_Barriers_003_LOD0.gltf" MinSize="20.0"/>

</LODS>

<Animation guid="{903bf260-c0f0-487b-85d0-12e61c19bc31}" name="barrierClose" type="Standard"/>

<Animation guid="{48aa9033-19a7-49a2-803f-9e865d53a0b4}" name="barrierOpen" type="Standard"/>

<AnimGraph>

<DefaultState name="close-barrier"/>

<BlendTreeState name="open-barrier">

<Animations>

<Animation guid="{48aa9033-19a7-49a2-803f-9e865d53a0b4}" loop="False" FireEventOnEnd="False"/>

</Animations>

</BlendTreeState>

<BlendTreeState name="close-barrier">

<Animations>

<Animation guid="{903bf260-c0f0-487b-85d0-12e61c19bc31}" loop="False" FireEventOnEnd="False"/>

</Animations>

</BlendTreeState>

<Transition start="close-barrier" end="open-barrier" duration="1.0"/>

<Transition start="open-barrier" end="close-barrier" duration="1.0"/>

</AnimGraph>

</ModelInfo>

I was following this guy's video and code.



Cheers!
 
About drone/developer reaction is not possible

About other stuff..
Make the activation area bigger the act as "buffer " for your vehicle speed
Or leave some empty space as beginning/end animation
Or play with transitions (I can't fully understand them, I'm Sorry 😐)
 
Back
Top