[v.158] SimpleZone | A simple, fast and new Zone module!


simplezonebugthing.rbxl (93.1 KB)

(Set InSeperateQuerySpace to false and comment out the copy to query space line in order for it to work)

Hi, fixed in package version 137, I was passing the wrong amount of parameters to copyToQuerySpace lol

Also, I gotta go sleep, so lmk if you have any more issues and I’ll answer in the morning

I can confirm it works now thank you for the help.

1 Like

Theres no typechecking. Pls add it

There is typechecking tho

but theres no hints.

Summary

This text will be hidden

Wdym? What version of SimpleZone r u using, it has hints for me (sorry for responding late, had to sleep)

Ohh I think I know why you don’t have any hints, they recently auto-enabled the Incremental Typechecker beta feature which tends to break for more complex types, try turning it off

Package Version 140:

  • Added a seperate ZoneImpl type for members of the Zone class to shorten the autocomplete
    Before:


    After:

  • Made it so Zone:Destroy() automatically calls Zone:UnbindFromHeartbeat() (this was removed a few versions ago, idk why but now it’s back :V)

1 Like

Package Version 147:

  • Fixed .fromPartParallel()
  • Changed all folder names from loud snake case to pascal case (for actors and query spaces)
  • Updated SimpleSignal to version 87

I’m having inconsistency on my zones using Zone:fromBoxes()
Some boxes do not trigger any events and only triggers closest to the center of all the boxes.

and using zone:fromBox() using only “OnEnter” detection
sometimes it does not trigger it aswell. I am not sure what is causing this or have any reproduction steps. During my play test on my game sometimes its pretty consistent and sometimes not. I have simple system to where it checks if the player is in the current zone otherwise it kills them.
I binded a ListenTo(“Player”, “Entered”) and just set the player’s attribute to the current zone.

most likely the zone did not trigger from zone to zone. The zones do not overlap each other. I added spacing to each zones so when it enters between zone i made sure it exited first before entering a different zone.
like this:

I tried printing the player’s zone attribute when they get killed to see if they in the zone. But sadly it print’s the old zone they were in not the current zone they are currently standing.

Hi, this is intended behaviour. For example, lets say i have 2 zone parts, A and B, and they are connected to eachother, and i construct a zone for both using Zone.fromParts()/Zone.fromBoxes(), entering zone B from A will not trigger an entered/exited event. This is because zone parts within the same Zone won’t trigger those events

I honestly don’t know if i can implement something like OnlyExitOnceExitedAll from ZonePlus, as this is just a side product of how I’m tracking items within the zone. I’ll let you know if the behaviour has changed though

For now I’d try using Zone.fromPartParallel() and setting QueryOptions.UpdateInterval to something relatively high so you don’t get lag

(Unless you’re describing a completely different issue? Let me know)

My bad I think i explained it badly. and the method i meant was
zone:fromPart() or zone:fromParts().

Zone A and Zone B are completely different zones they are constructed with 2 different zone object using zone:fromPart()

What I’m trying to say on the first issue is when using zone:fromParts() and pass these 3 base parts.


it only triggers the Entered event when the player is closer to the center of all 3 parts.

I expect it should trigger whenever the player enter’s one of these 3 parts but it does not. Here’s an example:
the green circle the representation of the average center point of the 3 parts.

I avoided this issue by just using zone:fromPart() instead but as you stated its more optimized to use fromParts() if we have multiple parts that represents the same zone.

The second issue is now that I am using fromPart() sometimes switching from different zone does not trigger the Entered Event even though they are completely different zone object.

They are constructed like this:

local zoneA = SimpleZone.fromPart(partA, params)
local zoneB = SimpleZone.fromPart(partB, params)

They are placed like this:
(This is just an example but i have more zones I use it for rooms and hallways so I can detect what room the player is or what hallway the player is currently at)


I cannot pin point or reproduce this issue here as they are pretty inconsistent. But as i said:

1 Like

Hi, it would be very helpful if you could send the place where you’re testing these issues so I can see if I can reproduce them, thanks!

Hi, I can’t replicate the issue in my game. Can you share the code you’re using to generate the zones and some things about your game you might think are causing the issue?

Is there no method to query and get all objects currently in a zone like ZonePlus’ :getParts()?

Zone:Query(params) //30charlimit//

Package Version 154:

  • Updated SimpleSignal to the latest version
  • Changed the BVH module around a little

Ok, that method is not autofilling with intellisense and has a type error when attempting to use it (I’m using LessSimpleZone)

Hi, this is because in the module the Query field is defined as nullable but it really isn’t, I’ll change it in 155 :V Will let ya know