Hey all,
How do I check if a single float[3] is a valid spawn point?
I know I can do the getSpawnPointWithin for a zone, but don't want to use zones in this case.
Thanks,
Grue
Check if valid spawn point
Re: Check if valid spawn point
You could try DropGeometry::dropPlayer from DropGeometry.h
Re: Check if valid spawn point
Use the bz_getStandardSpawn function to get a valid spawn location for a player somewhere in the world, or bz_getSpawnPointWithin to get a valid spawn location within a custom zone object.
Re: Check if valid spawn point
Well, there's several problems with this.
a) I have a point, and I want to check whether or not the player can spawn there
b) If that point is in the air, that's fine, I would still like them to spawn there
bz_getSpawnPointWithin and bz_getStandardSpawn both generate random spawn points which is not what I'm going for, and they don't allow for airspawns.
a) I have a point, and I want to check whether or not the player can spawn there
b) If that point is in the air, that's fine, I would still like them to spawn there
bz_getSpawnPointWithin and bz_getStandardSpawn both generate random spawn points which is not what I'm going for, and they don't allow for airspawns.
Re: Check if valid spawn point
Well that's not how the API works. Another suggestion would be to define a custom map object that defines a valid spawn point and then pick one of those locations. Then the map would have a list of known good locations coded into it.
- Zehra
- Private First Class
- Posts: 922
- Joined: Sun Oct 18, 2015 3:36 pm
- Location: Within the BZFS API and Beyond it
- Contact:
Re: Check if valid spawn point
There's one terrible work-around for this, have some sort of converter made for the map to find all the objects and create a zone for the "object" in question. Now simply check if the the spawn point is within a "zone" and if it is, it isn't a valid spawn point, in other words, all non-zoned spaces are valid spawn points if they are within the world. (Yes, this is perhaps the most tedious suggestion, especially if mesh objects are used.)
-Zehra
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.
Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.
Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
Re: Check if valid spawn point
I actually did this, but I couldn't figure out how to make an airspawn count as a valid spawn point. Really, I need any point that is not sealed to count as a valid spawn point.Zehra wrote: ↑Mon Aug 15, 2022 12:05 am There's one terrible work-around for this, have some sort of converter made for the map to find all the objects and create a zone for the "object" in question. Now simply check if the the spawn point is within a "zone" and if it is, it isn't a valid spawn point, in other words, all non-zoned spaces are valid spawn points if they are within the world. (Yes, this is perhaps the most tedious suggestion, especially if mesh objects are used.)
-Zehra
- Zehra
- Private First Class
- Posts: 922
- Joined: Sun Oct 18, 2015 3:36 pm
- Location: Within the BZFS API and Beyond it
- Contact:
Re: Check if valid spawn point
Try using the bz_eGetPlayerSpawnPosEvent to modify a spawn position.
Something like this might work:
Also, you might want to add some units of space away from a zone to prevent any partial sealed issues. (About half a tank in length should be enough, plus 1-2 world units.)
-Zehra
Something like this might work:
Code: Select all
SpawnPosEvent: {
While (spawn is not valid) {
SpawnLocation = SelectSpawnLocation();
//Your custom spawn position selection
For (Zones in in World) {
If (SpawnLocation is in Zone) {
spawn = is not valid;
}
}
If (spawn is valid) {
Break;
}
}
SpawningZone = SpawnLocation;
}
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.
Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.
Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread