Spreader & XML : How to set more variableWorkWidth (sections)

Your forum for all discussions around Modding.
Darkfire BZH
Posts: 5
Joined: Tue Oct 17, 2023 9:42 pm

Spreader & XML : How to set more variableWorkWidth (sections)

Post by Darkfire BZH »

Hello modding comunity ! :hi:
I have a solid fertilizer (spreader) that I need to add more than one "variableWorkWidth" on the XML
Actually I have only one variableWorkWidth with some sections.

I've added a configuration that allow to change the length of blade's disks.
This will allows, for exemple, to use : Short blades with 18m-28m range and long blade with 24-36m range

I want to define in the xml two variableWorkWidth. One with sections from 18 to 28m and an other with sections from 24 to 36m
Notes: The refnode on the I3D is already done.

I've set two <workAreas>
Following with a <sprayer> that include two <sprayTypes/>
But how to deal with the variableWorkWidth

Thanks for your help!
Darkfire BZH (FR)

XML extract :
<variableWorkWidth>
<sections>
<section isLeft="true" maxWidthNode="section01"/>
<section isLeft="true" maxWidthNode="section02"/>
<section isLeft="true" maxWidthNode="section03"/>
<section isLeft="true" maxWidthNode="section04"/>
<section isLeft="true" maxWidthNode="section05"/>
<section isLeft="true" maxWidthNode="section06"/>

<section isLeft="false" maxWidthNode="section08"/>
<section isLeft="false" maxWidthNode="section09"/>
<section isLeft="false" maxWidthNode="section10"/>
<section isLeft="false" maxWidthNode="section11"/>
<section isLeft="false" maxWidthNode="section12"/>
<section isLeft="false" maxWidthNode="section13"/>
</sections>
<sectionNodes>
....
</sectionNodes>
</variableWorkWidth>
<French>
User avatar
Dogface
Posts: 1090
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Dogface »

Code: Select all

</variableWorkWidth>
	</variableWorkWidthConfigurations>
		</variableWorkWidthConfiguration>
			</sections>
Darkfire BZH
Posts: 5
Joined: Tue Oct 17, 2023 9:42 pm

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Darkfire BZH »

Thks Dogface
I add it to the design configurations but sections stay on type1 even change the designConfiguration.
Is it the correct synthax ? <configuration name="variableWorkWidth" index="1" />
Did you know a similar mod use two diffrent sections with variableWorkWidth ?

Code: Select all

<designConfigurations title="$l10n_configuration_equipment">
        <designConfiguration name="xxx" price="300" icon="$dataS2/menu/hud/configurations/config_edition.png">			
			<configuration name="variableWorkWidth"    index="1" />

Code: Select all

<variableWorkWidth>
		<variableWorkWidthConfigurations>
			<variableWorkWidthConfiguration>
				<sections>
					<section isLeft="true" maxWidthNode="EV1section05"/>
					<section isLeft="true" maxWidthNode="EV1section06"/>
					<section isLeft="false" maxWidthNode="EV1section08"/>
					<section isLeft="false" maxWidthNode="EV1section09"/>
				</sections>
				<sectionNodes>
					<sectionNode node="workAreaHeight" isLeft="true"  minTrans="7.5 0 -10"  maxTrans="9 0 -5"/>
					<sectionNode node="workAreaWidth"  isLeft="false" minTrans="-7.5 0 -10" maxTrans="-9 0 -5"/>
					<sectionNode node="aiMarkerLeft"  isLeft="true"  minTrans="7.5 0 -10"  maxTrans="9 0 -5"/>
					<sectionNode node="aiMarkerRight" isLeft="false" minTrans="-7.5 0 -10" maxTrans="-9 0 -5"/>
					<sectionNode node="aiMarkerBack"  isLeft="false" minTrans="0 0 -11"    maxTrans="0 0 -7"/>
				</sectionNodes>
			</variableWorkWidthConfiguration>
			<variableWorkWidthConfiguration>
				<sections>
					<section isLeft="true" maxWidthNode="EV2section03"/>
					<section isLeft="true" maxWidthNode="EV2section04"/>
					<section isLeft="false" maxWidthNode="EV2section10"/>
					<section isLeft="false" maxWidthNode="EV2section11"/>
				</sections>
				<sectionNodes>
					<sectionNode node="workAreaHeight" isLeft="true"  minTrans="12 0 -10"  maxTrans="16 0 -5"/>
					<sectionNode node="workAreaWidth"  isLeft="false" minTrans="-12 0 -10" maxTrans="-16 0 -5"/>
					<sectionNode node="aiMarkerLeft"  isLeft="true"  minTrans="12 0 -10"  maxTrans="16 0 -5"/>
					<sectionNode node="aiMarkerRight" isLeft="false" minTrans="-12 0 -10" maxTrans="-16 0 -5"/>
					<sectionNode node="aiMarkerBack"  isLeft="false" minTrans="0 0 -11"    maxTrans="0 0 -7"/>
				</sectionNodes>
			</variableWorkWidthConfiguration>
