Community Forum

FS22 g_fillTypeManager:addFillType

Forum Overview >> Scripting

Created25.11.2021 17:47

Soldierman 25.11.2021 17:47
I'm attempting to add a few new fillTypes using MaizePlus from FS19 as an example. Using the following code to add the fill type is giving me an error message;

g_fillTypeManager:addFillType(fillTypeName, g_i18n:getText(textName), true, price, massPerLiter, heapAngle, hudFile, hudFileSmall, modDirectory, nil, {1, 1, 1}, nil, false)

Error: Running LUA method 'update'.
dataS/scripts/I18N.lua(578) : attempt to call method 'sub' (a nil value)

I've chucked some prints in so I know my script does not get past this addFillType call. I've tried dropping some of the arguments which didn't work, I've also tried printing the g_i18n:getText() result which does return the correct text so I don't think its that.

Is there any documentation on the addFillType function or anyone have an idea what I'm doing wrong?

Thanks in advance

Espen K. (estyx) 05.12.2021 18:54
function FillTypeManager:addFillType(name, title, showOnPriceTable, pricePerLiter, massPerLiter, maxPhysicalSurfaceAngle, hudOverlayFilename, baseDirectory, customEnv, fillPlaneColors, unitShort, palletFilename, economicCurve, diffuseMapFilename, normalMapFilename, specularMapFilename, distanceFilename, prioritizedEffectType, fillSmokeColor, fruitSmokeColor, achievementName, isBaseType) end

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