Solo Starting Amount

rmf304
Posts: 41
Joined: Wed Apr 06, 2016 8:41 pm

Solo Starting Amount

Postby rmf304 » Sun Feb 12, 2017 10:30 am

How do I adjust starting amounts of the farm storage silos? I added sunflowers, rye and oats to my map but I don't know how to set an amount in storage like wheat, corn, and other crops have from the start.

User avatar
thunderhawk
Posts: 1452
Joined: Sat Jan 17, 2015 1:02 am

Re: Solo Starting Amount

Postby thunderhawk » Mon Feb 13, 2017 5:29 am

Open The Map Save And Find Careersave.xml And Open it with note pad ++ if you have ++ cause it a lot easier to find in ++ over standard notepad go to
<farmSiloAmount fillType="potato" amount="8616.000000" />
<farmSiloAmount fillType="barley" amount="8028.000000" />
<farmSiloAmount fillType="wheat" amount="8615.000000" />
<farmSiloAmount fillType="rape" amount="8495.000000" />
<farmSiloAmount fillType="liquidManure" amount="0.000000" />
<farmSiloAmount fillType="maize" amount="8594.000000" />
<farmSiloAmount fillType="manure" amount="0.000000" />
<farmSiloAmount fillType="woodChips" amount="8957.000000" />
<farmSiloAmount fillType="grass" amount="0.000000" />
<farmSiloAmount fillType="sugarBeet" amount="8082.000000" />
<farmSiloAmount fillType="chaff" amount="0.000000" />
<farmSiloAmount fillType="dryGrass" amount="0.000000" />

The First set of numbers in each line is the current amount 8082.000000" /> that one has 8082 change them to what amount you want but be careful you don't delete and anything before saving one litlle thing missing and it wont laod right on at all I would copy this file before editing for back up Click file at top left of window and then click save and your done
Dell XPS 720 Intel Core 2 Quad Extreme 3.0ghz
Liquid cooled with a 120mm x 240mm radiator twin 120mm cooler master SickleFlow fans
Nvidia GTX 660ti
Patch 1.4.4 Windows 7 home
Playing through a Sanyo 50" tv

rmf304
Posts: 41
Joined: Wed Apr 06, 2016 8:41 pm

Re: Solo Starting Amount

Postby rmf304 » Mon Feb 13, 2017 8:06 pm

I should have been a bit more clear, sorry. I knew how to change it in the save game, but I was actually looking for a solution for the map its self. So when you started a new game you had the amounts already there. Following a couple links and the Lua Wiki, I came up with a solution.

Code: Select all

   --Modify Silo Amount
     if not g_currentMission.missionInfo.isValid then
          local initialSiloFill = {
               {"wheat", math.random(10000, 25000), 12500, 5000},
               {"barley", math.random(10000, 25000), 12500, 5000},
               {"rape", math.random(10000, 25000), 12500, 5000},
               {"maize", math.random(10000, 25000), 12500, 5000},
               {"potato", math.random(15000, 30000), 15000, 7500},
               {"sugarBeet", math.random(15000, 30000), 15000, 7500},
               {"woodChips", math.random(15000, 30000), 15000, 7500},
          {"sunflower", math.random(10000, 25000), 12500, 5000},
          {"oat", math.random(10000, 25000), 12500, 5000},
          {"rye", math.random(10000, 25000), 12500, 5000},
          }
          local numberOfSiloChanges = table.getn(initialSiloFill);
          for i = 1, numberOfSiloChanges do
               local siloFillType = "FILLTYPE_"..string.upper(initialSiloFill[i][1]);
               if Fillable[siloFillType] ~= nil then
                    local gameLevel = g_currentMission.missionStats.difficulty + 1
                    local siloInitialFillAmount = initialSiloFill[i][gameLevel]
                    if siloInitialFillAmount >= 0 then
                         g_currentMission:setSiloAmount(Fillable[siloFillType], g_currentMission:getSiloAmount(Fillable[siloFillType]) - g_currentMission:getSiloAmount(Fillable[siloFillType]) + siloInitialFillAmount);
                    else
                         print("ERROR! Fill Level < 0!")
                    end;
               else
                    print("ERROR! Invalid fillType!")
               end;
          end;
     end;
   --End


It sets a random amount of each crop on easy mode, fixed amounts for medium and hard. I'll change these to random amounts also when I finish the map.

User avatar
thunderhawk
Posts: 1452
Joined: Sat Jan 17, 2015 1:02 am

Re: Solo Starting Amount

Postby thunderhawk » Mon Feb 13, 2017 8:55 pm

oh ok
Dell XPS 720 Intel Core 2 Quad Extreme 3.0ghz
Liquid cooled with a 120mm x 240mm radiator twin 120mm cooler master SickleFlow fans
Nvidia GTX 660ti
Patch 1.4.4 Windows 7 home
Playing through a Sanyo 50" tv

masseyharris
Posts: 226
Joined: Tue Nov 15, 2011 10:34 pm

Re: Solo Starting Amount

Postby masseyharris » Mon Feb 20, 2017 3:50 pm

EDIT Oops, I've done it again - I thought I was in the FS17 forum. But I'll leave this post in case it works in FS15 (sorry if it does not, I have not tried it in FS15, this method works in FS17).

Did you know you can also add start amounts into the DefaultVehicles.xml ?

Look at the farmsilosystem in the map i3d, (I think in siloTrigger02) and find the storage name, eg Storage.storage1 or Storage.storage2 etc

Then, using the correct storage name and crop types, add the following lines just before the very last line, being </careerVehicles>

<onCreateLoadedObject saveId="Storage_storage1">
<node fillType="wheat" fillLevel="5000" />
<node fillType="barley" fillLevel="2000" />
<node fillType="oat" fillLevel="3500" />
<node fillType="rape" fillLevel="10000" />
<node fillType="maize" fillLevel="0" />
</onCreateLoadedObject>

rmf304
Posts: 41
Joined: Wed Apr 06, 2016 8:41 pm

Re: Solo Starting Amount

Postby rmf304 » Wed Feb 22, 2017 7:42 am

I did not know that but, it's good to know! I appreciate it.


Return to “[EN-FS15]Modding and media”



Who is online

Users browsing this forum: No registered users and 3 guests