1. Hello, how to use second paramether from OnItemDeployed hook in lua? It return System.Object[] and i have no idea what to do with it... I want use this hook to remove deployed item if spawn it in -nobuild zone (r-zones plugin).
     
  2. As mentioned in the documentation:
    Code:
    OnItemDeployed(Assembly-CSharp/Deployer deployer, Assembly-CSharp/BaseEntity deployedentity)Assembly-CSharp/Deployer
    No return behavior
    Called right after an item has been deployed
    [DOUBLEPOST=1426088190,1426078476][/DOUBLEPOST]Sorry, was testing the hook right now and noticed that it was returning the System.Object[] as well, it seems that the hook is currently not working as it should be.
    A pull request was made to the repository to fix the hook so it should get fixed soon :)
     
  3. As this is bug, ok, then i'll wait.

    Thank you.
    [DOUBLEPOST=1426098806,1426088552][/DOUBLEPOST]Are you sure that it is fixed? Because it seems like your pull request was approved but with latest oxide i'm still getting System.Object[]... Server already restarted two times and nothing changes.
     
  4. Wulf

    Wulf Community Admin

    Did you download from the snapshots repo? https://github.com/OxideMod/Snapshots
     
  5. Yes of course.

    1. I have automatic script what downloads from https://raw.githubusercontent.com/OxideMod/Snapshots/master/Rust/OxideRust.zip and unpacking to server directory.
    2. Also i have fully working mono what compiles oxide sources from git (with automatic update git) and placing compiled files to server.

    So i never download from regular download page, in most cases compile myself before it compiled by travis.

    In both variants issue still here. Also i right now tried manually download latest snapshot and unpack - still same result...
    [DOUBLEPOST=1426100305][/DOUBLEPOST]Also just checked - in souces from what i'm compiling i have already ""ArgumentString": "this, l3"," in Rust.opj, so something still wrong.
     
  6. I don't think the patched assembly is automatically created with the automated builds so that probably needs to be uploaded manually (@Wulf, correct me when I'm wrong :))

    I've attached my patched Assembly-CSharp.dll to this post for you to use for the time being.
     

    Attached Files:

  7. Wulf

    Wulf Community Admin

    You are correct, I wasn't thinking. I won't be able to push the patch until I finish cleaning up my desktop.
     
  8. Oh thank you, now it working.
    [DOUBLEPOST=1426105407][/DOUBLEPOST]Sadly, it seems like i cannot get owner of deployer if spawn only one entity (in slot). For example if i get 100 camp fire in one slot and place it, in function OnItemDeployed it returning .ownerPlayer without problems, but if only one camp fire was in slot - this not work. It seems like rust problem so my idea can't be done right now :(

    Anyway - thank you for help.
    [DOUBLEPOST=1426261594,1426103945][/DOUBLEPOST]Is there way to call hook OnItemDeployed before "base.UseItemAmount(1);"? Because after this it looses entity owner because of this:

    Code:
        protected void UseItemAmount(int iAmount)
        {
            Item ownerItem = this.GetOwnerItem();
            if (ownerItem == null)
            {
                this.DestroyThis();
                return;
            }
            Item item = ownerItem;
            item.amount = item.amount - iAmount;
            ownerItem.MarkDirty();
            if (ownerItem.amount <= 0)
            {
                this.DestroyThis();
            }
        }
    }
    if (ownerItem.amount <= 0) - this destroys entity (if only one in slot) and you can't get anymore owner of it in this hook.

    Probably i can try combine OnEntitySpawn + OnItemDeployed hooks as workaround to get my idea to work, going to do some tests...
     
  9. Just tested it and well yea, it isn't supposed to work like this, I'll look at the hook when I'm back in a few hours and I'll do another PR
     
  10. Yes, you ar right, i can't get owner inside OnEntitySpawn or OnItemDeployed hooks... So for now this is impossible at all get owner of deployed items if in slot is only one item.
     
  11. I made a PR earlier which has been merged already and should be available in the snapshots (https://github.com/OxideMod/Snapshots) as I added the patched assembly-csharp to my PR this time. If this would not be the case let me know and I'll post my patched dll here until the oxide build is updated with these changes.
     
  12. Owner? Player? deployer.ownerPlayer
     
    Last edited by a moderator: Mar 13, 2015
  13. The hook was in the wrong place Bombardir, deployer.ownerPlayer would return null when the deployable used was only one item and not part of a stack of items.
     
  14. oh... thanks, because now i'm working with this hook :confused:
     
  15. It should be fixed already in the snapshots but the current oxide build here available at the download section has this issue.
     
  16. It's not very important to me. I use it only for messages to player... In any case the plugin works (AntiRocks)
     
  17. Oh, big thanks, didn't check for update) Going to test tomorrow, but it seems like it working (Bombardir already used).

    I really glad that developers of oxide (or persons like your) fixes issues) Again thank you for help.
    [DOUBLEPOST=1426333562,1426288377][/DOUBLEPOST]Can you also move OnItemDeployed inside DoDeploy_Slot to be before "base.UseItemAmount(1);" please? I'm not sure when it used but still. Just for case...

    As for DoDeploy_Regular - now it works perfect! Thank you.
     
    Last edited by a moderator: Mar 14, 2015
  18. There is an open PR that will fix this hook as well, I'll post a modified assembly-csharp.dll when i'm at my pc later.