Farming Simulator UK Forums

The biggest unofficial UK forums for Farming Simulator.

Search Rules Chat Wiki Gallery Privacy Policy

Ahoy there, guest!

Log in Register


Vehicle Leasing

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

Pages: [1] 2
  Print  
dpaj1985
Newbie
Joined August 2009


« on: February 11, 2018, 09:37:57 pm »

Hello everybody, Smiley
Im playing farming simulator 17 under seasons mod and so far know how to adjust vehicle price and maintanance. Leasing vehicles makes it very tough in this case since you cant make money quickly unlike in vanila. I cant find ingame script where you can adjust lease values to balance the gameplay between buying and leasing while playing seasons. Anyone has any ideas or can help me with this matter???
« Last Edit: February 11, 2018, 09:39:54 pm by dpaj1985 » Logged
akuenzi
One certain harried accountant
MVP
Joined January 2015


« Reply #1 on: February 17, 2018, 10:51:14 am »

Hello everybody, Smiley
Im playing farming simulator 17 under seasons mod and so far know how to adjust vehicle price and maintanance. Leasing vehicles makes it very tough in this case since you cant make money quickly unlike in vanila. I cant find ingame script where you can adjust lease values to balance the gameplay between buying and leasing while playing seasons. Anyone has any ideas or can help me with this matter???
Hi dpaj1985,

If you want to modify the game's lease rates, you can do it with a little 'elbow grease' and a script. Smiley Give this a try:

1.  Create a folder in your mods directory called 'LeaseEasy' or something similar. Jump inside this directory for the rest of what we'll do.  You're going to need to put three files in here.

2.  Create an image file to represent this mod.  The game engine expects an icon of some sort to show on the screen where you pick which mods you want to have in-game.  I grabbed an image from the game and doctored it up a bit using Paint.net.  If you make your own image, just make sure the image has sides in the number of pixels in the ratio of 2^n, and is in .DDS format.  If you don't want to make one yourself, I've attached mine to this post.

Save this image file in the directory you created in step # 1.  I called my image icon.dds.  And yes... I know the icon looks like junk; I'm not a graphical artist to be sure! Cheesy

3.  Create a modDesc.xml file for the mod.  Every mod needs one of these, as I'm sure you're aware.  Using a text editor such as Notepad++, you can create this file to look something like the following:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="39">

<author>dpaj1985</author>
<version>1.0</version>
    
<title>
<en>Lease Easy</en>
<de>Leasing Anpassen</de>    
    </title>

<description>
<en><![CDATA[Mod adjusts the cost of leasing vehicles in game.]]></en>
<de><![CDATA[Mod passt die Kosten für das Leasing von Fahrzeugen im Spiel an.]]></de>
</description>

<iconFilename>icon.dds</iconFilename>
<multiplayer supported="true"/>

<extraSourceFiles>
<sourceFile filename="LeaseEasy.lua" />
</extraSourceFiles>

<l10n>
</l10n>

</modDesc>
This file should be saved as modDesc.xml and placed in the same directory you created in step # 1 above.  In the event you're not able to create the above, it is also attached at the bottom of this message.  You'll see in this code that we identify the icon image you created in step # 2 above.  Make sure the name used in the modDesc.xml file mirrors what you called your image.  We also identify the script file needed to make these adjustments.  I gave it a name of LeaseEasy.lua.

4.  Create a small script file for the mod.  This would be the file identified as LeaseEasy.lua in the modDesc.xml file above.  You can also do this in something like Notepad++.
Code:
--=====================================================================================
-- LEASE EASY
--
-- @For: dpaj1985
-- @Date: 2018-2-17
-- @Purpose: To adjust the lease pricing used in-game.
--=====================================================================================


--Enter desired lease rates to use in-game.

local baseCost = 0.02 --default = 0.02, or 2% of Vehicle cost
local perOperatingHour = 0.05 --default = 0.05, or 5% of Vehicle cost
local perDay = 0.01 --default = 0.01, or 1% of Vehicle cost
------------------------------------------------------------------------------------------