<French>
User avatar
Dogface
Posts: 1090
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Dogface »

You're welcome. :smileynew:

No, that doesn't look right. I think it is a separate configuration. I don't know what else is in the other config, try putting the blades in this config.

No, I have not seen that done before, I am just spitballing here, sorry.
Darkfire BZH
Posts: 5
Joined: Tue Oct 17, 2023 9:42 pm

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Darkfire BZH »

An other easy way (simpliest) is to split the XML. (but keep one i3d) Each with their own variable sections.
But it will add two similar spreader in the shop. That's I don't want to do.
Anyway, I will keep try.
<French>
User avatar
Dogface
Posts: 1090
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Dogface »

Try configurationSets. I think this is where you put...
        <configuration   name="variableWorkWidth"   index="1" />

Here is an example of configurationSets from: data/vehicles/bredal/k105

Code: Select all

    <configurationSets title="$l10n_configuration_extension">
        <configurationSet name="$l10n_configuration_valueNone">
            <configuration name="fillVolume"   index="1" />
            <configuration name="fillUnit"     index="1" />
            <configuration name="cover"        index="1" />
        </configurationSet>
        <configurationSet name="$l10n_configuration_valueSmall">
            <configuration name="fillVolume"   index="2" />
            <configuration name="fillUnit"     index="2" />
        </configurationSet>
        <configurationSet name="$l10n_configuration_valueBig">
            <configuration name="fillVolume"   index="3" />
            <configuration name="fillUnit"     index="3" />
            <configuration name="cover"        index="2" />
        </configurationSet>
    </configurationSets>
 
Darkfire BZH
Posts: 5
Joined: Tue Oct 17, 2023 9:42 pm

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Darkfire BZH »

Close to fully working.
I made two major mistakes. (Starting with a <sprayTypes/> in place of <sprayTypes> and a "/-->" was hidden on code.)

Triggers are ok. Effects on field and spreader particles effects are ok. Width is well recognized by Courseplay for all configuration.
Menu showing variable sections when pressing F1 is block at 24m for config 2 and 3. (Config 1 is working well)
I have to way in mind.
Replace variableWorkWidthConfigurations by a more classic designConfigurations
Multiple place of <sections> seems not understand, so I will manage to group them.

Some evenings of work, will end up paying off!
Partially view of the code for others.
*thumbsup*

Edit : Remove false code.
<French>
Darkfire BZH
Posts: 5
Joined: Tue Oct 17, 2023 9:42 pm

Re: Spreader & XML : How to set more variableWorkWidth (sections)

Post by Darkfire BZH »

Yeah ! It's finally fully working. :coolnew:

I have adapat the variableWorkWidth to 3 types of configuration. (Variable length of blades on spreader disks)
It now work from 24-36m 32-44m and 40-50m with variable adjustement for each config.
Last difficulties was the fetilizer usages rate, but it came from wrong refnode definition.
I hope I could contact the original modder to send him this update. (And sharing to others!)

I3D : Addition of refnode (Sections + workarea)
XML :
Sparyer + 3 Spraytypes
3 workArea
3 variableWorkWidthConfiguration (Initial designConfigurations were added in)

For those who are looking for the xml code (partially) :

