Skip to content

Commit 6b0daef

Browse files
Nuke manual center functionality (#110)
* Nuke manual center functionality rename some timers and functions aswell * network active pvp center on editing start and a name tweak * Simplify center radius code Actually test and fix syncActivePvpCenter * Update lua/cfc_random_spawn/module/sv_player_spawning.lua Co-authored-by: legokidlogan <26103433+legokidlogan@users.noreply.github.com> * Update README.md Co-authored-by: legokidlogan <26103433+legokidlogan@users.noreply.github.com> --------- Co-authored-by: legokidlogan <26103433+legokidlogan@users.noreply.github.com>
1 parent 6e94f17 commit 6b0daef

18 files changed

Lines changed: 62 additions & 467 deletions

README.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Clone or download this repository into your `garrysmod/addons` folder and restar
1212
## Usage Instructions
1313
The config for this addon is located in the `cfc_random_spawn/lua/cfc_random_spawn/sv_config.lua` file.
1414
Here you will find 2 config constants, and the spawn points table structure. The constants are as follows:
15-
- `DEFAULT_CENTER_CUTOFF` `(default 3000)` - Default cutoff range from the most popular pvp center, where players further away from this will be ignored. The system tries to place you closest to everyone else.
15+
- `DEFAULT_CENTER_RADIUS` `(default 3000)` - Default cutoff range from the most popular pvp center, where players further away from this will be ignored. The system tries to place you closest to everyone else.
1616
- `CLOSENESS_LIMIT` `(default 400)` - Will not choose spawnpoints that are within this many units of a valid player (i.e. a living pvper). 0 to disable.
1717
- `SELECTION_SIZE` `(default 8)` - Max number of 'ideal' spawnpoints to select from randomly.
1818
- `CENTER_UPDATE_INTERVAL` `(default 60)` - The gap (in seconds) between each center popularity update. If set to 0, will update on every respawn.
@@ -22,13 +22,8 @@ Adding spawnpoints is done as follows:
2222
- Create an entry to the `CUSTOM_SPAWNS` table for the map of your choosing, as follows:
2323
```lua
2424
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_bluehills_test3"] = {
25-
centerCutoff = NUMBER,
2625
centerUpdateInterval = NUMBER,
2726
dynamicCenterStartingPos = VECTOR,
28-
pvpCenters = {
29-
{ centerPos = VECTOR, overrideCutoff = NUMBER },
30-
...
31-
},
3227
zones = {
3328
{ cornerA = VECTOR, cornerB = VECTOR },
3429
...
@@ -40,12 +35,8 @@ Adding spawnpoints is done as follows:
4035
}
4136
```
4237
Where
43-
- `centerCutoff` overrides `DEFAULT_CENTER_CUTOFF` for this map.
4438
- `centerUpdateInterval` overrides `CENTER_UPDATE_INTERVAL` for this map.
45-
- `dynamicCenterStartingPos` defines the position to use for locating the dynamic pvp center (requies zero manual pvp centers) when no active combat is happening. Best positioned at the 'natural spawn area' of the map, as this is guaranteed to happen on initial map load. Defaults to `Vector( 0, 0, 0 )`.
46-
- **pvpCenters**: defines one or more central positions where pvp most often takes place around, with the first one being the fallback if there are no pvpers. If none are defined, will default to the average position of all spawnpoints for this map.
47-
- `centerPos` is the position for the pvp center.
48-
- `overrideCutoff` overrides the map/default cutoff value for obtaining the average player position near this specific pvp center, useful for maps with many centers that vary heavily in size.
39+
- `dynamicCenterStartingPos` defines the position to use for locating the dynamic pvp center when no active combat is happening. Best positioned at the 'natural spawn area' of the map, as this is guaranteed to happen on initial map load. Defaults to `Vector( 0, 0, 0 )`.
4940
- **zones**: defines boxes that separate spawns into groups. Except in rare cases, spawns will only be chosen if they are in the same zone as the currently active pvp center. Any spawns not contained by a zone will be added to a default group.
5041
- `cornerA` is the first corner of the zone.
5142
- `cornerB` is the second corner of the zone.
@@ -62,12 +53,10 @@ To enable this tool run `cfc_spawneditor_toggle` in console.
6253

6354
Features:
6455
- To add / remove spawns `cfc_spawneditor_spawnadd` / `cfc_spawneditor_spawndel`
65-
- To add / remove pvp centers `cfc_spawneditor_centeradd` / `cfc_spawneditor_centerdel`
6656
- To mark / cancel / add / remove zones `cfc_spawneditor_zonea` and `cfc_spawneditor_zoneb` / `cfc_spawneditor_zonecancel` / `cfc_spawneditor_zoneadd` / `cfc_spawneditor_zonedel`
6757
- Zones will be previewed in magenta, then turn cyan when confirmed.
68-
- To change the cutoff radius for the current map `cfc_spawneditor_cutoff`
6958
- To export the current map's spawnpoints to console use `cfc_spawneditor_export`, you can then paste this into sv_config.lua
70-
- To change the update interval for pvp centers temporarily for debugging, use `cfc_spawneditor_center_interval <interval>`
59+
- To change the update interval for pvp centers temporarily for debugging, use `cfc_spawneditor_pvpcenter_update_interval <interval>`
7160

7261
Visual appearance:
7362
![image](https://user-images.githubusercontent.com/69946827/190715330-645c7701-953d-452e-aa52-9908e479eecf.png)

lua/cfc_random_spawn/configs/gm_blesmont.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_blesmont"] = {
2-
centerCutoff = nil,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( 7050, -7530, 8 ), overrideCutoff = 4000 },
6-
{ centerPos = Vector( 10429, -8922, 9 ), overrideCutoff = 4000 },
7-
{ centerPos = Vector( 3386, -8406, 8 ), overrideCutoff = 4000 }
8-
},
93
spawnpoints = {
104
{ spawnPos = Vector( 6925, -7964, 3 ), spawnAngle = Angle( 0, 90, 0 ), pvp = true },
115
{ spawnPos = Vector( 7336, -7815, 3 ), spawnAngle = Angle( 0, 90, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_bluehills_test3.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_bluehills_test3"] = {
2-
centerCutoff = 2000,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( 292, -1, 265 ), overrideCutoff = nil }
6-
},
73
spawnpoints = {
84
{ spawnPos = Vector( 1104.6744384766, 131.18112182617, 64.03125 ) },
95
{ spawnPos = Vector( 385.55798339844, 157.09564208984, 64.03125 ) },

lua/cfc_random_spawn/configs/gm_city25.lua

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_city25"] = {
2-
centerCutoff = 3000,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( 7, -1340, 101 ), overrideCutoff = 3000 },
6-
{ centerPos = Vector( -3786, -3121, 92 ), overrideCutoff = 4000 },
7-
{ centerPos = Vector( -899, -6346, 109 ), overrideCutoff = 3000 },
8-
{ centerPos = Vector( 2892, -5823, 101 ), overrideCutoff = 3000 },
9-
{ centerPos = Vector( -2008, -7467, 94 ), overrideCutoff = 4000 },
10-
{ centerPos = Vector( 4600, -7998, 91 ), overrideCutoff = 4000 }
11-
},
123
spawnpoints = {
134
{ spawnPos = Vector( 599, -1308, 83 ), spawnAngle = Angle( 0, -180, 0 ), pvp = true },
145
{ spawnPos = Vector( 598, -1878, 83 ), spawnAngle = Angle( 0, -180, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_construct_in_flatgrass.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_construct_in_flatgrass"] = {
2-
centerCutoff = nil,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( 1831, -873, -8567 ), overrideCutoff = 3250 },
6-
{ centerPos = Vector( -932, -2738, -8167 ), overrideCutoff = 2250 },
7-
{ centerPos = Vector( -2897, -3955, -8157 ), overrideCutoff = 2250 },
8-
{ centerPos = Vector( -2959, 3392, -8507 ), overrideCutoff = 2250 }
9-
},
103
spawnpoints = {
114
{ spawnPos = Vector( 1968, -1050, -8577 ), spawnAngle = Angle( 0, -180, 0 ), pvp = true },
125
{ spawnPos = Vector( 1986, -843, -8577 ), spawnAngle = Angle( 0, -180, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_excess_construct_13.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_excess_construct_13"] = {
2-
centerCutoff = 2000,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( -3196, -828, 857 ), overrideCutoff = 3250 },
6-
{ centerPos = Vector( 155, 1709, 252 ), overrideCutoff = 2250 },
7-
{ centerPos = Vector( 2858, 95, 260 ), overrideCutoff = 3250 },
8-
{ centerPos = Vector( 2768, 2097, 66 ), overrideCutoff = 2250 },
9-
{ centerPos = Vector( -13672, 4044, 832 ), overrideCutoff = 3250 }
10-
},
113
spawnpoints = {
124
{ spawnPos = Vector( -3225, -568, 683 ), spawnAngle = Angle( 0, 0, 0 ), pvp = true },
135
{ spawnPos = Vector( -2793, -720, 419 ), spawnAngle = Angle( 0, -45, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_excess_island_night.lua

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_excess_island_night"] = {
2-
centerCutoff = nil,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( 251, -2425, 48 ), overrideCutoff = 2250 },
6-
{ centerPos = Vector( 3568, -1319, 247 ), overrideCutoff = 1250 },
7-
{ centerPos = Vector( 3542, -4542, 155 ), overrideCutoff = 2250 },
8-
{ centerPos = Vector( 424, 1786, 247 ), overrideCutoff = 1250 },
9-
{ centerPos = Vector( -2233, 1916, 261 ), overrideCutoff = 2250 },
10-
{ centerPos = Vector( 4175, 2640, 244 ), overrideCutoff = 3250 }
11-
},
123
spawnpoints = {
134
{ spawnPos = Vector( 176, -2657, 11 ), spawnAngle = Angle( 0, -90, 0 ), pvp = true },
145
{ spawnPos = Vector( 170, -2271, 11 ), spawnAngle = Angle( 0, 0, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_freespace_13.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_freespace_13"] = {
2-
centerCutoff = 3000,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( -2374, -40, -14580 ), overrideCutoff = nil }
6-
},
73
spawnpoints = {
84
{ spawnPos = Vector( -1313, 25, -14566 ), spawnAngle = Angle( 0, 180, 0 ), pvp = true },
95
{ spawnPos = Vector( -3040, 223, -14566 ), spawnAngle = Angle( 0, -45, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_heartland.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_heartland"] = {
2-
centerCutoff = 3000,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( -18, -437, 36 ), overrideCutoff = 2250 },
6-
{ centerPos = Vector( -2933, 444, 137 ), overrideCutoff = 2250 },
7-
{ centerPos = Vector( -25, 3166, 25 ), overrideCutoff = 2800 },
8-
{ centerPos = Vector( -3900, 2314, 101 ), overrideCutoff = 2250 },
9-
{ centerPos = Vector( 4026, 2408, 101 ), overrideCutoff = 2250 },
10-
{ centerPos = Vector( -3073, 3625, 1602 ), overrideCutoff = 1000 },
11-
{ centerPos = Vector( 1641, 5494, -123 ), overrideCutoff = 2250 },
12-
{ centerPos = Vector( -6533, 3447, 190 ), overrideCutoff = 2250 },
13-
{ centerPos = Vector( -7682, 11888, 97 ), overrideCutoff = 2250 }
14-
},
153
spawnpoints = {
164
{ spawnPos = Vector( 594, -351, 28 ), spawnAngle = Angle( 0, -180, 0 ), pvp = true },
175
{ spawnPos = Vector( -614, -347, 29 ), spawnAngle = Angle( 0, 0, 0 ), pvp = true },

lua/cfc_random_spawn/configs/gm_mobenix_v3_final.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
CFCRandomSpawn.Config.CUSTOM_SPAWNS["gm_mobenix_v3_final"] = {
2-
centerCutoff = 4500,
32
centerUpdateInterval = nil,
4-
pvpCenters = {
5-
{ centerPos = Vector( -9412, -2020, 10445 ), overrideCutoff = 3000 },
6-
{ centerPos = Vector( -384, 1271, -204 ), overrideCutoff = 3000 },
7-
{ centerPos = Vector( 3248, 2223, -321 ), overrideCutoff = 3000 },
8-
{ centerPos = Vector( -1072, 11970, 1086 ), overrideCutoff = 4000 },
9-
{ centerPos = Vector( 5202, -10829, 136 ), overrideCutoff = 4000 },
10-
{ centerPos = Vector( 8003, 3930, -315 ), overrideCutoff = 4000 },
11-
{ centerPos = Vector( 8497, -9219, 95 ), overrideCutoff = 3000 },
12-
{ centerPos = Vector( 10257, -342, -210 ), overrideCutoff = 4000 },
13-
{ centerPos = Vector( 8164, 9508, -443 ), overrideCutoff = 4000 },
14-
{ centerPos = Vector( 11528, -6996, -210 ), overrideCutoff = 4000 },
15-
{ centerPos = Vector( 15346, -8156, -461 ), overrideCutoff = 3000 }
16-
},
173
spawnpoints = {
184
{ spawnPos = Vector( -9124, -1747, 10384 ), spawnAngle = Angle( 0, 179, 0 ), pvp = true },
195
{ spawnPos = Vector( -9687, -1744, 10384 ), spawnAngle = Angle( 0, -1, 0 ), pvp = true },

0 commit comments

Comments
 (0)