Community Forum

adding new fruits based on grass with windrow

Forum Overview >> Scripting

CategoryScripting
Created25.04.2017 09:56


Charlie Oscar (E516B) 25.04.2017 09:59
Hi,

i managed to add klee as fuittype and as filltype.
Harvest, using the krone Big X 580 and X-Disc 6200 is possible. My problem is that it is not possible to add klee to the categories MOWER and PICKUP.

Windrow does not work with that fruittype. -.- What can i do?

Cheers Chris

Emil Drefers (Unknown) 25.04.2017 15:12
Hi,

have a look at the default map.
Open it with a texteditor and search for "terrainDetailHeight"
You will find something like:
<DetailLayer name="terrainDetailHeight" ....

This line defines the "tipAnything layer".
Windrows use this layer to be dropped onto the ground.

So, you need to increase the value of "heightNumChannels".
Pay attention: adding only one type should be okay, but if you want to add several you need to check the bit depth of the used .png file.
The current should have enough to allow for a few more entries.
Also open and save the map with the GIANTS Editor to make sure the changes worked.

Additionally you need to use
https://gdn.giants-software.com/documentation_scripting.php?version=script&category=68&class=3403#registerDensityMapHeightType46100
to register the new density (tipAny) type in the game.

Finally, register the new fillType (klee_windrow) and add it to the "PICKUP" category by using:
https://gdn.giants-software.com/documentation_scripting.php?version=script&category=68&class=3396#registerFillType46017

Cheers,
Emil



Charlie Oscar (E516B) 18.05.2017 10:48
It doesn´t work.

i tried to integrate Windrow. In my map it was possible to paint as foliage layer, it had textures as i added them to the script.
Ingame the layer was totally black and you could not see anything from the shape of the windrow like it is seen in the Editor. -.-

I edited the terrain as you told me.

Charlie Oscar (E516B) 15.06.2017 11:58
Here is the script i used to register klee as a fruittype.

curModDir = g_currentModDirectory;
--angles
local wheatAngle = FillUtil.fillTypeNameToDesc.wheat.maxPhysicalSurfaceAngle;
local uiScale = g_gameSettings:getValue("uiScale");
local levelIconWidth, levelIconHeight = getNormalizedScreenValues(16*uiScale, 20*uiScale);
--FruitUtil.registerFruitTypeGrowth("rye", 8, 7, 24000000, true, -1, 0);
--FruitUtil.registerFruitTypeGrowth("onion", 8, 7, 24000000, true, -1, 0);
--FruitUtil.registerFruitTypeGrowth("carrot", 8, 7, 24000000, true, -1, 0);
FruitUtil.registerFruitTypeGrowth("klee", 4, 4, 36000000, true, 1, FruitUtil.GROUND_TYPE_GRASS);

-- klee
local hudFile = Utils.getFilename("fillPlanes/hud_fill_klee.dds", curModDir);
local hudFileSmall = Utils.getFilename("fillPlanes/hud_fill_klee_sml.dds", curModDir);
local diffuseMap = Utils.getFilename("fillPlanes/klee_diffuse.dds", curModDir);
local normalMap = Utils.getFilename("fillPlanes/klee_normal.dds", curModDir);
local distanceMap = Utils.getFilename("fillPlanes/distance/kleeDistance_diffuse.dds", curModDir);
local index = FruitUtil.registerFruitType("klee", g_i18n:getText("klee"), FillUtil.FILLTYPE_CATEGORY_BULK, false, true, false, 0, false, 2, 3, 1, false, 0.045, 4.37, 0.03, true, hudFile, hudFileSmall, true, 0.00041, wheatAngle, true, 3);