LeaseEasy = {}

function LeaseEasy:loadMap(name)
self.firstStart = true
end;

function LeaseEasy:deleteMap()
end;

function LeaseEasy:mouseEvent(posX, posY, modifier, isDown)
end;

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

function LeaseEasy:update(dt)
if self.firstStart then
if baseCost ~= nil and type(baseCost) == "number" then
if baseCost >= 0 then
EconomyManager.DEFAULT_LEASING_DEPOSIT_FACTOR = baseCost
end;
end;
if perOperatingHour ~= nil and type(perOperatingHour) == "number" then
if perOperatingHour >= 0 then
EconomyManager.DEFAULT_RUNNING_LEASING_FACTOR = perOperatingHour
end;
end;
if perDay ~= nil and type(perDay) == "number" then
if perDay >= 0 then
EconomyManager.PER_DAY_LEASING_FACTOR = perDay
for vehicle, _ in pairs(StoreItemsUtil.storeItemsByXMLFilename) do
StoreItemsUtil.storeItemsByXMLFilename[vehicle].runningLeasingFactor = perOperatingHour
end;
end;
end;
self.firstStart = false
end;
end;

function LeaseEasy:draw()
end;

addModEventListener(LeaseEasy);
Save this file as LeaseEasy.lua and place it in the same directory you created in step # 1 above.  It's just a few lines of code, but it will hopefully get the default leasing values adjusted to how you want to have them.  Again, in the event you're not able to create the above, it is also attached at the bottom of this message.

By itself, the script as written will do literally nothing.  You'll notice some narrative at the top of the LeaseEasy.lua script that indicates how to change values.  I've left the values to be at their default value in the base game, so you'll need to change these to be what you want them to be before you use this in-game.  The lease rates are multipliers, or percentages of the vehicle's cost, and they are the same three lease factors in the same order that they appear in the shop menu in-game.  If you want lease cost to be zero, then change all three values to 0.

I believe that's it -- you now have yourself a mod!  There should now be three items in the 'LeaseEasy' directory you created earlier:
Code:
LeaseEasy.lua
modDesc.xml
icon.dds
The files are included in a zip file to this post below (files.zip).  I didn't test it on multiplayer and don't know if it works there; maybe you'll get lucky. Wink

Hope this helps you stop those lousy crooks in town that have been overcharging you to lease their crummy equipment. Cheesy

EDIT:  Fixed (hopefully Cheesy) for dpaj1985's latest testing.

* files.zip (17.94 KB - downloaded 36 times.)
« Last Edit: February 26, 2018, 03:50:42 am by akuenzi » Logged

dpaj1985
Newbie
Joined August 2009


« Reply #2 on: February 17, 2018, 11:53:59 pm »

 Cheesy Cheesy ohh thanx so much for you feedback. It would be great if game difficulty came with this setup. This would surely make leasing more fun and realistic. Im not much of a c++ modifier but I will surely try this out. I do edit some xml and lua files just when it comes to numeric adjustments but very basic in programming. Smiley Thank you so much for this mod Wink
« Last Edit: February 18, 2018, 01:18:47 am by dpaj1985 » Logged
dpaj1985
Newbie
Joined August 2009


« Reply #3 on: February 21, 2018, 07:01:43 am »

There seems to be a problem with a mod. The Lease values in a shop show calculated values based on the percentage applied. There's a little glitch where BaseCost <=> perOperatingHour. With this mod applied, game actually charges perOperatingHour from a Base Cost, which is really strange and dam shifty Tongue Smiley. Im guessing a problem might be somewhere along this lines

if baseCost ~= nil and type(baseCost) == "number" then
         if baseCost >= 0 then
            EconomyManager.DEFAULT_LEASING_DEPOSIT_FACTOR = baseCost        <<<<<
         end;
      end;
      if perOperatingHour ~= nil and type(perOperatingHour) == "number" then
         if perOperatingHour >= 0 then
            EconomyManager.DEFAULT_RUNNING_LEASING_FACTOR = perOperatingHour    <<<<<
