1. Fuzzle

    Fuzzle Naked Wanderer

    Hello,

    it seems with the update today i will get a problem with a plugin which i wrote.
    Code (Text):
    Privilege radius based on blocks, not cupboards

    Building privilege is now based on the building blocks instead of exact radius around the cupboard. That means the placement of the cupboard inside the building has no impact on that structures exact build privilege area. Rather, the building itself defines the radius of build privilege (which is currently 16 meters).

    See the pictures below for some examples of what that looks like in game.
    Source: Updates

    The plugin is currently checking if there is a cupboard in a certain radius of structure, if yes it gets the authorized players of the found cupboard. Now it's based on the structures itself... How am i now able to get the authorized players of a structure like a wall?
     
  2. Lamego

    Lamego Naked Wanderer

    Looking at the DLL disassemble, you might be able to use BuildingPrivlidge.Get
    public static BuildingPrivlidge Get(Vector3 position, Quaternion rotation, Bounds bounds)

    And from the BuildingPrivlidge class, you get the "authorizedPlayers" .
     
  3. Fuzzle

    Fuzzle Naked Wanderer

    But for that i need the exact position of the Cupboard right?
     
  4. Lamego

    Lamego Naked Wanderer

    Yes, sorry, I had the wrong idea that Get could be used to get the building privilege associated with entitity at position, but the code seems to actually just check for the presence of the cup itself at position.
     
  5. Fuzzle

    Fuzzle Naked Wanderer

    Ist there a way to determine from an entity which entitys are snapped or placed on it? Sorry if my questions are noobish but i'm relative new to plugin development in Rust
     
  6. Lamego

    Lamego Naked Wanderer

    Another attempt to help. (I am also new to mods), probably you can use GetEntityLinks(bool linkToNeighbours = true) from your target entity, but you would need to use it recursively until you find a BuildingPrivlidge, or you have ran out of links to check.

    Base validation seems to efficient for actual gameplay, because runtime triggers are actually set on base blocks, and those triggers are used to identify authorized/block permission during walk time.
    --- Double Post Merged, Dec 7, 2017 at 11:25 PM ---
    Another thing to try:

    var bp_trigger = (target_entity as BaseEntity).FindTrigger(BuildPrivilegeTrigger);
    var bp_block = bp_trigger.privlidgeEntity;
     
  7. Fujikura

    Fujikura Plugin Developer

    removed from game...
    removed from game...
     
  8. DEUSNEXUS

    DEUSNEXUS Plugin Developer

    Than replaced it?
    BuildPrivilegeTrigger and GetBuildingPrivilege
     
  9. Fujikura

    Fujikura Plugin Developer

    GetBuildingPrivilege still exsits, but needs OBB input now.
    The triggers do not exist anymore. The enter and leave checks are fully done clientside now.
     
  10. NumberOne 2

    NumberOne 2 Naked Wanderer

    i have this problem
    No building for tool cupboard!

    No building for tool cupboard CalculateCostFraction
     
  11. VooDoo 3

    VooDoo 3 Naked Wanderer

    What with BuildingPrivilege
    CheckEntity
    Get
    GetValue
    don't work
     
  12. ninco90

    ninco90 Plugin Developer

    Is it possible to obtain by means of code the amount of resources that a certain cabinet has? For example, you look at a closet and put a command in the chat and it shows you what you have inside and the time remaining.
     
  13. DEUSNEXUS

    DEUSNEXUS Plugin Developer

    How to create this OBB?
     
  14. DEUSNEXUS

    DEUSNEXUS Plugin Developer

    Solved