Code: Select all

    <sprayer fillUnitIndex="1" >
        <usageScales workAreaIndex="1" scale="0.9" workingWidth="24"/>
        <animationNodes>
            <animationNode node="left"  rotSpeed="-2500" turnOnFadeTime="0.6" turnOffFadeTime="2" />
            <animationNode node="right" rotSpeed="2500" turnOnFadeTime="0.6" turnOffFadeTime="2" />
        </animationNodes>
        <sprayTypes>
            <!-- EV 24-36 -->
            <sprayType variableWorkWidthConfigurationIndex="1" fillTypes="fertilizer unknown">
                <usageScales workAreaIndex="1" scale="0.9" workingWidth="36"/>
				<effects>
					<effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectLeft">
						<motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectLeftArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="true"/>
					</effectNode>
					<effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectRight">
						<motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectRightArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="false"/>
					</effectNode>
				</effects>
            </sprayType>
            <!-- EV 32-44 -->
            <sprayType variableWorkWidthConfigurationIndex="2" fillTypes="fertilizer unknown">
                <usageScales workAreaIndex="2" scale="0.9" workingWidth="44"/>
				<effects>
					<effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectLeft">
						<motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectLeftArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="true"/>
					</effectNode>
					<effectNode effectClass="FertilizerMotionPathEffect" effectType="FERTILIZER" linkNode="fertilizerEffectRight">
						<motionPathEffect textureFilename="$data/vehicles/amazone/zats3200/fertilizerEffectRightArray.dds" numRows="22" rowLength="32" minFade="0.03" isLeft="false"/>
					</effectNode>
				</effects>
            </sprayType>
        </sprayTypes>
    </sprayer>

    <workAreas>
        <workArea type="sprayer" functionName="processSprayerArea" disableBackwards="false" requiresGroundContact="false" sprayType="1">
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight" />
			<onlyActiveWhenLowered value="false"/>
        </workArea>
        <workArea type="sprayer" functionName="processSprayerArea" disableBackwards="false" requiresGroundContact="false" sprayType="2">
            <area startNode="workAreaStart" widthNode="workAreaWidth" heightNode="workAreaHeight" />
			<onlyActiveWhenLowered value="false"/>
        </workArea>
    </workAreas>

	<variableWorkWidth>
		<variableWorkWidthConfigurations title="$l10n_configuration_equipment">
			<variableWorkWidthConfiguration name="EV 24-36" price="300" workingWidth="36">
				<sections>
					<section isLeft="true" maxWidthNode="section36G"/>
					<section isLeft="true" maxWidthNode="section32G"/>
					<section isLeft="true" maxWidthNode="section28G"/>
					<section isLeft="true" maxWidthNode="section24G"/>

					<section isLeft="false" maxWidthNode="section24D"/>
					<section isLeft="false" maxWidthNode="section28D"/>
					<section isLeft="false" maxWidthNode="section32D"/>
					<section isLeft="false" maxWidthNode="section36D"/>
				</sections>
				<sectionNodes>
					<sectionNode node="workAreaHeight" isLeft="true"  minTrans="12 0 -8"  maxTrans="18 0 -5"/>
					<sectionNode node="workAreaWidth"  isLeft="false" minTrans="-12 0 -8" maxTrans="-18 0 -5"/>
					<sectionNode node="aiMarkerLeft"  isLeft="true"  minTrans="12 0 -8"  maxTrans="18 0 -5"/>
					<sectionNode node="aiMarkerRight" isLeft="false" minTrans="-12 0 -8" maxTrans="-18 0 -5"/>
					<sectionNode node="aiMarkerBack"  isLeft="false" minTrans="0 0 -10"    maxTrans="0 0 -7"/>
				</sectionNodes>
				<objectChange node="24-36_left" visibilityActive="true" visibilityInactive="false"/>
				<objectChange node="32-44_left" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="40-50_left" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="24-36_right" visibilityActive="true" visibilityInactive="false"/>
				<objectChange node="32-44_right" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="40-50_right" visibilityActive="false" visibilityInactive="true"/>
			</variableWorkWidthConfiguration>
			<variableWorkWidthConfiguration name="EV 32-44" price="340" workingWidth="44">
				<sections>
					<section isLeft="true" maxWidthNode="section44G"/>
					<section isLeft="true" maxWidthNode="section40G"/>
					<section isLeft="true" maxWidthNode="section36G"/>
					<section isLeft="true" maxWidthNode="section32G"/>

					<section isLeft="false" maxWidthNode="section32D"/>
					<section isLeft="false" maxWidthNode="section36D"/>
					<section isLeft="false" maxWidthNode="section40D"/>
					<section isLeft="false" maxWidthNode="section44D"/>
				</sections>
				<sectionNodes>
					<sectionNode node="workAreaHeight" isLeft="true"  minTrans="16 0 -9"  maxTrans="22 0 -6"/>
					<sectionNode node="workAreaWidth"  isLeft="false" minTrans="-16 0 -9" maxTrans="-22 0 -6"/>
					<sectionNode node="aiMarkerLeft"  isLeft="true"  minTrans="16 0 -9"  maxTrans="22 0 -6"/>
					<sectionNode node="aiMarkerRight" isLeft="false" minTrans="-16 0 -9" maxTrans="-22 0 -6"/>
					<sectionNode node="aiMarkerBack"  isLeft="false" minTrans="0 0 -11"    maxTrans="0 0 -8"/>
				</sectionNodes>
				<objectChange node="24-36_left" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="32-44_left" visibilityActive="true" visibilityInactive="false"/>
				<objectChange node="40-50_left" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="24-36_right" visibilityActive="false" visibilityInactive="true"/>
				<objectChange node="32-44_right" visibilityActive="true" visibilityInactive="false"/>
				<objectChange node="40-50_right" visibilityActive="false" visibilityInactive="true"/>
			</variableWorkWidthConfiguration>
		</variableWorkWidthConfigurations>
    </variableWorkWidth>
<French>
Post Reply