@quenty/spawning 10.23.0-canary.ae8d76d.0 → 10.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [10.23.0
|
|
6
|
+
# [10.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/spawning@10.22.3...@quenty/spawning@10.23.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -13,7 +13,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/spawning",
|
|
3
|
-
"version": "10.23.0
|
|
3
|
+
"version": "10.23.0",
|
|
4
4
|
"description": "Centralized spawning system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"Quenty"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@quenty/binder": "14.20.0
|
|
28
|
-
"@quenty/cmdrservice": "13.23.0
|
|
29
|
-
"@quenty/loader": "10.
|
|
30
|
-
"@quenty/maid": "3.
|
|
31
|
-
"@quenty/randomutils": "6.
|
|
32
|
-
"@quenty/servicebag": "11.12.0
|
|
27
|
+
"@quenty/binder": "^14.20.0",
|
|
28
|
+
"@quenty/cmdrservice": "^13.23.0",
|
|
29
|
+
"@quenty/loader": "^10.9.0",
|
|
30
|
+
"@quenty/maid": "^3.5.0",
|
|
31
|
+
"@quenty/randomutils": "^6.11.0",
|
|
32
|
+
"@quenty/servicebag": "^11.12.0",
|
|
33
33
|
"@quentystudios/t": "^3.0.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
|
|
39
39
|
}
|
|
@@ -8,7 +8,6 @@ local BinderGroup = require("BinderGroup")
|
|
|
8
8
|
local t = require("t")
|
|
9
9
|
|
|
10
10
|
return require("BinderGroupProvider").new(function(self, _serviceBag)
|
|
11
|
-
|
|
12
11
|
-- SpawnProvider
|
|
13
12
|
-- self:Add("SpawnProviders", BinderGroup.new(
|
|
14
13
|
-- {
|
|
@@ -19,12 +18,14 @@ return require("BinderGroupProvider").new(function(self, _serviceBag)
|
|
|
19
18
|
-- ))
|
|
20
19
|
|
|
21
20
|
-- Item / asset spawning
|
|
22
|
-
self:Add(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
self:Add(
|
|
22
|
+
"Spawners",
|
|
23
|
+
BinderGroup.new(
|
|
24
|
+
{},
|
|
25
|
+
t.interface({
|
|
26
|
+
SpawnUpdate = t.callback,
|
|
27
|
+
Regenerate = t.callback,
|
|
28
|
+
})
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
end)
|
|
@@ -17,11 +17,11 @@ function SpawnCmdrService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
|
17
17
|
self._cmdrService = self._serviceBag:GetService(require("CmdrService"))
|
|
18
18
|
|
|
19
19
|
self._cmdrService:RegisterCommand({
|
|
20
|
-
Name = "regen"
|
|
21
|
-
Aliases = {}
|
|
22
|
-
Description = "Forces all spawners to regenerate."
|
|
23
|
-
Group = "Spawn"
|
|
24
|
-
Args = {}
|
|
20
|
+
Name = "regen",
|
|
21
|
+
Aliases = {},
|
|
22
|
+
Description = "Forces all spawners to regenerate.",
|
|
23
|
+
Group = "Spawn",
|
|
24
|
+
Args = {},
|
|
25
25
|
}, function(_context)
|
|
26
26
|
self._spawnService:Regenerate()
|
|
27
27
|
|
|
@@ -29,4 +29,4 @@ function SpawnCmdrService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
|
29
29
|
end)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
return SpawnCmdrService
|
|
32
|
+
return SpawnCmdrService
|
|
@@ -7,8 +7,8 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local RunService = game:GetService("RunService")
|
|
9
9
|
|
|
10
|
-
local RandomUtils = require("RandomUtils")
|
|
11
10
|
local Maid = require("Maid")
|
|
11
|
+
local RandomUtils = require("RandomUtils")
|
|
12
12
|
local ServiceBag = require("ServiceBag")
|
|
13
13
|
|
|
14
14
|
local UPDATE_PERIOD_SEC = 5
|
|
@@ -78,7 +78,13 @@ function SpawnService:Update()
|
|
|
78
78
|
|
|
79
79
|
if (os.clock() - classStartTime) >= MAX_BUDGET_PER_CLASS then
|
|
80
80
|
if WARN_ON_CLASS_BUDGET_EXHAUST then
|
|
81
|
-
warn(
|
|
81
|
+
warn(
|
|
82
|
+
string.format(
|
|
83
|
+
"[SpawnService.Update] - Class %q ran out of execution budget at %0.4f ms",
|
|
84
|
+
binder:GetTag(),
|
|
85
|
+
(os.clock() - classStartTime) * 1000
|
|
86
|
+
)
|
|
87
|
+
)
|
|
82
88
|
end
|
|
83
89
|
break
|
|
84
90
|
end
|
|
@@ -87,7 +93,13 @@ function SpawnService:Update()
|
|
|
87
93
|
|
|
88
94
|
-- watch dog
|
|
89
95
|
if (os.clock() - startTime) >= TOTAL_BUDGET_BEFORE_WARN then
|
|
90
|
-
warn(
|
|
96
|
+
warn(
|
|
97
|
+
string.format(
|
|
98
|
+
"[SpawnService.Update] - Update time: %0.4f ms for %d spawners",
|
|
99
|
+
(os.clock() - startTime) * 1000,
|
|
100
|
+
spawnerCount
|
|
101
|
+
)
|
|
102
|
+
)
|
|
91
103
|
end
|
|
92
104
|
|
|
93
105
|
debug.profileend()
|
|
@@ -98,4 +110,4 @@ function SpawnService:Destroy()
|
|
|
98
110
|
self._maid = nil
|
|
99
111
|
end
|
|
100
112
|
|
|
101
|
-
return SpawnService
|
|
113
|
+
return SpawnService
|
|
@@ -9,7 +9,10 @@ local Raycaster = require("Raycaster")
|
|
|
9
9
|
|
|
10
10
|
local SpawnerUtils = {}
|
|
11
11
|
|
|
12
|
-
function SpawnerUtils.getSpawnLocation(
|
|
12
|
+
function SpawnerUtils.getSpawnLocation(
|
|
13
|
+
spawnPart: BasePart,
|
|
14
|
+
raycaster: Raycaster.Raycaster
|
|
15
|
+
): (Vector3, Raycaster.RaycastData?)
|
|
13
16
|
local size = spawnPart.Size
|
|
14
17
|
local sy = size.Y
|
|
15
18
|
|
|
@@ -18,7 +21,7 @@ function SpawnerUtils.getSpawnLocation(spawnPart: BasePart, raycaster: Raycaster
|
|
|
18
21
|
|
|
19
22
|
local point = spawnPart.CFrame:PointToWorldSpace(Vector3.new(ox, sy / 2, oz))
|
|
20
23
|
|
|
21
|
-
local ray = Ray.new(point, Vector3.new(0, -sy*2, 0))
|
|
24
|
+
local ray = Ray.new(point, Vector3.new(0, -sy * 2, 0))
|
|
22
25
|
|
|
23
26
|
local data = raycaster:FindPartOnRay(ray)
|
|
24
27
|
if not data then
|
|
@@ -28,4 +31,4 @@ function SpawnerUtils.getSpawnLocation(spawnPart: BasePart, raycaster: Raycaster
|
|
|
28
31
|
return data.Position, data
|
|
29
32
|
end
|
|
30
33
|
|
|
31
|
-
return SpawnerUtils
|
|
34
|
+
return SpawnerUtils
|