1. Hello,

    Writing a /repair plugin where it would only fix linked entities instead of entities in radius so that you would pretty much have to repair the base and the high walls separately.

    Problem is that i tried to find the link ID by examining entities trough OnHammerHit and other methods but cannot find the exact identifier, I scrolled trough BaseEntity.cs multiple times but still cant figure out how linked entities are linked.

    Maybe I failed because I was hoping for an ID of some sort, if there is another way to identify unique links, please let me know.

    Cheers !
     
  2. When examining the BuildingBlock class you can see that every block as its own `buildingID` (uint) which should normally allow you to identify linked building blocks. This would still require you to grab all building blocks in a radius but you would be able to compare buildingIDs to check if they are attached or not.

    I'd suggest testing the output of the building block's buildingID for a few attached and separated blocks to see if this does in fact hold the values you'd expect and if it does, you could probably get something to work like you mentioned.
     
  3. This is exactly the ID I was looking for ! No need for check in radius either, separate foundations have separate IDs. However it only works on foundations, NullReference on walls ;/ But for now making tool work for buildings is more than enough.

    Thanks! :}
     
  4. Example for BuildingBlock "foundation".

    a foundation has ~14 EntityLinks, for example for foundations, walls, terran, etc...
    A link is etablished when the "connections" list is not-null and has at least 1 object(EntityLink).
    Behind this "connections[0]" OR "connections.First()" you find the "owner" => connected entity at this link ;)
    From this owner-entity you crawl all of it's connected links while excluding the already checked ent you started from..etc, etc :p
     
  5. So basically u mean that connection/link can be made between the walls and foundations? And when I repair the foundation it would fix the wall by doing foreach connections[0]?
     
  6. You would need to crawl through all of these to create some sort of index. With a "While..." loop you could loop over all connections of each owner-entity. You ned only to prevent double-checks of already cralwed objects..then you got them all on the end.
     
  7. But wouldn't block count * ~14 in a loop cause lag while repairing massive bases ? It is definitely a step forward from what im going for now.
    (if block.iID = OnHit(block.ID)
    {
    Fix(block) ;
    }

    But this should be lightweight and painless to code ^^
     
  8. Your answers are also there :p
    >>> Making an async function? | Oxide
     
  9. That is some advanced stuff xD But thanks again, will use it in the future :}