« Last Edit: February 21, 2018, 07:35:15 am by dpaj1985 » Logged
akuenzi
One certain harried accountant
MVP
Joined January 2015


« Reply #4 on: February 21, 2018, 09:25:28 am »

There seems to be a problem with a mod. The Lease values in a shop show calculated values based on the percentage applied. There's a little glitch where BaseCost <=> perOperatingHour. With this mod applied, game actually charges perOperatingHour from a Base Cost, which is really strange and dam shifty Tongue Smiley. Im guessing a problem might be somewhere along this lines
Code:
if baseCost ~= nil and type(baseCost) == "number" then
if baseCost >= 0 then
EconomyManager.DEFAULT_LEASING_DEPOSIT_FACTOR = baseCost        <<<<<
end;
end;
if perOperatingHour ~= nil and type(perOperatingHour) == "number" then
if perOperatingHour >= 0 then
EconomyManager.DEFAULT_RUNNING_LEASING_FACTOR = perOperatingHour    <<<<<
Hi dpaj1985,

If you have a moment, could you please clarify further what the problem is?  The only thing 'shifty' here is my brain trying to comprehend the problem you're describing. Cheesy I really can't help the way the game calculates lease cost.  All this little script does is to allow one to change the factor (or percentage) on which it is based.  Perhaps I didn't make that part clear enough at the top.  The game appears to calculate the lease cost based on a percentage of the vehicle's value.  Maybe there's a way to change that, but I don't know how to do it at the moment.  All I could figure out was how to change the 'factor.'  So, if you don't want it to calculate lease cost for operating hours based on vehicle's cost, then change the parameter at the top of the script as follows:
Code:
local perOperatingHour = 0
Now it won't charge you anything on a per hour basis.  I'm not sure that addresses your question, though.  Undecided

EDIT:  Just a thought -- would it be possible for you to show a picture taken in-game of what you're describing?  Might help me understand. Smiley
« Last Edit: February 21, 2018, 09:29:52 am by akuenzi » Logged

dpaj1985
Newbie
Joined August 2009


« Reply #5 on: February 21, 2018, 10:21:20 am »

I just like to play game under realism so this mod made it more fun for me but I was astonished when I saw something is wrong Smiley but its just the game to me anyway. This is the example of the leased machine. you'll see the highlighted section of the base cost and per operating hour


* 1.png (1746.91 KB, 2606x1548 - viewed 398 times.)
« Last Edit: February 21, 2018, 10:44:47 am by dpaj1985 » Logged
dpaj1985
Newbie
Joined August 2009


« Reply #6 on: February 21, 2018, 10:26:08 am »

On the right top corners is my total money at this stage. But watch what happens when I pass game speed of (120x) for the first hour after


* 2.png (1183.86 KB, 2304x1296 - viewed 363 times.)
Logged
dpaj1985
Newbie
Joined August 2009


« Reply #7 on: February 21, 2018, 10:28:26 am »

You ll now see the current money on the top right corner after one hour has passed while under lease. It clearly works out that I payed another base costs instead of per operating hour.Somehow game switched Base Cost values and per operating hour and mixed all up along the run. I hope you see a better picture of what i was goin on about Wink.


* 3.png (1178.95 KB, 2304x1296 - viewed 360 times.)
« Last Edit: February 21, 2018, 10:39:46 am by dpaj1985 » Logged
akuenzi
One certain harried accountant
MVP
Joined January 2015


« Reply #8 on: February 21, 2018, 06:46:53 pm »

I just like to play game under realism so this mod made it more fun for me but I was astonished when I saw something is wrong Smiley but its just the game to me anyway. This is the example of the leased machine. you'll see the highlighted section of the base cost and per operating hour

On the right top corners is my total money at this stage. But watch what happens when I pass game speed of (120x) for the first hour after

You ll now see the current money on the top right corner after one hour has passed while under lease. It clearly works out that I payed another base costs instead of per operating hour.Somehow game switched Base Cost values and per operating hour and mixed all up along the run. I hope you see a better picture of what i was goin on about Wink.
       
