Adds a getRandomLocation() method for every region type. It is done in the most efficient way possible for cylinders, spheres and hemispheres: Cuboid bounds are set around the region and random locations within that cuboid are generated until one such location is also contained within the original region type. Meta regions will generate a random number to select a region in their list. A random location within that region is then returned.
Adds more JSON flexibility for spawn points. A spawn point can now be defined in the old way using a single location via "coords", or in a new way by passing a "region". The region can be locally defined or referenced with its ID, similar to how it's done in CTW/DTM objective regions.
Two types of region spawn points can be used: Absolute and relative ones. A relative region spawn point will make the player face whatever coordinates are given in the "face-coordinates" variable. An absolute region spawn point will by default use yaws and pitches of 0, or whatever is given in the corresponding variables.
Adds a getRandomLocation() method for every region type. It is done in the most efficient way possible for cylinders, spheres and hemispheres: Cuboid bounds are set around the region and random locations within that cuboid are generated until one such location is also contained within the original region type. Meta regions will generate a random number to select a region in their list. A random location within that region is then returned.
Adds more JSON flexibility for spawn points. A spawn point can now be defined in the old way using a single location via "coords", or in a new way by passing a "region". The region can be locally defined or referenced with its ID, similar to how it's done in CTW/DTM objective regions.
Two types of region spawn points can be used: Absolute and relative ones. A relative region spawn point will make the player face whatever coordinates are given in the "face-coordinates" variable. An absolute region spawn point will by default use yaws and pitches of 0, or whatever is given in the corresponding variables.
Local region registration. Uses absolute yaws and pitches
Reference to a global region. Uses relative yaws and pitches
The pre-existing spawn points which only use single locations are 100% compatible with this commit.
Closes https://github.com/Warzone/TGM/issues/245 Closes https://github.com/Warzone/TGM/issues/622