1. So after seeming to have some issues with placking pumpjacks to get oil out I did some more experimenting, It seems as if they have replaced the oil deposits in the game mechanics but just dont have it pop with a survay charge.... this is really messing with some things on my server. So Im asking if anyone can make an addon that no mater what make it where when using a pump jack 1 lowgrade = 1 crude oil?
    [DOUBLEPOST=1460722528,1460498951][/DOUBLEPOST]I need some help. I place pumpjacks at places like the airfield and places around the map and I find that there is places when its taking 4 low grade to get 1 crude. Im just looking for something like:

    If pumpjack then crude oil
    1 lowgrade produces 1 crudeoil
    [DOUBLEPOST=1460929350][/DOUBLEPOST]Is anyone able to work on this? I am willing to donate to get this done/moved up on a scripters que!
     
  2. I would be interested in supporting the development of this plugin as well.
     
  3. There was one developer whom said he would look into it (not to put names out there) and then never got back to me. I dont know if it is possible.
     
  4. You talking like make it a ratio of 1:1, so 1lowgrade to 1 oil?
     
  5. Yes 1 oil for 1 low grade no matter where its placed.
     
  6. just answering because I'm interested if there is a solution for this ;)
     
  7. bump diggity
    still interested in a final answer, yes or no.
     
  8. I think this is possible, I looked at several ways to do it and I THINK I might have found one, but it has a low chance of working. I'll give it a try and let you know.
    [DOUBLEPOST=1462221717,1462208692][/DOUBLEPOST]Alright, I know they disabled pump jacks in a past update, are they still disabled? I'm flying around in the desert throwing thousands of survey charges and none of them are oil. Any ideas what I'm doing wrong? I don't play too much anymore so maybe something changed.
     
  9. I dont think you can get them thu survey charges yet. I use the build addon (link at the end) and you can place all sorts of things and when I place pumpjacks I get variables all over the board.

    Build Addon: Build for Rust | Oxide
     
  10. Ahh I see, that helps thanks. Just needed to know how you were placing them.
    [DOUBLEPOST=1462238090][/DOUBLEPOST]
    Alright, I've discovered this is not possible. The hook OnQuarryGather (which is also used for PumpJacks) is only called if the resource is not a liquid. Oil is a liquid, and so it is never run. I have no way to know if a pumpjack is running, so I have no way to tell it to gather anything.

    Until they add pumpjacks back in, you're out of luck. :(
     
  11. Pretty sure that hook is called no matter what, considering with Gather Manager you can change the quarry's crude oil output amount.
     
  12. Eitherway, while a query is running, a simple Debug.Log does not output anything when using that hook. So it's not getting called as far as I can tell.

    EDIT: And even though GatherManager plugs into it, if oil is never produced, you can't do anything with it. Even placing pumpjacks doesn't produce oil.
     
  13. Here's a snippet of code, do what you want with it. Right now, it just makes every oil pump jack, static or not, produce 1 crude oil for 1 low grade, regardless of if there was actually a resource deposit where it was.

    Code:
    void OnServerInitialized()
            {
                MiningQuarry[] quarries = GameObject.FindObjectsOfType<MiningQuarry>();
                FieldInfo _linkedDeposit = typeof(MiningQuarry).GetField("_linkedDeposit", (BindingFlags.Instance | BindingFlags.NonPublic));
                foreach (MiningQuarry quarry in quarries)
                {
                    var name = quarry?.LookupShortPrefabName() ?? string.Empty;
                    if (!name.Contains("jack")) continue;
                    var newDepo = new ResourceDepositManager.ResourceDeposit();
                    newDepo.Add(ItemManager.FindItemDefinition("crude.oil"), 1, 1000, 10f, ResourceDepositManager.ResourceDeposit.surveySpawnType.ITEM, true);
                    _linkedDeposit.SetValue(quarry, newDepo);
                    quarry.SendNetworkUpdateImmediate();            }
    }
    
    EDIT: It's worth noting the above code will only be executed when the plugin is reloaded, so new pump jacks won't be changed until you reload the plugin or restart the server. You can copy essentially the same code into OnEntitySpawned, but since I'm not making a full plugin, I figure this is enough to get somebody who wants to do this started.
     
    Last edited by a moderator: May 3, 2016
  14. Thank you for coming up with this :) So just to be clear I would copy the majority of this snippet into say onentityspawned, place a few pump jacks, reload said plugin and it "should" work

     
  15. It's actually easier to just plant a static pump jack. Using /plant XX, I don't remember the number for it, but it's 80+
     
  16. I believe the number is 85 for it. I havent been able to do full testing as Ive been busy with work *cough cough* as I should be now *cough cough*
     
  17. If you plant them it also needs luck,
    i planted one and it works nice, i planted 7, they were doing nothing and the 8th produced one crude oil for 4 x fuel =/
    [DOUBLEPOST=1462653490,1462471279][/DOUBLEPOST]just coming back to copy the code to test it but for your info:
    /deploy "pump jack"
    works also ;)
     
  18. All the /plant 93 i have been doing is giving the correct 2x rate on my 2x gather server
     
  19. lol... yes. /deploy seems to be luck... /plant works.
    Thank you ^^