Hi dpaj1985,

I think I see what you mean, and thank you for taking time to post some pictures.  It's definitely helpful. Smiley

I could be mistaken, but I don't think the game is miscalculating leasing costs.  I just tried a similar experiment on my machine and leased a tractor.  Then I fast forwarded several hours, and I was charged nothing for additional leasing costs.  The reason it didn't charge me is because I wasn't using the tractor while fast forwarding.  In other words, it wasn't operating.  I'm guessing that while you were fast forwarding, you weren't actually using the RSM 161?

Secondly, I think the game calculates leasing costs in real time, not in fast-forwarded time.  I tried the experiment again, this time while in the tractor, and while it was running.  Fast forwarding again for several hours, I still wasn't charged any leasing costs beyond the initial fee.  So, I saved the game and took a look at the save game file.  Here's what I saw for the tractor I leased:
Code:
   <vehicle id="36" filename="data/vehicles/steerable/huerlimann/huerlimannH488.xml" isAbsolute="true" age="0" price="45000" propertyState="2" operatingTime="298.1676272621"  fuelFillLevel="99.940834339169" cruiseControl="43"  attacherJointComboDir="-1" dirtAmount="0.0022277326788753">
        <component1 position="-789.72308349609 100.01616668701 415.47286987305" rotation="3.1277303695679 -1.1601756811142 -3.1394996643066" />
        <component2 position="-790.72857666016 100.65622711182 415.03570556641" rotation="3.1250112056732 -1.1601569652557 -3.1365354061127" />
        <configuration name="wheel" id="1" />
        <configuration name="motor" id="1" />
        <boughtConfiguration name="wheel" id="1" />
        <boughtConfiguration name="motor" id="1" />
    </vehicle>
On the top line you'll see that it says the operatingTime was 298.1676272621.  This means that in spite of the fast forwarding, the tractor had only been literally 'operating' for just a little over 298 seconds... not several hours.  In the save game file I changed this number to about 3,550, or just under an hour, and then reloaded the game.  And sure enough, after loading up the game, and once I had the tractor operating for 50 additional seconds, I was charged for another hour of leasing.  But it ONLY charged me for the per hour portion of operating time, and nothing else.  Based on this, the drop in money you're seeing would have to be related to something other than leasing.

Third, it could be that you have some other things going on in the map that might be costing you money over that hour you fast-forwarded.  I noticed in one of your pictures that the map you're playing has the Fabrik script included.  I don't 'think' the Fabrik script actually reaches into one's pocket for money... but it does remind that there are other things going on in a map other than leasing when the time gets fast-forwarded.  It could be that another activity was charging you money, and it only 'seemed' like it was from the leasing?  Could even be another mod that also touches the leasing aspect of the game.  Not knowing what mods you're using, it's hard to say.

To try to pinpoint what it is, try taking a look at the Finance menu in-game.  One part of it looks like this (click to expand if you wish):

There's a line item in this report specifically for leasing costs.  You could try the same experiment you did before, but this time, take a look at this report both before and after.  It will hopefully tell you exactly where your money went.

Best of luck! Smiley
« Last Edit: February 21, 2018, 10:53:48 pm by akuenzi » Logged

dpaj1985
Newbie
Joined August 2009


« Reply #9 on: February 21, 2018, 09:49:01 pm »

Yeah I absolutly agree with what you said Shocked Shocked. I didnt take in account, vehicles operating hour script under garage menu. I was counting on gameplay time and not the vehicle operating time.  I ll try work out what else could be interfering as I play along. Still the charges comes from the vehicles leasing system anyway but maybe I have to start a new game again and then try see the difference.
« Last Edit: February 21, 2018, 11:18:28 pm by dpaj1985 » Logged
dpaj1985
Newbie
Joined August 2009


« Reply #10 on: February 22, 2018, 01:55:26 am »

Im playing a new game using same map called FS17_Loesshuegelland v4.1.1. Here is the leased amount shown under finance menu. Im using the same machine as indicated previosly. This is clearly another extra base cost amount payed for both combine and its header. The first picture is the total cost for lease but the next picture adds another base cost amount for both combine and header.


