TobiasF92 / FS22_interactiveControl

Interactive Control for Farming Simulator 22
37 stars 10 forks source link

Need a code sample #34

Open HatsuneKid opened 1 year ago

HatsuneKid commented 1 year ago

Node "0>0|13|0|3|0" is a functional paddle. `

</cylindered>
    <movingTools>
        <movingTool node="supportArm" playSound="true">
            <controls axis="AXIS_CRANE_TOOL2" invertAxis="false" mouseSpeedFactor="0.8" iconName="CRANE_EC_TRANSLATE_Y" />
            <animation animSpeed="1" animAcceleration="200" animName="folding4" />
        </movingTool>
    </movingTools>
    <dashboards>
       <dashboard displayType="ROT" valueType="movingTool" node="0>0|13|0|3|0" rotAxis="3" minRot="20" maxRot="-20" axis="AXIS_CRANE_TOOL2"  doInterpolation="true"/>
    </dashboards>
</cylindered>

` How to make node"0>0|13|0|3|0" perform the same rotation action using ic? This doesn't work.

`

                <interactiveControl posText="$l10n_actionIC_liftSupportArm" negText="$l10n_actionIC_lowerSupportArm" >
                    <clickPoint node="0>0|13|0|3|3" size="0.1" type="OUTDOOR" iconType="SUPPORTARM" alignToCamera="false"/>
                    <animation name="folding4" speedScale="1.0" initTime="0.0" />
                    <dependingMovingTool isInactive="false" node="supportArm"/>
                    <dashboard raiseTime="1" activeTime="1" maxRot="20" minRot="-20" onICActivate="true" onICDeactivate="true" node="0>0|13|0|3|0" rotAxis="3" valueType="ic_action">
                    </dashboard>
                </interactiveControl>

`

HatsuneKid commented 1 year ago

After I added displayType="ROT", it worked. But on activate and deactivate can only cause the paddle to rotate in the same direction, it wasn't the exercise mode I wanted.

HatsuneKid commented 1 year ago

Problem solved! `

                <interactiveControl posText="$l10n_actionIC_liftSupportArm" negText="$l10n_actionIC_lowerSupportArm" >
                    <clickPoint node="0>0|13|0|3|3" size="0.1" type="OUTDOOR" iconType="SUPPORTARM" alignToCamera="false"/>
                    <animation name="folding4" speedScale="1.0" initTime="0.0" />
                    <dependingMovingTool isInactive="false" node="supportArm"/>
                    <dashboard displayType="ROT" raiseTime="0.1" activeTime="1" maxRot="-20" minRot="0" onICActivate="true" onICDeactivate="false" node="0>0|13|0|3|0" rotAxis="3" valueType="ic_action">
                    </dashboard>
                    <dashboard displayType="ROT" raiseTime="0.1" activeTime="1" maxRot="20" minRot="0" onICActivate="false" onICDeactivate="true" node="0>0|13|0|3|0" rotAxis="3" valueType="ic_action">
                    </dashboard>
                </interactiveControl>

`

HatsuneKid commented 1 year ago

Problem solved! `

                <interactiveControl posText="$l10n_actionIC_liftSupportArm" negText="$l10n_actionIC_lowerSupportArm" >
                    <clickPoint node="0>0|13|0|3|3" size="0.1" type="OUTDOOR" iconType="SUPPORTARM" alignToCamera="false"/>
                    <animation name="folding4" speedScale="1.0" initTime="0.0" />
                    <dependingMovingTool isInactive="false" node="supportArm"/>
                    <dashboard displayType="ROT" raiseTime="0.1" activeTime="1" maxRot="-20" minRot="0" onICActivate="true" onICDeactivate="false" node="0>0|13|0|3|0" rotAxis="3" valueType="ic_action">
                    </dashboard>
                    <dashboard displayType="ROT" raiseTime="0.1" activeTime="1" maxRot="20" minRot="0" onICActivate="false" onICDeactivate="true" node="0>0|13|0|3|0" rotAxis="3" valueType="ic_action">
                    </dashboard>
                </interactiveControl>

`

oh no! Animation "folding4" lasts for 6 seconds in this case. So the value of activeTime should also be 6. This will cause once I deactivate the IC midway through activation, the animation of the paddle reverse will still take 6 seconds to complete instead of 3 seconds.