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.
the actual model's xml.
I was following this guy's video and code.
www.fsdeveloper.com
Cheers!
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.
MSFS - Triggering Hangar door animation in SimObject by distance?
You would call it an "RFID" tag. Carry it in your pocket and magically, the hangar door opens only for you and Elliot You were right Rick, it is fun Now I have to change the doors motor 😆 (This is using worldscript, Rectangle area and driving the SimObject model animations using the...
www.fsdeveloper.com
Cheers!
