Community Forum

New animal pen

Forum Overview >> Farming Simulator 22

CategoryFarming Simulator 22
Created26.02.2022 02:44


Nina Andersen (WolfieeGirl) 26.02.2022 02:44
Hi. I want new animals in my map and I have converted my old Duck pen from fs19. I got the animal pen inside the game and looking good. I also got the animnal shop menu up but the menu is emty and there some wierd characters in there and no duck images, so I can`t buy any. I have tested the pen with chickens and it`s working great. I can see there is 2 errors in the log file..

Error (C:/Users/xxxx/Documents/My Games/Multi_mods2/xxxx/FS22_my map/character/animals.xml): FillType 'DUCK' for animal subtype 'animals.animal(5).subType(0)' not defined!

Error: Could not create animal husbandry!

There is no other errors in the log.

Can someone get me on the right direction? I don`t understand what it means by not defined. I copyed the chickens entry in the animals xml and moved the copy one under the chicken entry.. I only edit the name and adress to my own pictuers and name. By that I mean. Chicken = Duck and so on.
Do I need script for this to work or do I miss something here. I have bean looking and looking but I can`t find anything wrong expet from "not defined"

William Rowe (Bonger76) 26.02.2022 05:05
you need to add them in your "maps_fillTypes.xml" and makes shure it is loading from your map.Find the chickens and copy and change,

<fillType name="DUCK" title="duck" showOnPriceTable="false">
<physics massPerLiter="3.0" maxPhysicalSurfaceAngle="0" />
<economy pricePerLiter="0" />
<image hud ="$dataS/menu/hud/fillTypes/hud_fill_chicken.png" />
</fillType>

you need to make a duck hud .png and makes shure your path is right make a hud folder in map ,you can leave the chicken hud to test and make shure the fillType works.If you whant to have DUCKEGG you will need to add them to the "maps_fillTypes.xml" to.If you do the DUCKEGG you will have to add them to sellpiont.
hope this helps.

Nina Andersen (WolfieeGirl) 26.02.2022 07:17
Thank you William for helping. This was not working. Did not get the shop menu open. The map_fillTypes.xml is is loaded by the map. got new error on this try.. This is how the lines looks like in the maps_fillTypes.xml

<!-- chickens Belongs to game-->
<fillType name="CHICKEN" title="$l10n_fillType_chicken" showOnPriceTable="false">
<physics massPerLiter="3.0" maxPhysicalSurfaceAngle="0" />
<economy pricePerLiter="0" />
<image hud ="$dataS/menu/hud/fillTypes/hud_fill_chicken.png" />
</fillType>
<fillType name="CHICKEN_ROOSTER" title="$l10n_fillType_chicken" showOnPriceTable="false">
<physics massPerLiter="3.0" maxPhysicalSurfaceAngle="0" />
<economy pricePerLiter="0" />
<image hud ="$dataS/menu/hud/fillTypes/hud_fill_chicken.png" />
</fillType>

<!-- duck -->
<fillType name="DUCK" title="duck" showOnPriceTable="false">
<physics massPerLiter="3.0" maxPhysicalSurfaceAngle="0" />
<economy pricePerLiter="0" />
<image hud ="hud/fillTypes/hud_fill_duck.png" />
</fillType>

here is the new errors.

Error (C:/Users/xxx/Documents/My Games/Multi_mods2/FS22_my map/character/animals.xml): Animal index not defined for 'animals.animal(5).subType(0).visuals.visual(0)'

