As said multiple time now... The function don't give item but it add it directly to the inventory, that why you don't have the gather popup notification.
I'll probably change the code to display popup...
GatherManager
Moved
Total Downloads: 59,075 - First Release: Oct 23, 2014 - Last Update: Aug 27, 2017
- 4.93893/5, 131 likes
-
this gives a max of 60-72 with a mining level of 22 depends on what level you are you will get more just that popup we need
Code:private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item) { System.Random rand = new System.Random(); if (!entity.ToPlayer()) return; var player = entity.ToPlayer(); var amount = item.amount; var gatherType = dispenser.gatherType.ToString("G"); if (GatherResourceModifiers.ContainsKey(item.info.displayName.english)) item.amount = (int)(item.amount * GatherResourceModifiers[item.info.displayName.english]); else if (GatherResourceModifiers.ContainsKey("*")) item.amount = (int)(item.amount * GatherResourceModifiers["*"]); if(item.info.displayName.english.Contains("Metal")) { var rands = rand.Next(1, 4); int HQ = 4; if(HQ <= 0) { var gatherRate = 1; if (GatherResourceModifiers.ContainsKey("High Quality Metal Ore")) gatherRate = (int)GatherResourceModifiers["High Quality Metal Ore"]; else if (GatherResourceModifiers.ContainsKey("*")) gatherRate = (int)GatherResourceModifiers["*"]; HQ = 1 * gatherRate; } player.inventory.GiveItem(ItemManager.CreateByItemID(2133577942, HQ), player.inventory.containerMain); } if (!GatherDispenserModifiers.ContainsKey(gatherType)) return; var dispenserModifier = GatherDispenserModifiers[gatherType]; dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount += amount - item.amount / dispenserModifier; if (dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount < 0) item.amount += (int)dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount; }
-
-
y
-
-
won't increase the rate for high Qual
-
Are there any plans for an update to support the changes to nodes?
-
-
-
Last edited by a moderator: Jul 9, 2017
-
So ive just come to realize that once the code was in and working, the gather on the quarry, pickup ore's, and items have stopped working. This just me?
-
how do i do so all the recources is times 3
-
Wulf Community Admin
-
I'm having an issue with helicopters. If I have the ore dispenser at more than 3 then someone can shoot down a helicopter and mine it forever.. but having nodes on 3 means its 3 hits total to remove the entire node so that sucks.. anyone else had this issue or know anything i can do to solve it?
Currently I have these settings :
"Options": {
"GatherDispenserModifiers": {
"Flesh": 4.0,
"Ore": 9.0,
"Tree": 10.0
},
which means helicopters are unlimited to mine -
Hello, after some test and research i'm able to give you the proper way to get gather bonus multiplied by your config.
Here you go :
Code:private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item) { if (!entity.ToPlayer()) return; var gatherType = dispenser.gatherType.ToString("G"); var amount = item.amount; if (GatherResourceModifiers.ContainsKey(item.info.displayName.english)) { foreach(var finishBonusList in dispenser.finishBonus) { finishBonusList.amount = 2 * GatherResourceModifiers[item.info.displayName.english]; } item.amount = (int)(item.amount * GatherResourceModifiers[item.info.displayName.english]); } else if (GatherResourceModifiers.ContainsKey("*")) { foreach(var finishBonusList in dispenser.finishBonus) { finishBonusList.amount = 2 * GatherResourceModifiers["*"]; } item.amount = (int)(item.amount * GatherResourceModifiers["*"]); } if (!GatherDispenserModifiers.ContainsKey(gatherType)) return; var dispenserModifier = GatherDispenserModifiers[gatherType]; dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount += amount - item.amount / dispenserModifier; if (dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount < 0) item.amount += (int)dispenser.containedItems.Single(x => x.itemid == item.info.itemid).amount; }
To all other, if you want to increase the amount, you may change this line :
Code:finishBonusList.amount = 2 * ............
-
ETA for this new hook for bonus and highqual rates ect being added?
-
the bonus seems to be working with the last zLevels update. you'd have to increase the gather rate within the zlevels config though and adjust the gathermanager config.
when i set the resourcemultiplier within zlevels to 10 for Mining, the finishing bonus was around 10x. it was probably a bit more because of the 'on hit' bonus i added as well from above. -
Metal ore nodes are not being modified while gathering it with a metal pickaxe but its fine when gathering with a salvaged pick
Last edited by a moderator: Jul 12, 2017 -
Is there a way to increase all gather rates at the same time or must I do it all manually?
-