-
Notifications
You must be signed in to change notification settings - Fork 54
/
examples.xml
190 lines (165 loc) · 13.6 KB
/
examples.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
A few examples on how to set up simpleIC in XML.
The first is the "bare minimum" XML code needed to get simpleIC working.
I have not included the <animations> </animations> lines used to animate the windows/doors etc. since that is universal as it uses basegame animations.
If you don't know how to do that, look at a tutorial which explains that or ask someone (after you tried to figure out yourself of course).
The second example is the current "normal" code with all the optional stuff.
The third example is using triggerPoint_ON and triggerPoint_OFF which means that instead of one "X" to click as a toggle you've got two marks, one that will
"open" the animation, the other one that will close the "animation".
The triggerPoint stuff is global to the script so if I add features in future that aren't controlling animations, it is still "valid" to use off and on points.
For an example on how it is actually implemented in a mod, take a look at my Deutz Agrostar Edit I linked in the Readme on Github. (youtube video link)
## absolute basic IC function animation lines:
______________________________________________
-- animationName -> name of the animation controlled by this IC function
-- insideTrigger triggerPoint -> index of the transform group that marks the trigger point
<simpleIC >
<animation animationName="windowFront" >
<insideTrigger triggerPoint="sic_frontWindow_innerNode" />
</animation>
</simpleIC>
## advanced IC function animation lines with optional stuff:
____________________________________________________________
-- outsideInteractionTrigger -> index of the playerTrigger for outside (onFoot) interaction
-- animationName -> name of the animation controlled by this IC function
-- animationSpeed -> speed the animation is played at (can also be negative)
-- sharedAnimation -> not yet implemented
-- soundVolumeIncreasePercentage -> percentage by which the volume will increase from insideVolume to outsideVolume if this animation is "on" e.g. door/window is open
-- insideTrigger -> line for the triggerPoints that can be triggered from inside camera
-- outsideTrigger -> line for the triggerPoints that can be triggered from outside camera or player on foot
-- triggerPoint -> index of the transform group that marks the particular trigger point
-- triggerPointSize -> radius around the triggerPoint in cm where it still registeres as triggered
-- reachDistance -> the max. distance to which a player can reach an IC point (indoor camera only, default 1.8)
<simpleIC outsideInteractionTrigger="sic_playerTrigger" reachDistance="1.8" >
<animation animationName="windowFront" animationSpeed="1" sharedAnimation="false" soundVolumeIncreasePercentage="0.5" >
<insideTrigger triggerPoint="sic_frontWindow_innerNode" triggerPointSize="0.04" />
<outsideTrigger triggerPoint="sic_frontWindow_outerNode" triggerPointSize="0.04" />
</animation>
</simpleIC>
## advanced IC function animation lines with optional 2 trigger points (on and off point instead of toggle):
____________________________________________________________________________________________________________
-- all the same as the one above except:
-- triggerPoint_ON -> index of the transform group that marks the particular triggerPoint for turning the IC function "on" (animation playing towards end)
-- triggerPoint_OFF -> index of the transform group that marks the particular triggerPoint for turning the IC function "off" (animation playing towards start)
<simpleIC outsideInteractionTrigger="sic_playerTrigger" >
<animation animationName="windowFront" animationSpeed="1" sharedAnimation="false" soundVolumeIncreasePercentage="0.5" >
<insideTrigger triggerPoint_ON="sic_windowFront_innerNode_ON" triggerPoint_OFF="sic_windowFront_innerNode_OFF" triggerPointSize="0.04" />
<outsideTrigger triggerPoint_ON="sic_windowFront_outerNode_ON" triggerPoint_OFF="sic_windowFront_outerNode_OFF" triggerPointSize="0.04" />
</animation>
</simpleIC>
## IC function with easy cylinder animation:
____________________________________________
-- as for the cylinderAnimations:
-- node1 -> index of one of the nodes for the cylinder
-- node2 -> index of the other node for the cylinder
----------------------------------------------------
cylinder-nodes are directed at each other, meaning the other part is also acting as reference point.
In order for this to work, the cylinder-parts pivot has to be oriented in a way that the positive Z axis points the direction the cylinder-part points at.
The "rotation" axis is the Y axis (green axis)
<simpleIC outsideInteractionTrigger="sic_playerTrigger" >
<animation animationName="doorRight" animationSpeed="1" sharedAnimation="false" soundVolumeIncreasePercentage="0.5" >
<insideTrigger triggerPoint="sic_doorRight_innerNode" triggerPointSize="0.04" />
<outsideTrigger triggerPoint="sic_doorRight_outerNode" triggerPointSize="0.04" />
</animation>
<cylinderAnimations>
<cylinder node1="doorLeft_strutCyl_left" node2="doorLeft_strutMain_left" />
</cylinderAnimations>
</simpleIC>
## Enabling triggerPoints being disabled when triggerPoint transform-group is invisible
-- disableInvisibleTriggers -> set to true will enable this feature. Default is off to keep backwards-compatible with older mods
<simpleIC disableInvisibleTriggers="true" >
[...]
</simpleIC>
## IC function motorStartControl:
There is no attributes for motorStartControl itself
-- (optional) leverAnimation -> animation to be played for a lever/button. Animation is synchronized with motor start/stop state via other inputs. Animation will play from 0-1 if engine is started and 1-0 if engine is stopped unless isTurnKeyAnimation is true
-- animationName -> name of animation
-- (optional) isTurnKeyAnimation -> if this is set to true the animation will play from 0 to 1 and then back to 0.7 when motor is started. Back to 0 when motor is stopped.
To animate starting via key as you turn it to start position and then let go to run position.
-- (optional) leverAnimationStart -> animation to be played when engine is started. Animation will be played from 0-1 and then back to 0.
-- animationName -> name of animation
-- (optional) leverAnimationStop -> animation to be played when engine is stopped. Animation will be played from 0-1 and then back to 0.
-- animationName -> name of animation
-- triggerPoints work exactly the same as for animations (see above), so you can do triggerPoint_ON and triggerPoint_OFF for starting and stopping engine on different controls
<motorStartControl>
<leverAnimation animationName="leverAnimation_motorStartControl" isTurnKeyAnimation="true" />
<leverAnimationStart animationName="leverAnimation_motorStartControl_start" />
<leverAnimationStop animationName="leverAnimation_motorStartControl_stop" />
<insideTrigger triggerPoint="sic_motorStartControl_toggle" triggerPointSize="0.02" />
</motorStartControl>
## IC function attacherControl:
-- attacherIndices -> Indices of Attacher in XML (same as for powerTakeoffConfigurations, hoses etc.) you can add multiple attacherIndices because you have one pto for multiple attachers (implement, trailer, low..)
-- (attacherIndex -> depreceated, don't use anymore. Use attacherIndices instead. It still works to be backwards-compatible but better to use attacherIndices)
-- (optional) leverAnimation -> animation to be played for a lever/button, animation is synchronized to lowered/raised state of attacher
-- animationName -> name of animation for leverAnimation
-- (optional) doNotSynch -> don't synch lever animation to inputs with key-binding instead of simpleIC. Not sure why you'd want that but its there if you need it
-- (optional) returnToCenter -> lever will return to center of its animation when implement is finished raising or lowering
-- (optional) returnToCenterRaised -> lever will return to center of its animation when implement is raised only
-- (optional) returnToCenterLowered -> lever will return to center of its animation when implement is lowered only
! of course only one, either returnToCenter or returnToCenterLowered or returnToCenterRaised should be true anything else doesn't make sense and might not return the expected result !
-- triggerPoints work exactly the same as for animations (see above), so you can do triggerPoint_ON and triggerPoint_OFF for raising/lowering too
<simpleIC outsideInteractionTrigger="sic_playerTrigger" >
<attacherControl attacherIndex="3" >
<leverAnimation animationName="leverAnimationPTO" doNotSynch="false" returnToCenter="true" returnToCenterRaised="true" returnToCenterLowered="true" />
<insideTrigger triggerPoint="sic_attacherBack_insideTrigger" triggerPointSize="0.04" />
<outsideTrigger triggerPoint="sic_attacherBack_outsideTrigger" triggerPointSize="0.04" />
</attacherControl>
</simpleIC>
## IC function ptoControl:
-- attacherIndex -> Index of Attacher in XML in which the implement needs to be attached for this pto control to control it
(Everything is the same as with attacherControl)
-- (optional) leverAnimation, doNotSynch (optional) set to true if you don't want to synch animation with turning implement on/off with key-binding instead of IC
<simpleIC outsideInteractionTrigger="sic_playerTrigger" >
<ptoControl attacherIndex="1" >
<leverAnimation animationName="leverAnimationPTO" doNotSynch="false" />
<insideTrigger triggerPoint="sic_pto_back" triggerPointSize="0.04" />
</ptoControl>
</simpleIC>
## IC function lightControl
This one is a bit more difficult to wrap your head around especially regarding the lever animations since the light Control System in FS19 is rather unintuitive.
I will try my best to explain my thoughts as to how I made the leverAnimations work though.
There are 5 different types of lightControl you can have. The 5 types are "state", "toggle", "turnLightLeft", "turnLightRight" and "turnLightHazard" each of which have their own attributes and animation-attributes.
So I'm going to explain all 5 of them separately
:: type "state"
-- lightTypes -> the lightTypes this will turn on (see lightTypes in default lights section) in this example "1" is usually the rear worklight
-- (optional) leverAnimation -> animation to be played for a lever/button, animation is synchronized with the lightTypes for this lightControl no matter how that lightType is turned on. (key-binding, IC, toggle)
<lightControl type="state" lightTypes="1" >
<leverAnimation animationName="leverAnimation_lightControl_workLight" />
<insideTrigger triggerPoint="sic_lightControl_workLight" triggerPointSize="0.02" />
</lightControl>
:: type "toggle"
- no additional attributes for this. Toggle does the same as "F" key, it toggles through the lightTypes
-- (optional) leverAnimation -> animation to be played for a lever/button. Animation is synchronized with stuff. See below
-- animStopLightTypesN (replace n with number of lightType) animation will move to this animationTime if this lightType is currently on. Turns to the most significant lightTypes
For example to animate a turn-dial switching between different lightTypes or a key that switches different lights when turned.
If you don't want a lightType to influence the animation simply leave it out. For example just make animStopLightTypes2 and animStopLightTypes3 if you want that.
If you don't quite understand how this works just try it out and see how it behaves.
<lightControl type="toggle" >
<leverAnimation animationName="leverAnimation_lightControl_toggle" animStopLightTypes0="0.2" animStopLightTypes1="0.5" />
<insideTrigger triggerPoint="sic_lightControl_toggle" triggerPointSize="0.02" />
</lightControl>
:: type "turnLightLeft"
- no additional attributes for this. Just turning on/off left turnlight
-- (optional) leverAnimation -> animation to be played for a lever/button. Animation is synchronized with stuff. See below
-- (optional) isTurnlightSharedAnimation -> set this to true if the left and right turnlight use the same lever/button animation.
Then the animation will default rest in 0.5 position, play to 0 position for right turnlight and 1 position for left turnlight.
If you leave this away/false then the animation will just play to 1 if turnlight is on, 0 if its off.
<lightControl type="turnLightLeft" >
<leverAnimation animationName="leverAnimation_lightControl_turnLight" isTurnlightSharedAnimation="true" />
<insideTrigger triggerPoint="sic_lightControl_turnLeft" triggerPointSize="0.02" />
</lightControl>
:: type "turnLightRight" (same as left)
- no additional attributes for this. Just turning on/off left turnlight
-- (optional) leverAnimation -> animation to be played for a lever/button. Animation is synchronized with stuff. See below
-- (optional) isTurnlightSharedAnimation -> set this to true if the left and right turnlight use the same lever/button animation.
Then the animation will default rest in 0.5 position, play to 0 position for right turnlight and 1 position for left turnlight.
If you leave this away/false then the animation will just play to 1 if turnlight is on, 0 if its off.
<lightControl type="turnLightRight" >
<leverAnimation animationName="leverAnimation_lightControl_turnLight" isTurnlightSharedAnimation="true" />
<insidetrigger triggerPoint="sic_lightControl_turnRight" triggerPointSize="0.02" />
</lightControl>
:: type "turnLightHazard"
- no additional attributes for this. Just turning on/off left turnlight
-- (optional) leverAnimation -> animation to be played for a lever/button. Animation is synchronized with hazards. Plays to 1 if on, 0 if off. Nothing special here.
<lightControl type="turnLightHazard" >
<leverAnimation animationName="leverAnimation_lightControl_hazards" />
<insidetrigger triggerPoint="sic_lightControl_hazard" triggerPointSize="0.02" />
</lightControl>