Community Forum

adding cheese filltype

Forum Overview >> Scripting

CategoryScripting
Created27.10.2019 02:21


John Bailey (Unknown) 27.10.2019 02:21
hi
sorry for the length of this post but again I am having quite some troubles and have spent a week trying to sort this eventually deciding to ask for help

so,
I have added in a cheese factory v 1.0 in which you add milk and it creates cheese which you can then sell at a sale point, i have added it through global company and it all works producing pallets of cheese, which is good, I have used the following method of adding the mod using Global Company; (i wrote this out myself)

1. make folders 'store' and 'scripts' in main folder
2. copy GC_Checker.lua to folder 'scripts' also copy xml for the mod into this folder.
3. copy store.dds to 'store' folder and rename to mod
4. copy l10n_en.xml to main folder or any other language, copy all languange files to l10n
5. add textures and particle system and sounds from mod to maps folder
6. add to map moddesc from mod moddesc from 'extraSourceFiles' to 'globalCompany' add below 'multiplayer' then change sourcefile filename to scripts/GC_Checker.lua
7. copy i3d and i3dshapes to 'maps' section of modmap
8. check errors for i3d files and fix
9. import mods into map
10. select GC mod add the following attributes

<Attribute name="farmlandId" type="integer" value="3"/> (3 is the number of the land area)
<Attribute name="indexName" type="string" value="SystemTec_MixMaker"/> (must match "indexname" in xml)
<Attribute name="onCreate" type="scriptcallback" value="GC_ProductionFactory.onCreate"/>
<Attribute name="xmlFile" type="string" value="scripts/SystemTecCowMixMaker.xml"/> (points to xml)

11. save map, / ?seasons map
12. open xml, remove from "storedata" to "productionFactories" leaving in productionFactories
13.replace "placeable" top and bottom to "globalCompany"
14. go to l10n add map name to beginning of each eg
<e k="HoT_baleStorages_baleStorageQ_HS_FactoryName" v="Hay & Straw Bale Storage (Quarder)"/> becomes <e k="OakenShaw_HoT_baleStorages_baleStorageQ_HS_FactoryName" v="Hay & Straw Bale Storage (Quarder)"/>
do the same in the mod xml file
15. change imagefilename (.dds) store/TMR.dds
16. change particlesystem file location if required
17. delete i3d and i3dscripts
18. cross fingers, try map

i have added the following into the custom filltypes;
<fillType name="CHEESE" title="$l10n_fillType_cheese" showOnPriceTable="true" pricePerLiter="1.0" >
<image hud="maps/newFruits/hud/hud_fill_cheese.png" hudSmall="maps/newFruits/hud/hud_fill_cheese_sml.png" />
<physics massPerLiter="1.0" maxPhysicalSurfaceAngle="0" />
</fillType>

and added cheese into the 'piece' section

everything works and is right except the output section of my cheese factory which show 'missing "filltype_cheese" in L10n_en.xml'
in the global company errors it suggests 'Warning: the following text entries loaded from C:/users/john/documents/mygames/farmingsimulator19/mods/brancepeth/l10n_en.xml do not have the required prefix or subprefix
'brancepeth'! please add this.
1:fillType_cheese

I have attempted to do this in the l10n_en.xml in every way I can think of, the beginning lines being from the l10n_en.xml from the cheese factory mod origianlly, I have noticed there is no output here but when I have tried to add it, then the output part stops working;

<e k="brancepeth_Baeckerei_FactoryName" v="Cheese"/>
<e k="brancepeth_Baeckerei_FactoryDescription" v="This Factory makes Cheese from Milk."/>
<e k="brancepeth_Baeckerei_ProductLine" v="Cheese Production"/>
<e k="brancepeth_Baeckerei_Input" v="Milk"/>

attempting to add the filltype_cheese below are my attempts

<text name="fillType_cheese" text="Cheese"/>
<text name="brancepeth_fillType_cheese" text="Cheese"/>
<text name="fillType_CHEESE" text="Cheese"/>
<text name="brancepeth_fillType_CHEESE" text="Cheese"/>
<text name="fillType_brancepeth_cheese" text="Cheese"/>
<text brancepeth_name="fillType_cheese" text="Cheese"/>
<text name="fillType_cheese" />

<e k="fillType_cheese" v="Cheese" />
<e k="brancepeth_fillType_cheese" v="Cheese" />



<text name="cheese" >
<en>cheese</en>
<de>cheese</de>
</text>




<text name="brancepeth_cheese" >
<en>cheese</en>
<de>cheese</de>
</text>

<text name="fillType_cheese" >
<en>cheese</en>
<de>cheese</de>
</text>

<text name="brancepeth_fillType_cheese" >
<en>cheese</en>
<de>cheese</de>
</text>

<text name="brancepethfillType_cheese" >
<en>cheese</en>
<de>cheese</de>
</text>

none of these work and I still have the incorrect title on the output section of the mod through global company

please help, this is driving me crazy again, thanks

Bilbo Beutlin (BBeutlin) 27.10.2019 08:08
These localization issues have been reported multiple and though Giants has announced to fix these bugs, also the patchnotes to 1.5 report localization fixes, it's obviously still faulty.
The same errors occur with transportMissions.xml and some other.

Perhaps it works if adding the localization texts by LUA script instead XML, but I didn't try yet.

So far use fixed strings instead localized "$l10n_text".

John Bailey (Unknown) 27.10.2019 11:46
thankyou for the reply

would it be possible for you to give me some guidance in how to do these things? I think i have almost reached my limit at this coding and have never edited LUA.
the fixed strings sounds good but again Im not sure how to do this

thanks again

Bilbo Beutlin (BBeutlin) 27.10.2019 12:08
With 'fixed string' I mean eg.
<fillType name="CHEESE" title="Cheese" ..
Of course this doesn't get translated, so you should use a common known language, preferably English.

For inserting strings by LUA one should use the functions of 'g_i18n', a support for localization. Since it isn't documented, one has to find out the right functions at first. Not recommanded for beginners. ;)

John Bailey (Unknown) 27.10.2019 12:33
Thanks again, I understand what you mean now.
Do I put the fixed string into the l10n_en.xml or somewhere else?
I think I will stay clear of the LUA on your advice haha thanks

Bilbo Beutlin (BBeutlin) 27.10.2019 13:14
A fixed string doesn't need an entry in any l10n table. It is taken "as it is".

About linkage with GC see GC documentation and examples. I'd assume the fillType name (not title) is expected (only guessing).

John Bailey (Unknown) 28.10.2019 01:15
thank you again, your help and support is invaluable

for anyone wondering how i got it to work I did the following;

Ill be honest i wasnt sure what you meant so I experimented with what you suggested,

after a few minutes I changed

<fillType name="CHEESE" title="$l10n_fillType_cheese" showOnPriceTable="true" pricePerLiter="1.0" >
<image hud="maps/newFruits/hud/hud_fill_cheese.png" hudSmall="maps/newFruits/hud/hud_fill_cheese_sml.png" />
<physics massPerLiter="1.0" maxPhysicalSurfaceAngle="0" />
</fillType>

to

<fillType name="CHEESE" title="cheese" showOnPriceTable="true" pricePerLiter="1.0" >
<image hud="maps/newFruits/hud/hud_fill_cheese.png" hudSmall="maps/newFruits/hud/hud_fill_cheese_sml.png" />
<physics massPerLiter="1.0" maxPhysicalSurfaceAngle="0" />
</fillType>

there was no need to change anything in the l10n_en.xml
I know this is probably exactly what you meant and I may look like a fool but just wanted to share and say thanks


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