Community Forum

Animation with Placable object

Forum Overview >> Scripting

CategoryScripting
Created01.04.2018 08:11


Aidan Cole (AC_2500s) 01.04.2018 08:11
I'm trying to get doors and lights to work on the Morton100x200Barn_converted placeable object.
there's a video clip of what happens. https://www.facebook.com/AC2500s/videos/1240070266125420/
i've done;
animatedObjects.xml
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<animatedObjects>
<annotation>Copyright (C) GIANTS Software GmbH, All Rights Reserved.</annotation>

<!-- Rollerdoor01 -->
<animatedObject index="Rollerdoor">
<controls posKey="ANIMATED_OBJECT_OPEN_DOOR" negKey="ANIMATED_OBJECT_CLOSE_DOOR" triggerNode="3" posText="input_ANIMATED_OBJECT_OPEN_DOOR" negText="input_ANIMATED_OBJECT_CLOSE_DOOR" />
<sound file="sounds/OpenElectricDoorSound.wav" pitchOffset="1.00" volume="0.40" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
<animation initialTime="0" duration="14">
<part node="1"> <!--index of Door-->
<keyFrame time="0.00" translation="0 0 0" />
<keyFrame time="1.00" translation="0 4.7 0" />
</part>
</animation>
</animatedObject>

<!-- Door with window -->
<animatedObject index="doorwithWindow">
<controls posKey="ANIMATED_OBJECT_OPEN_DOOR" triggerNode="1" posText="input_ANIMATED_OBJECT_OPEN_DOOR" negText="input_ANIMATED_OBJECT_CLOSE_DOOR" />
<sound file="sounds/creakDoor4s.wav" pitchOffset="1.00" volume="0.20" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
<animation initialTime="0" duration="4">
<part node="0"> <!--index of Door-->
<keyFrame time="0.00" rotation="0 0 0" />
<keyFrame time="1.00" rotation="0 100 0" />
</part>
</animation>
</animatedObject>

<!-- LIGHT SWITCH 01 -->
<animatedObject index="light01">
<controls posKey="LIGHTSWITCH_CLICK" triggerNode="0" posText="input_LIGHTSWITCH_CLICK" negText="input_LIGHTSWITCH_CLICK" />
<sound file="sounds/switch01_0.wav" pitchOffset="1.00" volume="0.20" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
<animation initialTime="0" duration="0.5">
<!--Light Switch Animation-->
<part node="1|0"> <!--index of Lever of the Lightswitch-->
<keyFrame time="0.00" rotation="0 0 0" />
<keyFrame time="1.00" rotation="-90 0 0" />
</part>
<!--Fluro_01 Animation-->
<part node="2|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_02 Animation-->
<part node=>"3|0"<!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_03 Animation-->
<part node="4|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_04 Animation-->
<part node="5|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_05 Animation-->
<part node="6|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_06 Animation-->
<part node="7|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_07 Animation-->
<part node="8|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_08 Animation-->
<part node="9|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_09 Animation-->
<part node="10|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
</animation>
</animatedObject>
<!-- LIGHT SWITCH 02 -->
<animatedObject index="light02">
<controls posKey="LIGHTSWITCH_CLICK" triggerNode="0" posText="input_LIGHTSWITCH_CLICK" negText="input_LIGHTSWITCH_CLICK" />
<sound file="sounds/switch01_0.wav" pitchOffset="1.00" volume="0.20" indoorVolumeFactor="0.55" indoorLowpassGain="0.85" pitchMax="1.15" />
<animation initialTime="0" duration="0.5">
<!--Light Switch Animation-->
<part node="1|0"> <!--index of Lever of the Lightswitch-->
<keyFrame time="0.00" rotation="0 0 0" />
<keyFrame time="1.00" rotation="-90 0 0" />
</part>
<!--Fluro_01 Animation-->
<part node="2|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_02 Animation-->
<part node="3|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_03 Animation-->
<part node="4|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_04 Animation-->
<part node="5|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_05 Animation-->
<part node="6|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
<!--Fluro_06 Animation-->
<part node="7|0"> <!--index of TG with realLights and emmisive shape-->
<keyFrame time="0.5" visibility="false" />
<keyFrame time="0.55" visibility="true" />
</part>
</animation>
</animatedObject>