* 1.png (1421.25 KB, 3319x1983 - viewed 51 times.)
« Last Edit: February 22, 2018, 02:04:30 am by dpaj1985 » Logged
dpaj1985
Newbie
Joined August 2009


« Reply #11 on: February 22, 2018, 01:56:36 am »

Now here what happends when I accelerated up to the first hour. I have only one leased combine and its header and no other machines under lease nor using any production  building at the time. This is a very new start of the game


* 2.png (475.19 KB, 2976x1712 - viewed 58 times.)
« Last Edit: February 22, 2018, 02:05:55 am by dpaj1985 » Logged
dpaj1985
Newbie
Joined August 2009


« Reply #12 on: February 22, 2018, 05:30:41 am »

I have just found an issue to my leasing problem. Grin There is a mod called FS17_oilUsage which allowed me to periodily add oil to vehicles but it appears that this two mods dont mix well which is unfortunate Sad. After diselecting that mod, lease works great. I apologies for before and hope i didnt raise much pressure for you trying to evaluate what was my issue with the game. I appreciate your help support and thanx a lot for this great mod ones again  Wink Wink  
« Last Edit: February 22, 2018, 05:34:58 am by dpaj1985 » Logged
akuenzi
One certain harried accountant
MVP
Joined January 2015


« Reply #13 on: February 22, 2018, 07:01:28 am »

I have just found an issue to my leasing problem. Grin There is a mod called FS17_oilUsage which allowed me to periodily add oil to vehicles but it appears that this two mods dont mix well which is unfortunate Sad. After diselecting that mod, lease works great. I apologies for before and hope i didnt raise much pressure for you trying to evaluate what was my issue with the game. I appreciate your help support and thanx a lot for this great mod ones again  Wink Wink 
Yes, that is most unfortunate. Sad I downloaded the oil change mod myself, and just as you said, it causes problems for leasing.  However, it has this problem even without the little mod we worked on above.  As such, this isn't really a 'mod conflict,' but rather appears to be a mod with some kind of error in it, as it doesn't work properly in the basic game all by itself.  It probably works fabulously if one never leases a vehicle... so leased vehicles might have been something unanticipated by the mod authors.  The way the game handles leased vehicles, is that it adds them to a player's vehicle list.  It's almost as if they are 'owned,' and that could be how the oil change code is treating them.  Whatever it is, the oil change mod doesn't play nicely with leased vehicles, for some reason... unless that was the mod's way of charging something for lease maintenance.  It's just such a large amount, though, like you said.  And unfortunately, I can't easily read the code on the oil change mod.  Whoever authored the mod chose to jam all of it onto one line in each file, which makes reading of it an exercise in pulling one's hair out. Tongue I sure wish modders wouldn't choose to do that with their work, as it makes things like this difficult.

Thanks for checking back on this, and don't worry about 'raising my pressure.' Grin This is all just part of the fun.  I just feel bad that that the oil change mod doesn't work as intended when you want to lease a vehicle.  It's a great concept... but perhaps needs a bit more coding so that it properly handles leased vehicles.

One thing you might consider would be to contact the authors of the oil change mod to let them know about your tests, and what their mod does with leased vehicles.  If nobody has ever brought this to their attention, they might be unaware of this little bug.  All the best. Wink
Logged

dpaj1985
Newbie
Joined August 2009


« Reply #14 on: February 22, 2018, 08:10:02 am »

Both mods are great but since playing seasons mod, maintenance is already taken in account. Oil change is anyway part of vehicle maintenance and to me its not a big deal. I haven't yet seen anyone working to improve leasing system until now and very happy with the mod Smiley Smiley. Since lot of people play with seasons, this mod will improve the gameplay. So far, I'm having fun, everything work great and the game is flawless. All credits to you !!!!  Wink
« Last Edit: February 22, 2018, 08:18:03 am by dpaj1985 » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Back Top of page


Powered by SMF 1.1.21 | SMF © 2013, Simple Machines