Deutz 7545 RTS Haferstroh

Herbert61
Posts: 48
Joined: Mon Mar 11, 2013 5:07 pm

Re: Deutz 7545 RTS Haferstroh

Post by Herbert61 »

-- Hafer
print("register fruit type: Hafer");
local oathudFile = Utils.getFilename("map/huds/oatHud.dds", g_currentModDirectory);
FruitUtil.registerFruitType("oat", g_i18n:getText("oat"), true, true, false, 0, 4, 6, 8, 0, 0.35, 1.5, 0.1, true, oathudFile, {0.8, 0.8, 0.8, 1});
FruitUtil.registerFruitTypeWindrow(FruitUtil.FRUITTYPE_OAT, "oat_windrow", g_i18n:getText("straw"), 0.04, 3, false, "dataS2/missions/hud_fill_straw.png");
FruitUtil.fruitTypes.wheat.forageWagonConversionSources[FruitUtil.FRUITTYPE_OAT] = FruitUtil.FRUITTYPE_OAT
local origSowingMachineLoad = SowingMachine.load;
local orig TrailerLoad = Trailer.load;

SowingMachine.load = function (self, xmlFile)
if origSowingMachineLoad ~= nil then
origSowingMachineLoad(self, xmlFile);
end;

for k,v in pairs(self.seeds) do
fruitTypeDesc = FruitUtil.fruitTypes["wheat"];
if v == fruitTypeDesc.index then
table.insert(self.seeds, FruitUtil.fruitTypes["oat"].index);
end;
end
end;
Hab dir mal einen Spoiler von der Hafer.lua gemacht.
Vielleicht hilft es dir weiter.
User avatar
bassaddict
GIANTS Software | Web/Script Programmer
Posts: 11983
Joined: Tue Nov 29, 2011 2:44 pm
Location: ER, DE

Re: Deutz 7545 RTS Haferstroh

Post by bassaddict »

Ups, ich war etwas zu schnell und hab noch was übersehen. Der Hinweis das Haferstroh wie Weizenstroh behandelt werden soll sollte bei beiden Früchten eingetragen werden.
Du musst also auch noch folgende Zeile einfügen:

Code: Select all

FruitUtil.fruitTypes.oat.forageWagonConversionTarget = FruitUtil.FRUITTYPE_WHEAT;
Herbert61
Posts: 48
Joined: Mon Mar 11, 2013 5:07 pm

Re: Deutz 7545 RTS Haferstroh

Post by Herbert61 »

Hallo zusammen

Ich hab endlich Haferstroh !!! *thumbsup*

Einen besonderen Dank verdient bassaddict, der nicht müde wurde, das Problem zu lösen. :hi:
-- Hafer
print("register fruit type: Hafer");
local oathudFile = Utils.getFilename("map/huds/oatHud.dds", g_currentModDirectory);
FruitUtil.registerFruitType("oat", g_i18n:getText("oat"), true, true, false, 0, 4, 6, 8, 0, 0.35, 1.5, 0.1, true, oathudFile, {0.8, 0.8, 0.8, 1});
FruitUtil.registerFruitTypeWindrow(FruitUtil.FRUITTYPE_OAT, "oat_windrow", g_i18n:getText("straw"), 0.04, 3, false, "dataS2/missions/hud_fill_straw.png");
FruitUtil.fruitTypes.wheat.forageWagonConversionSources[FruitUtil.FRUITTYPE_OAT] = FruitUtil.FRUITTYPE_OAT;
FruitUtil.fruitTypes.oat.forageWagonConversionTarget = FruitUtil.FRUITTYPE_WHEAT;

local origSowingMachineLoad = SowingMachine.load;
local orig TrailerLoad = Trailer.load;

SowingMachine.load = function (self, xmlFile)
if origSowingMachineLoad ~= nil then
origSowingMachineLoad(self, xmlFile);
end;

for k,v in pairs(self.seeds) do
fruitTypeDesc = FruitUtil.fruitTypes["wheat"];
if v == fruitTypeDesc.index then
table.insert(self.seeds, FruitUtil.fruitTypes["oat"].index);
end;
end
end;
Wem es interessiert, im Spoiler ist meine Hafer.lua mit der jetzt alles funktioniert.

Ps.: Haferstroh, das schon im Ladewagen ist wird nicht umgewandelt !!! Diesen verkaufen und neuen zulegen und schon geht's.

Also nochmals herzlichen Dank an alle, die mir geholfen haben, damit ich dieses Thema erfolgreich abschließen kann.
Post Reply