</animatedObject>
</animatedObjects>

modDesc
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<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>
<text name="input_LIGHTSWITCH_CLICK">
<en>LightSwitch on/off</en>
<de>LichtSchalter an/aus</de>
<fr>Lumière on/off</fr>
</text>
</l10n>
<inputBindings>
<input name="ANIMATED_OBJECT_OPEN_DOOR" category="ONFOOT" key1="" key2="" device="1" button="BUTTON_3" mouse="MOUSE_BUTTON_LEFT" />
<input name="ANIMATED_OBJECT_CLOSE_DOOR" category="ONFOOT" key1="" key2="" device="1" button="BUTTON_1" mouse="MOUSE_BUTTON_RIGHT" />
<input name="LIGHTSWITCH_CLICK" category="ONFOOT" key1="" key2="" device="1" button="BUTTON_17" mouse="MOUSE_BUTTON_MIDDLE" />
</inputBindings>
</modDesc>

xml
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<placeableType>animatedObjectPlaceable</placeableType>
<filename>BigBarn.i3d</filename>
<placement testSizeX="1" testSizeZ="1" sizeX="1" sizeZ="1" useRandomYRotation="false" useManualYRotation="true"/>

<animatedObjects>
<animatedObject index="0>1|0" /> <!-- Roller door 01-->
<animatedObject index="0>1|1" /> <!-- Roller door 02-->
<animatedObject index="0>1|2" /> <!-- Roller door 03-->
<animatedObject index="0>1|3" /> <!-- door with window 01-->
<animatedObject index="0>1|4" /> <!-- door with window 02-->
<animatedObject index="0>1|5" /> <!-- door with window 03-->
<animatedObject index="0>5|0" /> <!-- Light 01-->
<animatedObject index="0>5|1" /> <!-- Light 02-->
<animatedObject index="0>5|2" /> <!-- Light 03-->
</animatedObjects>

UserAttributes in id3 File
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<UserAttributes>
<UserAttribute nodeId="453">
<Attribute name="index" type="string" value="Rollerdoor"/>
<Attribute name="onCreate" type="string" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="473">
<Attribute name="index" type="string" value="Rollerdoor"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="493">
<Attribute name="index" type="string" value="Rollerdoor"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="513">
<Attribute name="index" type="string" value="doorwithWindow"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="518">
<Attribute name="index" type="string" value="doorwithWindow"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="523">
<Attribute name="index" type="string" value="doorwithWindow"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="1582">
<Attribute name="index" type="string" value="light01"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="1645">
<Attribute name="index" type="string" value="light02"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
<UserAttribute nodeId="1690">
<Attribute name="index" type="string" value="light02"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>
</UserAttributes>

</i3D>

Anthony Queen (tqueen113) 01.04.2018 19:34
Any errors in the log file?

Aidan Cole (AC_2500s) 02.04.2018 04:29
no errors in the log
I could send the file if you want to look your self?

Anthony Queen (tqueen113) 02.04.2018 12:13
No its weird that your not getting any errors in the log, are your user attributes set up correctly to call the xml script?

<Attribute name="index" type="string" value"xxxxxxxx"/>
<Attribute name="xmlFilename" type="string" value="PATH TO XMLFILE"/>
<Attribute name="onCreate" type=scriptCallback" value="AnimatedObject.onCreate"/>



Aidan Cole (AC_2500s) 04.04.2018 10:29
I now have errors
I've checked the attributes and I can't see what's wrong.

<UserAttribute nodeId="444">
<Attribute name="index" type="string" value="rollerdoor"/>
<Attribute name="onCreate" type="string" value="AnimatedObjects.onCreate"/>
<Attribute name="xmlFilename" type="string" value="AnimatedObjects.xml"/>
</UserAttribute>

LOG
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/BigBarn.i3d (887.36) ms
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'rollerdoor' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'rollerdoor' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'rollerdoor' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'doorwithwindow' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'doorwithwindow' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'doorwithwindow' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'light01' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'light02' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!
Error: E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml. animatedObjects. .
Error: index 'light02' not found in AnimatedObject xml 'E:/Aidan Cole/Documents/My Games/FarmingSimulator2017/mods/Morton100x200Barn_converted_AC_2500S_Fitout/AnimatedObjects.xml'!



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