MBTrac1600Turbo.Lua

  • hallo,


    ich habe da ein problem ich möchte dieses script so umschreiben, das nur noch die funktion der animierten kupplung dableibt.


    könntet ihr mir sagen, was ich alles löschen kann aus dem script?


    habe es schon selber versucht dann ging aber garnichts mehr


    danke schonmal im vorraus


    [lua]--
    -- Specialisation for MB Trac 1600 Turbo
    --
    -- Author: Mofa-Killer, Face


    MBTrac1600Turbo = {};


    function MBTrac1600Turbo.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Motorized, specializations);
    end;


    function MBTrac1600Turbo:load(xmlFile)


    self.backHydraulic = {};
    self.backHydraulic.rootArm = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.backHydraulic#rootArm"));
    self.backHydraulic.bottomArm = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.backHydraulic#bottomArm"));
    self.frontAttacherJoint = {};
    self.frontAttacherJoint.node = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.trailerAttacherJoints#front"));

    self.tankicon = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tankicon#index"));
    self.batterieicon = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.batterieicon#index"));
    self.blinkericon = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.blinkericon#index"));

    self.updateJoint = false;
    end;


    function MBTrac1600Turbo:delete()
    end;


    function MBTrac1600Turbo:readStream(streamId, connection)
    end;


    function MBTrac1600Turbo:writeStream(streamId, connection)
    end;


    function MBTrac1600Turbo:mouseEvent(posX, posY, isDown, isUp, button)
    end;


    function MBTrac1600Turbo:keyEvent(unicode, sym, modifier, isDown)
    end;


    function MBTrac1600Turbo:update(dt)
    if self:getIsActive() then
    Cylindered.updateMovingPart(self, self.movingParts[1]);
    end;

    if self.isMotorStarted then
    local currentFuelPercentage = 0;
    local fuelWarnPercentage = 20;
    if self.fuelCapacity > 0 then
    currentFuelPercentage = (self.fuelFillLevel / self.fuelCapacity + 0.0001) * 100;
    end;
    if currentFuelPercentage < fuelWarnPercentage then
    setVisibility(self.tankicon, true);
    else
    setVisibility(self.tankicon, false);
    end;
    setVisibility(self.batterieicon, false);
    local rotateTanknadel = ((currentFuelPercentage / 111) * 100);
    end;


    function MBTrac1600Turbo:updateTick(dt)
    if self:getIsActive() then
    if self.backHydraulic ~= nil then
    local x, y, z = getRotation(self.backHydraulic.bottomArm);
    setRotation(self.backHydraulic.rootArm, x, y, z);
    end;


    for _, part in pairs(self.movingParts) do
    part.isDirty = true;
    end;
    end;

    if self.B3.wl or self.B3.dirLeft[1].a or self.B3.dirRight[1].a then
    setVisibility(self.blinkericon,not self.B3.bls);
    else
    setVisibility(self.blinkericon, false);
    end;
    end;


    function MBTrac1600Turbo:draw()
    end;


    function MBTrac1600Turbo:attachImplement(implement)


    local jointType = implement.object.attacherJoint.jointType;
    local jointIndex = implement.jointDescIndex;


    if jointType == Vehicle.JOINTTYPE_IMPLEMENT then
    if jointIndex == 2 then
    setVisibility(self.attacherJoints[jointIndex].topArm.rotationNode, true);
    end;
    end;

    self.updateJoint = true;
    end;


    function MBTrac1600Turbo:detachImplement(implementIndex)


    local implement = self.attachedImplements[implementIndex];
    local jointIndex = implement.jointDescIndex;


    if jointIndex == 2 then
    setVisibility(self.attacherJoints[jointIndex].topArm.rotationNode, false);
    end;
    end;


    function MBTrac1600Turbo:validateAttacherJoint(implement, jointDesc, dt)
    if self.updateJoint then
    self.updateJoint = false;
    return true;
    end;
    return false;
    end;



    function MBTrac1600Turbo:onEnter()
    if self.isMotorStarted then
    setVisibility(self.batterieicon, false);
    else
    setVisibility(self.batterieicon, true);
    end;
    end;
    [/lua]

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!