Mining results without resource patch?
Posted: Mon Sep 21, 2015 5:38 pm
I was trying to figure out how to place an entity (doesn't need to be on a resource tile) that will effectively mine random result ores from any resource definitions present in other mods, but with a low probability for each (like 1%). I don't think the MiningDrill prototype will work without resource tiles, so I thought maybe an assembler type entity with the recipe that uses stone and has "results = somefunction()"
In that function, I would like to enumerate through base ores and bob's ores (which are all presumably in a resource type array somewhere) and assign probabilities say default = 0.01 (1%) drop rate, and for ores that I know are there and common like copper/iron I would assign a higher drop rate on those. However, that would be potentially a dozen or more results so I am not sure that is the best approach.
Perhaps if I can trick a mining drill into thinking there is a resource by checking every second (via ticks events) and putting an invisible resource layer around the player's position so that the miner is able to be placed, and giving it a really high value so that the "fake resource" never runs out? Then remove all regular resources from the map except maybe oil (although if using the assembler approach it could be a fluid output with a probability).
In that function, I would like to enumerate through base ores and bob's ores (which are all presumably in a resource type array somewhere) and assign probabilities say default = 0.01 (1%) drop rate, and for ores that I know are there and common like copper/iron I would assign a higher drop rate on those. However, that would be potentially a dozen or more results so I am not sure that is the best approach.
Perhaps if I can trick a mining drill into thinking there is a resource by checking every second (via ticks events) and putting an invisible resource layer around the player's position so that the miner is able to be placed, and giving it a really high value so that the "fake resource" never runs out? Then remove all regular resources from the map except maybe oil (although if using the assembler approach it could be a fluid output with a probability).