Noverwyn Documentation

Buckets

A bucket is a dimension. Two players in different buckets never see each other, even side by side. Everyone starts in bucket 0.

This is what lets several classes take place in the same room.

Base bucket#

player:setBucket(12)

Stays until the next change. player:clearBucket() goes back to 0.

Bucket bound to a zone#

classroom.onEnter = function(zone, player)
	player:setBucket(140, zone)
end
classroom.onExit = function(zone, player)
	player:clearBucket(zone)
end

The bucket is given back automatically on exit, even if:

  • onExit is missing or fails;
  • the player disconnects;
  • the zone is removed;
  • the script stops.

This is the recommended way: nobody gets stuck in a bucket.

Without a script#

A zone can set its bucket itself, in the map or by script:

zones.box({ name = "Lecture hall", center = { 0, 0, 2 }, size = { 20, 12, 4 }, bucket = 150 })

Which bucket wins#

  1. Among the zones the player is in that set a bucket: the highest priority, then the last one entered.
  2. Otherwise, the base bucket.

So when leaving a zone, you return to the bucket of the zone that remains.

Guarantees#

  • A bucket never sees another bucket.
  • No client message can change a bucket.
  • Objects have a bucket too: entities.create accepts bucket.