Create a panel
Panel
Create and XML file for your panel
The root tag of the panel xml file is panel
| <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
</panel>
|
Set panel i3d filename
| <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
</panel>
|
Note
The path is relative to the root of your mod directory.
Register connection hoses
You can use every default settings you want when you register your hose (diameter
, type
, straighteningFactor
, …) excepted length
.
type
can be any default hose type and also new custom type cabinPanel_indoor
| <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor" />
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor" />
</connectionHoses>
</panel>
|
You can create as many interactive buttons as you want.
The radius
tag on the button is not required, the default value is 0.012
.
<action></action>
tag can take one of those values :
- activate_deactivate
- fold_unfold
- raise_down
- tip_to_ground
- tip_to_object
Danger
All other values not included in this list will produce an error
The <animation></animation>
tag is used to play an animation on the implement where the panel is registered. Accepted values are animation names defined in yourVehicleStoreItem.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor"/>
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor"/>
</connectionHoses>
<interactivePanel>
<buttons>
<button node="0|4" radius="0.02">
<action>activate_deactivate</action>
</button>
<button node="0|5">
<animation>yourImplementAnimationName</animation>
</button>
</buttons>
</interactivePanel>
</panel>
|
An animation to play when your button is clicked can be defined.
Add a <buttonAnimation></buttonAnimation>
tag in your button and add the parts you want to animate.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor"/>
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor"/>
</connectionHoses>
<interactivePanel>
<buttons>
<button node="0|4" radius="0.02">
<action>activate_deactivate</action>
<buttonAnimation>
<part node="0|4" startTime="0" endTime="1" startTrans="0 0 0" endTrans="0 0 1"/>
</buttonAnimation>
</button>
</buttons>
</interactivePanel>
</panel>
|
Note
You can use every basic tags to animate your part
(translation
, rotation
, scale
, etc…)
Add « onChange » object in your panel
You can add some objects who will move, rotate or update their visibility when the panel is attached inside the tractor cabin.
The onChange functionnality is registered inside a <objectChangesOnAttach></objectChangesOnAttach>
tag.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 | <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor"/>
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor"/>
</connectionHoses>
<interactivePanel>
<buttons>
<button node="0|4" radius="0.02">
<action>activate_deactivate</action>
<buttonAnimation>
<part node="0|4" startTime="0" endTime="1" startTrans="0 0 0" endTrans="0 0 1"/>
</buttonAnimation>
</button>
</buttons>
</interactivePanel>
<objectChangesOnAttach>
<objectChange node="0|0" visibilityInactive="false"/>
</objectChangesOnAttach>
</panel>
|
Visual markers
To make the cabin panel easier to use, you can add visual markers for a button.
The default marker is provided by FS22_cabinPanels
.
You need to add a markerNode
tag with your marker node
The marker will be automatically imported in the panel when your mod is loaded by the game.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 | <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor"/>
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor"/>
</connectionHoses>
<interactivePanel>
<buttons>
<button node="0|4" radius="0.02" markerNode="0|3|0">
<action>activate_deactivate</action>
<buttonAnimation>
<part node="0|4" startTime="0" endTime="1" startTrans="0 0 0" endTrans="0 0 1"/>
</buttonAnimation>
</button>
</buttons>
</interactivePanel>
<objectChangesOnAttach>
<objectChange node="0|0" visibilityInactive="false"/>
</objectChangesOnAttach>
</panel>
|
a custom visual marker
You can set a custom visual marker. Simply add a markerFilename
tag in the button
element.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 | <?xml version="1.0" encoding="utf-8" standalone="no" ?>
<panel>
<filename>yourPath/ToPanel.i3d</filename>
<connectionHoses>
<hose inputNode="0|2" diameter="0.01" type="cabinPanel_indoor"/>
<hose inputNode="0|3" diameter="0.016" type="cabinPanel_indoor"/>
</connectionHoses>
<interactivePanel>
<buttons>
<button node="0|4" radius="0.02" markerNode="0|3|0" markerFilename="i3D/marker.i3d">
<action>activate_deactivate</action>
<buttonAnimation>
<part node="0|4" startTime="0" endTime="1" startTrans="0 0 0" endTrans="0 0 1"/>
</buttonAnimation>
</button>
</buttons>
</interactivePanel>
<objectChangesOnAttach>
<objectChange node="0|0" visibilityInactive="false"/>
</objectChangesOnAttach>
</panel>
|