[lua]ExtendedSprayer = {}
function ExtendedSprayer.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Sprayer, specializations)
end
function ExtendedSprayer:load(xmlFile)
self.setIsTurnedOn = Utils.prependedFunction(self.setIsTurnedOn, ExtendedSprayer.setIsTurnedOn)
if self.isClient then
local i = 0
while true do
do
local baseName = string.format("vehicle.sprayValves.sprayValve(%d)", i)
local node = getXMLString(xmlFile, baseName .. "#index")
if node == nil then
break
end
local particle = self.sprayValves[i + 1]
ParticleSystemUtil.loadParticleSystemDesc(particle, self, xmlFile, baseName)
i = i + 1
ParticleSystemUtil.updateParticleSystem(particle, self, false)
end
end
self.particlePlanes = ShaderParticleSystem.load(xmlFile, "vehicle.particlePlane", self)
end
end
function ExtendedSprayer:delete()
end
function ExtendedSprayer:mouseEvent(posX, posY, isDown, isUp, button)
end
function ExtendedSprayer:keyEvent(unicode, sym, modifier, isDown)
end
function ExtendedSprayer:update(dt)
end
function ExtendedSprayer:updateTick(dt)
if self:getIsActive() and self.isTurnedOn then
for _, ps in pairs(self.sprayValves) do
ParticleSystemUtil.updateParticleSystem(ps, self, false)
end
end
if self.particlePlanes ~= nil then
ShaderParticleSystem.updateParticle(self.particlePlanes, dt)
end
end
function ExtendedSprayer:draw()
end
function ExtendedSprayer:setIsTurnedOn(isTurnedOn, noEventSend)
if isTurnedOn ~= self.isTurnedOn and self:getIsTurnedOnAllowed(isTurnedOn) and self.particlePlanes ~= nil then
ShaderParticleSystem.setIsTurnedOn(self.particlePlanes, isTurnedOn)
end
end[/lua]
moddesc:
[xml]<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="9">
<author>Tekk4</author>
<version>1</version>
<title>
<en>Bossini RAB 140</en>
<de>Bossini RAB 140</de>
</title>
<description>
<en>
<![CDATA[Bossini RAB 140]]>
</en>
<de>
<![CDATA[Bossini RAB 140]]></de>
</description>
<iconFilename>store.dds</iconFilename>
<multiplayer supported="true"/>
<l10n>
<text name="BEL3LEFT"> <de>Blinker links</de> <en>left turnlights</en> </text>
<text name="BEL3RIGHT"> <de>Blinker rechts</de> <en>right turnlights</en> </text>
<text name="BEL3WARN"> <de>Warnblinker</de> <en>hazard lights</en> </text>
</l10n>
<extraSourceFiles>
<sourceFile filename="ParticleSystemUtil.lua"/>
<sourceFile filename="ShaderParticleSystem.lua"/>
</extraSourceFiles>
<specializations>
<specialization name="PowershaftLS13compatible" className="PowerShaft" filename="PowershaftLS13compatible.lua" />
<specialization name="beleuchtung" className="BEL3" filename="beleuchtungV31.lua"/>
<specialization name="extendedSprayer" className="ExtendedSprayer" filename="ExtendedSprayer.lua"/>
</specializations>
<vehicleTypes>
<type name="BossiniRAB140" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="attachable" />
<specialization name="animatedVehicle" />
<specialization name="cylindered" />
<specialization name="fillable" />
<specialization name="sprayer" />
<specialization name="foldable" />
<specialization name="PowershaftLS13compatible" />
<specialization name="beleuchtung" />
<specialization name="animatedVehicle" />
<specialization name="mouseControlsVehicle" />
<specialization name="extendedSprayer" />
</type>
</vehicleTypes>
<storeItems>
<storeItem>
<en>
<name>Bossini RAB 140</name>
<description>
<![CDATA[Modello, Textures, Ingame: Tekk4
Scripts: Sven777b, Manuel Leithner, modelleicher]]>
</description>
<specs>
<![CDATA[Bossini RAB 140
Botte italiana 2 assi usata in ottime condizioni
Capacità: 10500 litri
Costo giornaliero: €30]]>
</specs>
</en>
<de>
<name>Bossini RAB 140</name>
<description>
<![CDATA[Modello, Textures, Ingame: Tekk4
Scripts: Sven777b, Manuel Leithner, modelleicher]]>
</description>
<specs>
<![CDATA[Bossini RAB 140
Botte italiana 2 assi usata in ottime condizioni
Capacità: 10500 litri
Costo giornaliero: €30]]>
</specs>
</de>
<rotation>180</rotation>
<image active="store.dds" brand="assets/brand_bossini.dds"/>
<price>11400</price>
<xmlFilename>marshall/Bossini.xml</xmlFilename>
<dailyUpkeep>30</dailyUpkeep>
<brand>Bossini</brand>
<machineType>slurryTanks</machineType>
</storeItem>
</storeItems>
<inputBindings>
<input name="BEL3LEFT" key1="KEY_KP_1" button="" />
<input name="BEL3WARN" key1="KEY_KP_2" button="" />
<input name="BEL3RIGHT" key1="KEY_KP_3" button="" />
</inputBindings>
</modDesc>
[/xml]
und die XML:
[xml]<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<vehicle type="BossiniRAB140">
<annotation>Tekk4, Giants</annotation>
<typeDesc>$l10n_TypeDesc_ManureBarrel</typeDesc>
<filename>Bossini.i3d</filename>
<size width="3.5" length="8.0" lengthOffset="0" />
<wheels autoRotateBackSpeed="2.0">
<wheel driveMode="0" repr="0" radius="0.6" deltaY="0.01" suspTravel="0.01" spring="80" damper="10" mass="1" />
<wheel driveMode="0" repr="1" radius="0.6" deltaY="0.01" suspTravel="0.01" spring="80" damper="10" mass="1" />
<wheel driveMode="0" repr="2" radius="0.6" deltaY="0.01" suspTravel="0.01" spring="80" damper="10" mass="1" steeringAxleScale="-0.7" steeringAxleRotMax="12" steeringAxleRotMin="-12"/>
<wheel driveMode="0" repr="3" radius="0.6" deltaY="0.01" suspTravel="0.01" spring="80" damper="10" mass="1" steeringAxleScale="-0.7" steeringAxleRotMax="12" steeringAxleRotMin="-12"/>
</wheels>
<brakeForce>1</brakeForce>
<downForce>10</downForce>
<powerShaft index="0>8" part="0>8|0" fixPoint="0>8|0|0" />
<attacherJoint index="6" jointType="trailerLow" />
<particlePlane node="0>7" file="shared/marshallST1800Particles.i3d" fadeTime="1"/>
<capacity>10500</capacity>
<fillSound file="suoni/siloFillSound.wav" pitchOffset="1.0" volume="1" />
<spraySound file="suoni/work.wav" pitchOffset="1" volume="1.3"/>
<fillTypes fruitTypes="liquidManure" />
<allowFillFromAir value="false" />
<sprayUsages>
<sprayUsage fillType="liquidManure" litersPerSecond="55" />
</sprayUsages>
<movingTools>
<!-- support -->
<movingTool index="0>5" componentJointIndex="0" anchorActor="0">
</movingTool>
</movingTools>
<mouseControls>
<mouseControl iconFilename="assets/HUDbraccio1.png" mouseButton="LEFT" mouseAxis="Y" axis="AXIS_FRONTLOADER_ARM" />
<mouseControl iconFilename="assets/HUDbraccio2.png" mouseButton="LEFT" mouseAxis="X" axis="AXIS_FRONTLOADER_TOOL" />
</mouseControls>
<animations>
<!-- move support wheel down/up -->
<animation name="moveSupport">
<part node="0>5" startTime="0" duration="0.5" startTrans="-0.73892 1.42431 5.128" endTrans="-0.73892 1.1226 5.128" />
</animation>
</animations>
<support animationName="moveSupport" />
<lights count="1">
<light1 index="10" />
</lights>
<lightCoronas>
<lightCorona index="10" />
</lightCoronas>
<lightsaddon lightsStayOn="false">
<light type="dirLeft" index="14|0" />
<light type="dirRight" index="14|1" />
<light type="parkLeft" index="14|2" />
<light type="parkRight" index="14|3" />
<light type="brake" index="14|4" />
</lightsaddon>
<cuttingAreas count="1">
<cuttingArea1 startIndex="11" widthIndex="12" heightIndex="13"/>
</cuttingAreas>
<components count="2">
<component1 centerOfMass="0.0 0.0 -0.5" solverIterationCount="5" />
<component2 solverIterationCount="8" />
<!--component3 centerOfMass="0.0 0.0 -0.5" solverIterationCount="5" /-->
<joint component1="0" component2="1" index="0>5|2" rotLimit="0 0 0" transLimit="0 0 0" />
</components>
<schemaOverlay file="assets/bossini_schema.dds" fileSelected="assets/bossini_schema_selected.dds" width="0.5" height="0.5" attacherJointPosition="0 0"/>
</vehicle>[/xml]