Community Forum

Questions about cows and fruit types

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created28.12.2010 12:53


Pierre S (unknown) 28.12.2010 12:54
Hi !!

- I want to do an action only if there are cows to buy.
What is the variable?
I tried : "if g_currentMission.missionInfo.numCows > 1 then " but this variable don't work !!

- When i create a new fruit, in careerSavegame.xml, farmsiloamount for my new fruit quantity is saved instead of DRYGRASS !

i create a new file with:

local hudFile = Utils.getFilename("mods/scriptLPP/carrotHUD.png", getUserProfileAppPath());
FruitUtil.registerFruitType("carrot", false, false,true,4,0,1.3,0.01,0.5,hudFile);

should I add something?

- by which i can replace:
getUserProfileAppPath() .. "savegame"..gameMenuSystem.quickPlayMenu.selectedIndex; ??

Because quickplaymenu is changed in FS2011 !!

Best regards






Stefan Geiger - GIANTS Software 03.01.2011 10:46
- The value of numCows only stores the value that was stored in the savegame when loading the game. You should use AnimalHusbandry.getNumberOfAnimals() to get the current number of cows.

- The registerFruitType call looks correct. Getting the filename also is ok. There however is a more robust way against mod renaming and copy pasting to do this:
local hudFile = g_currentModDirectory.."carrotHUD.png".

However I don't really understand what the issue is. Is the amount of the drygrass value in the xml the amount of carrots?
Is there also an entry with the carrots? The new fruit type is only stored as soon as there is something in the silo, or there was something and you emptied it.

- The current savegame index is now accessible with:
g_careerScreen.selectedIndex

Dirk Peeters (jengske_BE) 26.10.2012 09:24
hi
for fs2013 to what i must change AnimalHusbandry.getNumberOfAnimals()

local cowsStored = AnimalHusbandry.getNumberOfAnimals();

error i got in farmsim2013
attempt to call field 'getNumberOfAnimals all nill

that would be the main trigger problem i c now, registerfruitscript is also working in 2013

Dirk Peeters (jengske_BE) 26.10.2012 09:38
hi
for fs2013 to what i must change AnimalHusbandry.getNumberOfAnimals()

local cowsStored = AnimalHusbandry.getNumberOfAnimals();

error i got in farmsim2013
attempt to call field 'getNumberOfAnimals all nill

that would be the main trigger problem i c now, registerfruitscript is also working in 2013


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