Hey, ich hätte eine frage, ich habe eine neue Farm Möglichkeit eingefügt, nun wollte ich gerne wissen, ob es eine Möglichkeit gibt, 2 verschiedene Gegenstände zu sammeln. Also ich meine das jetzt prozentual, dass bsp. die haupt Ressource Erz ist, man aber eine 2% chance hat titan zu bekommen oder so. Ich hoffe ihr habt es verstanden, ist vill. ein bisschen doof formuliert
hoffe ihr könnt mir da helfen. Mfg.
Farmoption
-
Ling Ling -
1. April 2016 um 08:16 -
Geschlossen
Hinweis zur Zukunft von Nodezone
Das neue Nodezone befindet sich in der finalen Entwicklungsphase. Mit dem geplanten Start wird das bisherige Forum auf Read Only umgestellt und künftig als Archiv erhalten bleiben.
Alle Informationen zur neuen Plattform, zur Accountübernahme und zum weiteren Ablauf findest du hier: Zum aktuellen Nodezone Beitrag
Das neue Nodezone befindet sich in der finalen Entwicklungsphase. Mit dem geplanten Start wird das bisherige Forum auf Read Only umgestellt und künftig als Archiv erhalten bleiben.
Alle Informationen zur neuen Plattform, zur Accountübernahme und zum weiteren Ablauf findest du hier: Zum aktuellen Nodezone Beitrag
-
-
Hi, da hänge ich mich gerne mit dran, würde mich auch interessieren.
-
Ich schreibgleich flott was aber ka ibs klappt.
-
sehr nett von dir, vielen dank und ich hoffe es ist so einiger maßen klar geworden. Man farmt also eine Ressource und hat eine chance stattdessen eine andere zu bekommen

-
Code
Alles anzeigen/* File: fn_gather.sqf Author: Bryan "Tonic" Boardwine Description: Main functionality for gathering. */ if(isNil "life_action_gathering") then {life_action_gathering = false;}; private["_gather","_itemWeight","_diff","_itemName","_val","_resourceZones","_zone","_chance"]; _resourceZones = ["moebel_1","apple_1","uran_1","apple_2","apple_3","apple_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_2","weed_1","uran_1","amphe_2_1","raps_1"]; _zone = ""; if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming. life_action_gathering = true; //Find out what zone we're near { if(player distance (getMarkerPos _x) < 30) exitWith {_zone = _x;}; } foreach _resourceZones; if(_zone == "") exitWith { life_action_inUse = false; }; _chance = round(random(100)); //Get the resource that will be gathered from the zone name... switch(true) do { case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = "apple"; _val = round(random(10));}; case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = "peach"; _val = round(random(10));}; case (_zone in ["heroin_1"]): {_gather = "heroinu"; _val = round(random(10));}; case (_zone in ["cocaine_2"]): {_gather = "cocaine"; _val = round(random(10));}; case (_zone in ["weed_1"]): {_gather = "cannabis"; _val = round(random(10));}; case (_zone in ["amphe_2_1"]): {_gather = "methu"; _val = round(random(10));}; case (_zone in ["raps_1"]): {_gather = "rapsu"; _val = round(random(10));}; case (_zone in ["uran_1"]): {_gather = "uranu"; _val = round(random(10));}; case (_zone in ["moebel_1"]): {_gather = "moebelu"; _val = round(random(10));}; default {""}; }; //gather check?? if(vehicle player != player) exitWith {}; if(_chance < 50 && _gather == "Deins") then { _gather = "DasNeue"; _val = round(random(10)); }else{ _gather = "DasAlte"; _val = round(random(10)); }; _diff = [_gather,_val,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff; if(_diff == 0) exitWith {hintSilent localize "STR_NOTF_InvFull"}; life_action_inUse = true; for "_i" from 0 to 2 do { player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";}; sleep 2.5; }; if(([true,_gather,_diff] call life_fnc_handleInv)) then { _itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr; titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"]; }; life_action_inUse = false;
Ka obs so geht einfach mal testen. -
Super dankeschön, werde es gleich mal testen, könntest du mir vill nur kurz erklären wie das funktioniert? Wäre sau nett von dir.
-
_chance = round(random(100));
if(_chance < 50 && _gather == "Deins") then {
_gather = "DasNeue";
_val = round(random(10));
}else{
_gather = "DasAlte";
_val = round(random(10));
}; -
Also das 1 gather ist das wo der extra ding kommen soll..
gather2 ist dann welches extra kommen soll und gather 3 ist das selbe wie beim 1. -
Danke, werd es auch mal testen.
-
Dankeschön Risk, für die schnelle Hilfe und die Erklärung, sehr nett von dir!
-
nox
25. März 2023 um 00:47 Hat das Thema aus dem Forum Hilfeforum - ArmA 3 nach Archiv verschoben.