FS-UK has been updated! Find out more

Farming Simulator UK Forums

Unofficial UK forums for Farming Simulator and FS mods.

Search Rules Chat Wiki Gallery Privacy Policy

Ahoy there, guest!

Log in Register


Price of using hired worker / AI

Seen 392 times - 0 Members and 1 Guest are currently viewing this thread

Pages: [1]
  Print  
Tass
Regular
Joined January 2014


« on: September 16, 2018, 09:23:06 am »

Hi

Is it possible to modify the price of using AI worker?
Been looking through base game files and MR files, cant find it. where would i look for it, or is it not possible?

best regards
Tass
Logged
storthoaks
Regular
Joined July 2011
Born and bred in NZ, go the krone!


« Reply #1 on: September 16, 2018, 09:31:40 am »

Hi

Is it possible to modify the price of using AI worker?
Been looking through base game files and MR files, cant find it. where would i look for it, or is it not possible?

best regards
Tass
Cant do it through MR, if you are using seasons or courseplay you can adjust it through them
Logged
Tass
Regular
Joined January 2014


« Reply #2 on: September 16, 2018, 05:58:21 pm »

But what about the base game files?? it must be somewhere!?
Logged
yumi
Regular
Joined May 2012


« Reply #3 on: September 17, 2018, 07:35:52 am »

But what about the base game files?? it must be somewhere!?
Hello,
In the base game the payment is done here in the code

Code:
function AIVehicle:updateTick(dt)
    --# only run on server side?
    if not self.isServer then
        return;
    end
    if self.isHired and self.isServer and not self.isHirableBlocked then
        local difficultyMultiplier = g_currentMission.missionInfo.buyPriceMultiplier;
        g_currentMission:addSharedMoney(-dt*difficultyMultiplier*self.pricePerMS, "wagePayment");
        g_currentMission:addMoneyChange(-dt*difficultyMultiplier*self.pricePerMS, FSBaseMission.MONEY_TYPE_AI)
    end;

with pricePerMS being

Code:
function AIVehicle:load(savegame)
......
self.pricePerMS = Utils.getNoNil(getXMLFloat(self.xmlFile, "vehicle.ai.pricePerHour"), 2000)/60/60/1000;

So I understand you can overwrite it for a given vehicle by putting it in its xml or you can write a simple piece of code if you want to change it for all vehicles.
Logged

moreRealistic fan !
FS17 mr on Lossberg map.
Give a try to ContractorMod!
Tass
Regular
Joined January 2014


« Reply #4 on: September 19, 2018, 06:36:30 pm »

Hello,
In the base game the payment is done here in the code

Code:
function AIVehicle:updateTick(dt)
    --# only run on server side?
    if not self.isServer then
        return;
    end
    if self.isHired and self.isServer and not self.isHirableBlocked then
        local difficultyMultiplier = g_currentMission.missionInfo.buyPriceMultiplier;
        g_currentMission:addSharedMoney(-dt*difficultyMultiplier*self.pricePerMS, "wagePayment");
        g_currentMission:addMoneyChange(-dt*difficultyMultiplier*self.pricePerMS, FSBaseMission.MONEY_TYPE_AI)
    end;

with pricePerMS being

Code:
function AIVehicle:load(savegame)
......
self.pricePerMS = Utils.getNoNil(getXMLFloat(self.xmlFile, "vehicle.ai.pricePerHour"), 2000)/60/60/1000;

So I understand you can overwrite it for a given vehicle by putting it in its xml or you can write a simple piece of code if you want to change it for all vehicles.

thank you, i will look into that.
Allways up for learning new things
Logged
Pages: [1]
  Print  
 
Jump to:  

Back Top of page


Powered by SMF 1.1.21 | SMF © 2013, Simple Machines