Skip to content

v2.0.0 - Three new zones, brand new creation system, improved performance, and more!

Compare
Choose a tag to compare
@mkafrin mkafrin released this 23 Aug 11:15
· 50 commits to master since this release
5424525

Version 2.0.0!

2.0.0 is officially here! The choice to go to 2.0.0 was about the size of this update and that it will be the first update in PolyZone history to introduce a breaking change. Don't worry, it's a small one involving EntityZones, something most of you probably aren't using, but a break is a break. More about that below though.

This release adds:

  • Three new zones!
    • CircleZone
      • Has a center and radius. It's basically a distance check with all the PolyZone helpers on top.
      • Can operate as a circle or sphere by changing the useZ option.
      • CircleZones are for all intents and purposes, as performant as a distance check. So if all you want are the QoL features of PolyZone, you can use them now free of any guilt about "unnecessary" performance waste.
    • BoxZone
      • Has a center, length, and width.
      • This zone is an arbitrarily rotatable bounding box. It has a heading option to enable rotation (though 0 rotation is more performant).
    • ComboZone
      • Yo, heard you like zones, so I put a zone in your zone. Bad jokes aside, this zone is a collection or combination of zones, hence the name. It takes in a table of zones and all the functions, helpers, etc. operate on all the zones, while sharing resources. This is useful for if you have many zones that all do the same thing, for example a zone for each ATM in the city. Using a ComboZone instead of using all the zones separately can be many times more performant.
  • Redid the creation system to be more interactive and easier to use.
    • Works with PolyZone, CircleZone, and BoxZone!
    • Uses popup input boxes instead of having to remember command syntax
    • Interactivity! Tweak your zone before you finish creating it by changing things like position, radius, length, width, etc. using controls.
    • /pzlast command to reuse the last zone you finished creating! Easily create many similar Circle or BoxZones in a row.
  • onPlayerInOut() helper
    • Even less boilerplate when testing whether a player is in a zone!
  • Pausing zones
    • Zones can now be paused, which involves all their helpers (onPointInOut, onPlayerInOut, onEntityDamaged, etc.) being temporarily put on hold until the zone is unpaused. This works on all zone types.
  • Optimized PolyZone and EntityZone by separating them from one another to avoid a lot of branching
  • Documentation moved to wiki
    • Readme was getting too cumbersome, so the documentation was moved out and core info was kept/added to readme, such as how to download PolyZone, how to include it in your script, FAQ, etc.
  • Other various performance boosts and bug fixes!

Now back to that breaking change. Due to separating PolyZone and EntityZone from each other, you can't use EntityZones just by importing client.lua now. You have to explicitly import BoxZone.lua and EntityZone.lua as well, in that order. Also, EntityZones are not created with PolyZone:CreateAroundEntity() anymore, but instead EntityZone:Create() which follows the unified syntax for creating all zone types: ZoneType:Create()

The resource itself can be found in PolyZone.zip. You can grab an example resource in PolyZone_Example.zip.