Error (C:/Users/xxx/Documents/My Games/Multi_mods2//FS22_my map/character/animals.xml): Animal index not defined for 'animals.animal(5).subType(0).visuals.visual(1)'

Warning (C:/Users/xxx/Documents/My Games/Multi_mods2/FS22_my map/character/animals.xml): No visuals defined for 'animals.animal(5).subType(0)'

after seeing this I asume there is something to to with the animals.xml file, but I don`t know what.

Here is the lines from the animals.xml file.

<animal type="CHICKEN" statsBreeding="breedChickenCount" clusterClass="AnimalCluster">
<configFilename>$dataS/character/animals/domesticated/chicken/animals.xml</configFilename>

<subType subType="CHICKEN" fillTypeName="CHICKEN" >
<visuals>
<visual minAge="0" visualAnimalIndex="1" name="$l10n_shopItem_animalChicken" image="$dataS/character/animals/domesticated/chicken/store_chickenHen.png" canBeBought="true">
<description>$l10n_shopItem_animalChickenDescription</description>
</visual>
<visual minAge="6" visualAnimalIndex="1" name="$l10n_shopItem_animalChicken" image="$dataS/character/animals/domesticated/chicken/store_chickenHen.png" canBeBought="true">
<description>$l10n_shopItem_animalChickenDescription</description>
</visual>
</visuals>
<reproduction minAgeMonth="6" durationMonth="2" minHealthFactor="0.75" />
<buyPrice>
<key ageMonth="0" value="5" />
<key ageMonth="6" value="50" />
</buyPrice>
<sellPrice>
<key ageMonth="0" value="2" />
<key ageMonth="6" value="25" />
</sellPrice>
<transportPrice>
<key ageMonth="0" value="1" />
<key ageMonth="6" value="5" />
</transportPrice>
<input>
<food><!-- liters per day based on age -->
<key ageMonth="0" value="5" />
</food>
</input>
<output>
<pallets><!-- liters per day based on age -->
<key ageMonth="0" value="0" />
<key ageMonth="0" value="0" />
<key ageMonth="6" value="10" />
</pallets>
</output>
</subType>
<subType subType="CHICKEN_ROOSTER" fillTypeName="CHICKEN_ROOSTER" >
<visuals>
<visual minAge="0" visualAnimalIndex="2" name="$l10n_shopItem_animalChickenRooster" image="$dataS/character/animals/domesticated/chicken/store_chickenRooster.png" canBeBought="true">
<description>$l10n_shopItem_animalChickenDescription</description>
</visual>
</visuals>
<reproduction supported="false" />
<buyPrice>
<key ageMonth="0" value="5" />
<key ageMonth="6" value="50" />
</buyPrice>
<sellPrice>
<key ageMonth="0" value="2" />
<key ageMonth="6" value="20" />
</sellPrice>
<transportPrice>
<key ageMonth="0" value="1" />
</transportPrice>
<input>
<food>
<key ageMonth="0" value="5" />
</food>
</input>
</subType>
</animal>

<animal type="DUCK" statsBreeding="breedDuckCount" clusterClass="AnimalCluster">
<configFilename>character/duck/duckAnimalHusbandry.xml</configFilename>

<subType subType="DUCK" fillTypeName="duck" >
<visuals>
<visual minAge="0" visualAnimalIndex="1" name="$l10n_shopItem_animalDuck" image="store/animals/store_store_duckWhite.png" canBeBought="true">
<description>$l10n_shopItem_animalDuckDescription</description>
</visual>
<visual minAge="6" visualAnimalIndex="1" name="$l10n_shopItem_animalDuck" image="store/animals/store_store_duckWhite.png" canBeBought="true">
<description>$l10n_shopItem_animalDuckDescription</description>
</visual>
</visuals>
<reproduction minAgeMonth="6" durationMonth="2" minHealthFactor="0.75" />
<buyPrice>
<key ageMonth="0" value="5" />
<key ageMonth="6" value="50" />
</buyPrice>
<sellPrice>
<key ageMonth="0" value="2" />
<key ageMonth="6" value="25" />
</sellPrice>
<transportPrice>
<key ageMonth="0" value="1" />
<key ageMonth="6" value="5" />
</transportPrice>
<input>
<food><!-- liters per day based on age -->
<key ageMonth="0" value="5" />
</food>
</input>
<output>
<pallets><!-- liters per day based on age -->
<key ageMonth="0" value="0" />
<key ageMonth="0" value="0" />
<key ageMonth="6" value="10" />
</pallets>
</output>
</subType>
</animal>

I know this may be to much to read but I don`t know what else to do, I hope you can help.



William Rowe (Bonger76) 26.02.2022 17:57
Looks like the fillType worked you did not get that error."<subType subType="DUCK" fillTypeName="duck" >" you need to cap the" DUCK"in fillTypeName.Now I have never added animal types to A map but I think the problems is " name="$l10n_shopItem_animalDuck" " the game is looking to load this from the game thier is no animalDuck in the game " $l10n_shopItem " not shure but would start by changing the
" name="$l10n_shopItem_animalDuck" to " name="shopItem_animalDuck" same in the "<description>$l10n_shopItem_animalDuckDescription</description>" to"<description>shopItem_animalDuckDescription</description>" .not shure if you have to add the name to your map modDesc.xml like this

<l10n>
<text name="shopItem_animalDuck"> <en>Duck</en> <de></de> <fr></fr> </text>
<text name="shopItem_animalDuckDescription"> <en>DuckDescription</en> <de></de> <fr></fr> </text>
</l10n>

Dont think you would need to do this,you could change the name back to " $l10n_shopItem_animalChicken " your duck .png should load and you should get ducks is in game if it loads you duck character,sorry if none of this helps like I said above never add new animal type to A map.

Nina Andersen (WolfieeGirl) 27.02.2022 04:33
Yes I fixed the fillType problem and my png`s also working but I can`t get around tofix the duck problem. no matter what I do I can`t get them in the game. I did like you say but that don`t work ether. My lastest error is (in short term)

Error: my map/character/animals.xml): Animal index not defined for 'animals.animal(5).subType(0).visuals.visual(0)

