Community Forum

Placeble with a Auto-trigger Help?

Forum Overview >> Farming Simulator 17

CategoryFarming Simulator 17
Created27.07.2017 00:58


Marctheboy Geekabits (Marctheboy) 27.07.2017 00:58
hi making a Gate and want it to automatically open and close when approaching with vehicles

everything is working with a mouse click right now. (toggle on/off)
How or were do i link a script or add a line to make it automatic with the trigger box Collision_Nodes set to Tractors (not opening of on foot)?

It a Cabin with 2 gates on each side In-Out.

==========================================
hes my codes in my AnimatedObjects.xml

<animatedObject index="InGate">
<controls posKey="ANIMATED_OBJECT_OPEN_DOOR" triggerNode="1" posText="input_ANIMATED_OBJECT_OPEN_DOOR" negText="input_ANIMATED_OBJECT_CLOSE_DOOR"/>
<animation initialTime="0" duration="2">
<part node="0">
<keyFrame time="0" translation="0 0 0" rotation="0 0 0" />
<keyFrame time="1" translation="0 0 0" rotation="-90 0 0" />
</part>
</animation>
</animatedObject>
<animatedObject index="OutGate">
<controls posKey="ANIMATED_OBJECT_OPEN_DOOR" triggerNode="1" posText="input_ANIMATED_OBJECT_OPEN_DOOR" negText="input_ANIMATED_OBJECT_CLOSE_DOOR"/>
<animation initialTime="0" duration="2">
<part node="0">
<keyFrame time="0" translation="0 0 0" rotation="0 0 0" />
<keyFrame time="1" translation="0 0 0" rotation="90 0 0" />
</part>
</animation>
</animatedObject>

==========================================
And my modDesc.xml

<l10n>
<text name="input_ANIMATED_OBJECT_OPEN_DOOR">
<en>Open door</en>
<de>Tor öffnen</de>
</text>
<text name="input_ANIMATED_OBJECT_CLOSE_DOOR">
<en>Close door</en>
<de>Tor schließen</de>
</text>
</l10n>

<inputBindings>
<input name="ANIMATED_OBJECT_OPEN_DOOR" category="ONFOOT" key1="" key2="" device="0" button="BUTTON_3" mouse="MOUSE_BUTTON_LEFT" />
<input name="ANIMATED_OBJECT_CLOSE_DOOR" category="ONFOOT" key1="" key2="" device="0" button="BUTTON_1" mouse="MOUSE_BUTTON_RIGHT" />
</inputBindings>

==========================================

Emil Drefers (Unknown) 27.07.2017 06:55
Hi,

you can use the "BarrierTrigger" for that.
The AnimatedObject script requires an user input to move an object.

Cheers,
Emil



Marctheboy Geekabits (Marctheboy) 27.07.2017 18:53
i did some research but cant find the way to structure it.

i found this...

i replace my code from --->

<UserAttribute nodeId="1300">
<Attribute name="index" type="string" value="InGate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>

to this new sets of Attributes -->

<UserAttribute nodeId="1300">
<Attribute name="onCreate" type="scriptCallback" value="Barrier.onCreate"/>
</UserAttribute>

but i know i'm missing something like how do i specify the rotation="90 0 0 0" or the node to use or the trigger value/NodeID

my barrier is all under a transform group does it need a different structure?

<TransformGroup name="Gate.In" translation="18.1516 1.5527 0.667438" nodeId="1300">
<Shape shapeId="23" name="Gate_In" kinematic="true" nodeId="1301" materialIds="12" castsShadows="true" receiveShadows="true"/>
<Shape shapeId="24" name="Trigger_In" translation="-2.37593 0.360571 2.82718" static="true" trigger="true" collisionMask="3145728" nodeId="1302" materialIds="15" castsShadows="true" receiveShadows="true" nonRenderable="true"/>



Note: Log in to post. Create a new account here.