Community Forum

Initial number of cows

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created19.11.2010 18:22


Thore Wietzke (Thore) 19.11.2010 18:32
I tried to change this UserAttribute.
I had increase the value, f.e. on 5.
Then I started a new game. All was how I wanted (I've got 5 cows at the beginning).
I saved that game to change something on the map. But then I started the savegame, I had got 10 cows! That is a problem for me, because I want to start with the cows, without combine, to feed them. How I can fix that?

Stefan Geiger - GIANTS Software 20.11.2010 16:32
You can do this by changing the numCows attribute of the missionInfo.

One possibility is to create a mission event listener (as in the ExtraFile.lua of the sampleMod) and add the following code in the loadMap function:

if not g_currentMission.missionInfo.isValid then
-- this is a new savegame, so change the number of cows
g_currentMission.missionInfo.numCows = 5;
end;

Thore Wietzke (Thore) 20.11.2010 18:08
thank you! it works great!

Torsten Pfau (unknown) 28.11.2010 06:22
I´have taken the extraFile.lua from samplemod and add the these lines for my sampleModMap like this:
...
function modClassEventListener:loadMap(name)
self.loadedMap = name;
print("map " .. self.loadedMap .. " was loaded");

if not g_currentMission.missionInfo.isValid then
-- this is a new savegame, so change the number of cows
g_currentMission.missionInfo.numCows = 8;
end;
end;
function modClassEventListener:deleteMap()
...
and the extraSourceFiles- code in modDesc before <maps>.
Now i have 8 cows on original- map and on every modmap with or without changing the userattributes value. It´s funny but i only want to have the cows on my map because it´s less work to do.:-)

Update with a second and third question: something must be wrong because i have tried to add a wka from 09 and it works but when i run the game once again it is deleted from map!?
Why are no more wka´s in 11 and what is the problem with the windmill.wav- can´t load resource even if i add only wka without creating an audi resource. I wonder becaue no sounds appears in i3d.
Hope for answer and thanks before.


Note: Log in to post. Create a new account here.