If I change the name duck to chicken in the duckHusbandryLarge.xml for my pen and use the chicken entry in the animals.xml I get chicken in my duck pen, so the pen is working. but as soon as I change back to duck again, I don`t get the animal shop menu to open. and I get the errors.

So I don`t know, But I guessing some script or something is needed for this. it was much easier in 19 than 22 for sure. Ether that or I am missing something in the lines. So I`m stuck for now.

it says Animal index, I asume it means this line visualAnimalIndex="1" but I don`t know what to do with it.

Thank you for your help William.

William Rowe (Bonger76) 27.02.2022 06:17
If you are only getting the one error then you got it right in the second visualAnimalIndex="1" what I think the way the error is defined is this ,from the first errors you got

Error (C:/Users/xxx/Documents/My Games/Multi_mods2/FS22_my map/character/animals.xml): Animal index not defined for 'animals.animal(5).subType(0).visuals.visual(0)' this error is for this part

<visuals>

<visual minAge="0" visualAnimalIndex="1" name="$l10n_shopItem_animalDuck" image="store/animals/store_store_duckWhite.png" canBeBought="true">
<description>$l10n_shopItem_animalDuckDescription</description>
</visual>

Error (C:/Users/xxx/Documents/My Games/Multi_mods2//FS22_my map/character/animals.xml): Animal index not defined for 'animals.animal(5).subType(0).visuals.visual(1)' this one is for this part

<visual minAge="6" visualAnimalIndex="1" name="$l10n_shopItem_animalDuck" image="store/animals/store_store_duckWhite.png" canBeBought="true">
<description>$l10n_shopItem_animalDuckDescription</description>
</visual>

</visuals>
the (0) is the first part of visuals section the(1) is the second part.if your not getting the second error compare the line and see if thier is any differents.The errors are comeing from this section.You might whant to post the problem and errors on the other farmsim modforum
https://forum.giants-software.com/viewforum.php?f=478

Nina Andersen (WolfieeGirl) 01.03.2022 14:35
After some days of working I finally got the duck in the animal shop menu. I can buy them and sell them. BUT. I can`t see them in the pen. I have tried this with the chickens and they work and I can see them but not the ducks. No duck and no sound. The only error I get now is

Error: Can`t creat duck husbandry. So thee has to be something with the duckHusbandry.xml I think. I`m so close now. I don`t give up :)

Again, Thank you William

Juraj Fid (Paprikant) 20.09.2022 22:15
Nina Andersen (WolfieeGirl)
help my
to same problems this my map


Bilbo Beutlin (BBeutlin) 25.09.2022 05:39
For "how to" examples download and examine the map "Hof Bergmann".


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