Tutorial ( Neue Farming Routen 4.4 Hinzufügen)
Tutorial by Shinji
____________________________________________________________________________________
Ein Item erstellen bzw. 2 stück
class gummiu {
variable = "gummiu";
displayName = "STR_Item_Rock"; << ich hoffe da weißt wie es geht :)
weight = 3;
buyPrice = -1;
sellPrice = 25;
illegal = false;
edible = -1;
icon = "";
};
class gummip {
variable = "gummip";
displayName = "STR_Item_CementBag"; << ebenfalls bitte Strngtable schauen :)
weight = 2;
buyPrice = -1;
sellPrice = 590;
illegal = false;
edible = -1;
icon = "";
};
Alles anzeigen
Eine lizenz erstellen, um das später zu processen
class gummiprocess {
variable = "gummiprocess";
displayName = "STR_License_Cement"; << wie immer schön Strings machen
price = 6500;
illegal = false;
side = "civ";
};
Einmal in die gather.sqf wechseln -> sollte unter core\actions\ zu finden zu sein
dort finden wir folgendes vor:
_resourceZones = ["apple_1","apple_2","apple_3","apple_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_1","weed_1"];
switch(true) do {
case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = ["apple",3];};
case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = ["peach",3];};
case (_zone in ["heroin_1"]): {_gather = ["heroin_unprocessed",1];};
case (_zone in ["cocaine_1"]): {_gather = ["cocaine_unprocessed",1];};
case (_zone in ["weed_1"]): {_gather = ["cannabis",1];};
default {""};
};
Da tragen wir einfach eine neue Zone ein unter der case (_zone in["weed1"....
Nicht vergessen auch in der "_resourceZones" Eintragen!
case (_zone in ["gummi"]): {_gather = ["gummiu",1];};
erklärung:
_zone gummi -> Marker Name der auf der Karte zu sehen is
_gather gummiu 1 -> du bekommst 1 unprocessed gummi dort
Allein damit könnte man schon farmen gehen, zwar nicht verkaufen, aber hey Farmen
[/b]
Tragen wir also das Item mal noch in einen Shop ein -> Config_vItem.hpp
class market {
name = "STR_Shops_Market";
side = "civ";
license = "";
level[] = { "", "", -1, "" };
items[] = { "waterBottle", "rabbit", "apple", "redgull", "tbacon", "lockpick", "pickaxe", "fuelFull", "peach", "boltcutter", "storagesmall", "storagebig", "rabbit_raw", "hen_raw", "rooster_raw", "sheep_raw", "goat_raw" };
};
und fügen hinter "goat_raw" einfach noch ein Komma "gummip" ein
class market {
name = "STR_Shops_Market";
side = "civ";
license = "";
level[] = { "", "", -1, "" };
items[] = { "waterBottle", "rabbit", "apple", "redgull", "tbacon", "lockpick", "pickaxe", "fuelFull", "peach", "boltcutter", "storagesmall", "storagebig", "rabbit_raw", "hen_raw", "rooster_raw", "sheep_raw", "goat_raw", "gummip" };
};
Alles anzeigen
Nun könnte man das processed item verkaufen. Fehlt das Processen... core\actions\processAction.sqf
wir finden:
_itemInfo = switch (_type) do {
case "oil": {["oil_unprocessed","oil_processed",1200,(localize "STR_Process_Oil")];};
case "diamond": {["diamond_uncut","diamond_cut",1350,(localize "STR_Process_Diamond")];};
case "heroin": {["heroin_unprocessed","heroin_processed",1750,(localize "STR_Process_Heroin")];};
case "copper": {["copper_unrefined","copper_refined",750,(localize "STR_Process_Copper")];};
case "iron": {["iron_unrefined","iron_refined",1120,(localize "STR_Process_Iron")];};
case "sand": {["sand","glass",650,(localize "STR_Process_Sand")];};
case "salt": {["salt_unrefined","salt_refined",450,(localize "STR_Process_Salt")];};
case "cocaine": {["cocaine_unprocessed","cocaine_processed",1500,(localize "STR_Process_Cocaine")];};
case "marijuana": {["cannabis","marijuana",500,(localize "STR_Process_Marijuana")];};
case "cement": {["rock","cement",350,(localize "STR_Process_Cement")];};
default {[];};
};
Alles anzeigen
und fügen wieder unter dem letzten eintrag aber ÜBER default -> also unter -> case "cement" ...
case "gummi": {["gummiu","gummip",90,(localize "STR_Process_Cement")];}; << wieder darauf achten das die Stringtable passt.
Erklärung:
case gummi -> ist die Action die vom NPC auf der KArte komme.
gummiu , gummip , 90 -> von unprocessed gummi zu processed ohne lizenz kostet es 90$ pro item
Nun sollte nur noch der Marker fehlen der "gummi" genannt wird.
Dann noch der Processtyp ->
In der init eines NPC`s
this enableSimulation false; this allowDamage false;
this addAction[localize "STR_MAR_Process_Rock",life_fnc_processAction,"gummi",0,false,false,"",' life_inv_gummiu > 0 && !life_is_processing'];
this addAction[format["%1 ($%2)",localize (getText(missionConfigFile >> "Licenses" >> "gummiprocess" >> "displayName")), [(getNumber(missionConfigFile >> "Licenses" >> "gummiprocess" >> "price"))] call life_fnc_numberText],life_fnc_buyLicense,"gummiprocess",0,false,false,"",' !license_civ_gummiprocess && playerSide == civilian '];
Okay das sollte es gewesen sein!
Viel Spaß mit dem Farming Routen & natürlich beim Farmen!
Ein Großes Dankeschön geht nochmals an @Shinji für sein Tutorial!
MfG John_Parker