--FruitUtil.registerFruitTypeWindrow("klee_windrow", g_i18n:getText("klee_windrow"), FillUtil.FILLTYPE_CATEGORY_WINDROW, 0.045, 4.37, true, hudFile, hudFileSmall, true, 0.00041, wheatAngle, true, 3);
-- print("\\__ Register fruit klee_windrow");
-- FruitUtil.setFruitTypeWindrow(index, FillUtil.FILLTYPE_CATEGORY_WINDROW, 7);
-- FruitUtil.addFruitTypeToCategory(FruitUtil.FRUITTYPE_CATEGORY_PICKUP, index);
FruitUtil.addFruitTypeToCategory(FruitUtil.FRUITTYPE_CATEGORY_MOWER, 14);
FruitUtil.addFruitTypeToCategory(FruitUtil.FRUITTYPE_CATEGORY_DIRECTCUTTER, 14);
FruitUtil.addFruitTypeToCategory(FruitUtil.FRUITTYPE_CATEGORY_SOWINGMACHINE, 14);
FillUtil.addFillTypeToCategory(FillUtil.FILLTYPE_CATEGORY_FORAGEHARVESTER, FillUtil.FILLTYPE_KLEE);
-- FillUtil.addFillTypeToCategory(FillUtil.FILLTYPE_CATEGORY_COMBINE, FillUtil.FILLTYPE_KLEE);
FillUtil.addFillTypeToCategory(FillUtil.FILLTYPE_CATEGORY_AUGERWAGON, FillUtil.FILLTYPE_KLEE);
FillUtil.addFillTypeToCategory(FillUtil.FILLTYPE_CATEGORY_FORAGEWAGON, FillUtil.FILLTYPE_KLEE);
TipUtil.registerDensityMapHeightType(FillUtil.FILLTYPE_KLEE, math.rad(35), 0.35, 0.10, 0.10, 1.20, 6, false, diffuseMap, normalMap, distanceMap);
FillUtil.registerFillTypeInFoodGroup(AnimalUtil.ANIMAL_SHEEP, 1, FillUtil.FILLTYPE_KLEE);
FillUtil.registerFillTypeInFoodGroup(AnimalUtil.ANIMAL_COW, 1, FillUtil.FILLTYPE_KLEE);
-- g_currentModDirectory:addFillTypeOverlay(FillUtil.FILLTYPE_RYE, hudFileSmall, levelIconWidth, levelIconHeight);
print("\\__ Register fruit klee");

All works fine, i can harvest it with the Krone Big X 580 in combination with the XDisc 6200.

And here is what i scripted like you told me to do!

TipUtil.registerDensityMapHeightType("klee_windrow", 20, 1, 0.08, 0, 0.08, 1, true, "foliage/klee_windrow_diffuse.dds", "foliage/klee_windrow_normal.dds", "fillPlanes/distance/kleeDistance_diffuse.dds")

FillUtil.registerFillType("klee_windrow", g_i18n:getText("klee_windrow"), FillUtil.FILLTYPE_CATEGORY_WINDROW, 1, true, "foliage/hud_fill_klee.dds", "foliage/hud_fill_klee_sml.dds", 0.05, 20)

FruitUtil.addFruitTypeToCategory(FruitUtil.FRUITTYPE_CATEGORY_PICKUP, 14);

Jacquinot Bertrand (MavericKJacK) 18.08.2017 16:00
Hi,

I have the same problem, i can't cut my alfalfa, I put the line in the register look like klee but when i want tu cut with the mower, nothing happens....
I just can get the crop with the Krone big X 580 with XDisc 6200.

Cheers,
Jack.

Richie Richie (rtwj2014) 19.08.2017 14:02
Did you guys use the additional map types to register the new grass?
I am also looking to add new grass for windrow to be cut with the mower

Jacquinot Bertrand (MavericKJacK) 19.08.2017 15:15
I didn't use the additionnal map types ti register the alfalfa. Actually i think it's impossible to cut an other fruit like grass with mower without an addtitionnal scipts look like the multimowing on fs15.

Richie Richie (rtwj2014) 19.08.2017 16:15
Oh ok. It sucks they made it harder to add new mowable fruits to a map. Would be nice to be able to mow alfalfa

Charlie Oscar (E516B) 26.08.2017 18:43
Nope i did not use the additional Maptypes Script. Dont like it, is too much useless crap implemented in this script.

That totally sucks. -.-


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