Rect Zones

Creates polygonal zones

Total Downloads: 677 - First Release: Jul 21, 2016 - Last Update: Mar 30, 2017

5/5, 8 likes
  1. deer_SWAG submitted a new resource:

    Rect Zones - Creates polygonal zones

    Read more about this resource...
     
  2. Just spotted this and wondered why I hadn't seen it before. Then saw it was only released 3 hours ago. Awesome!

    Perfect for adding nostabilty to a lighthouse. Will this be compatible with 'zone Domes' or something similar to visualise the zone?

    ...and is 'height' measured per building level?
     
  3. Ok, might be worth adding that height is approx 3 x per Building level. So my lighthouse is 15 levels and to cover this I set
    Code:
    /rect add 45
    Would it be possible for it to display the zone ID after this command?

    Placing the points was fantastic and easy, really great work. you can check the height on the first one etc...

    I couldn't get the command '/rect options' to work after creating the zone or after I typed '/rect done'. Nothing appears in chat or console.

    After trying to edit the .json file it error-ed as I tried to guess the flags were the same as ZoneManager. Would it be possible to list the options available in the overview?

    Code:
          ],
          "o": [],
          "enmsg": "Welcome to the Lighthouse.",
          "exmsg": "Good bye and farewell."
        }
    Thanks.
     
  4. I don't think so.
    Yup.
    Currently there is no built-in options. Options command displays options that was added by other plugins.
    I forgot to add these options in the list. Sorry.
    [DOUBLEPOST=1469141092][/DOUBLEPOST]
    It measures from point on the ground.
     
  5. I think they're asking if the height parameter refers to 1 wall height but it refers to 1 "half" wall height which is 1/3 a wall which is pretty consistent with other measurements in rust (the build plugin uses this too.)

    Also, referring to zone domes, obviously not using that plugin itself (it's just spawning a prefab display sphere and sizing it to a radius), is there no way to permanently visually represent the zone?
     
  6. Ok that's fine but unless another plugin makes use of your plugin it's a shame it can't be used for anything. Could you add the same flags as ZoneManager? Even just a couple like :

    PvpGod, UnDestr, NoDecay, NoStability?
     
  7. Yeah. Of course.
    I don't think so but i'll take a look.
     
  8. Fantastic. I think if that was the case I would completely replace ZoneManager with this.

    One question. In the Rcon when I refresh or update a plugin [RectZones] appears to shout the plugin name for some reason?

    Code:
    (10:23:47) | [Oxide] 11:23 [Info] Unloaded plugin Prod v2.2.2 by Reneb
    (10:23:47) | [Oxide] 11:23 [Info] Loaded plugin Prod v2.2.2 by Reneb
    (10:23:47) | [Oxide] 11:23 [Info] [RectZones] Prod
     
  9. Oh yeah. I'll upload a new version with fixes soon. That was just a debug stuff that i forgot to remove.
     
  10. deer_SWAG updated Rect Zones with a new update entry:

    0.0.2

     
  11. I imagine it would work very similar to the "/rect show" command but would persist, be visible to everyone, and be configured to be a little more visually pleasing (by which I mean subtle). You could make it an option "displayalways": true or something like that.
     
    Last edited by a moderator: Jul 22, 2016
  12. deer_SWAG updated Rect Zones with a new update entry:

    0.0.21

     
  13. All good here. Works like a charm. Might be worth mentioning that you need to add each flag separately.

    Code:
    /rect options nostabilty
    /rect options nobuild
    looking forward to more additions and maybe the possibility of naming the zones.

    e.g

    Code:
    /rect add 20 HOMEZONE
    nice work.
     
  14. Absolutely perfect script for areas like this.

    upload_2016-7-23_11-3-59.png
     
  15. I agree, create zone with this plugins is very easy and the fact that they aren't spherical is pretty usefull too.
     
  16. deer_SWAG updated Rect Zones with a new update entry:

    0.0.22

     
  17. My entermsg is not working and I verified it was done correctly... I did it with the following commands:

    /rect options entermsg="asdfasdf"
    /rect options nobuild entermsg="asdfasdf"
    /rect options entermsg "asdfasdf"

    None of those produced a message.

    When I use nobuild or nobuildex they work perfectly.
     
  18. First and second works fine. Third should not work.
    Try again. Maybe you forgot /rect done.
     
    Last edited by a moderator: Jul 23, 2016
  19. My friend created a nodestroy and nopvp code for your plugin. You can add it to your plugin if you want.

    Code:
    void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitinfo)
            {
                bool blockDamage = false;
                //If the the entity is a building block
                           foreach(GameObject zone in currentZones)
                {
                    RectZone zoneComponent = zone.GetComponent<RectZone>();                if ( 
                        (
                            entity is BuildingBlock && 
                            zoneComponent.Definition.Options.ContainsKey("nodestroy")
                        ) || (
                            entity is BasePlayer &&
                            (hitinfo.Initiator is BasePlayer || hitinfo.Initiator is FireBall ) && 
                            zoneComponent.Definition.Options.ContainsKey("nopvp")
                        )
                    )
                    {                   
                        if (zoneComponent.GetComponent<Collider>().bounds.Contains(entity.transform.position))
                        {
                            blockDamage = true;
                        }
                    }
                }
               
                if (blockDamage) 
                {
                    hitinfo.damageTypes = new Rust.DamageTypeList();
                    hitinfo.DoHitEffects = false;
                    hitinfo.HitMaterial = 0;
                }
            }
    
    Code:
    Dictionary<string, string> availableOptions = new Dictionary<string, string>()
            {
                { "entermsg", "Shows message when a player enters a zone" },
                { "exitmsg", "Shows message when a player exits a zone" },
                { "nobuild", "Players can't build in zone" },
                { "nobuildex", "Players can't build in zone. All buildings in a zone will be demolished" },
                { "nostability", "Removes stability from buildings" },
                { "nodestroy", "Players will be unable to destroy buildings and deployables" },
                { "nopvp", "Players won't get hurt by another player" }
            };
    
     
  20. deer_SWAG updated Rect Zones with a new update entry:

    0.0.24