@quenty/clipcharacters 12.19.3 → 12.19.4-canary.11a5dcf.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 +11 -0
- package/package.json +13 -13
- package/src/Client/ClipCharacters.lua +25 -19
- package/src/Client/ClipCharactersServiceClient.lua +15 -13
- package/src/Server/ClipCharactersService.lua +4 -4
- package/src/Shared/ClipCharactersServiceConstants.lua +2 -2
- package/test/scripts/Server/ServerMain.server.lua +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [12.19.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clipcharacters@12.19.3...@quenty/clipcharacters@12.19.4-canary.11a5dcf.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [12.19.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clipcharacters@12.19.2...@quenty/clipcharacters@12.19.3) (2025-04-10)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/clipcharacters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/clipcharacters",
|
|
3
|
-
"version": "12.19.
|
|
3
|
+
"version": "12.19.4-canary.11a5dcf.0",
|
|
4
4
|
"description": "Clip characters locally on the client of other clients so they don't interfer with physics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "
|
|
29
|
-
"@quenty/brio": "
|
|
30
|
-
"@quenty/characterutils": "
|
|
31
|
-
"@quenty/loader": "
|
|
32
|
-
"@quenty/maid": "
|
|
33
|
-
"@quenty/playerutils": "
|
|
34
|
-
"@quenty/remoting": "
|
|
35
|
-
"@quenty/servicebag": "
|
|
36
|
-
"@quenty/statestack": "
|
|
37
|
-
"@quenty/table": "
|
|
38
|
-
"@quenty/valueobject": "
|
|
28
|
+
"@quenty/baseobject": "10.8.4-canary.11a5dcf.0",
|
|
29
|
+
"@quenty/brio": "14.17.4-canary.11a5dcf.0",
|
|
30
|
+
"@quenty/characterutils": "12.18.4-canary.11a5dcf.0",
|
|
31
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/maid": "3.4.4-canary.11a5dcf.0",
|
|
33
|
+
"@quenty/playerutils": "8.17.4-canary.11a5dcf.0",
|
|
34
|
+
"@quenty/remoting": "12.18.4-canary.11a5dcf.0",
|
|
35
|
+
"@quenty/servicebag": "11.11.5-canary.11a5dcf.0",
|
|
36
|
+
"@quenty/statestack": "14.18.4-canary.11a5dcf.0",
|
|
37
|
+
"@quenty/table": "3.7.5-canary.11a5dcf.0",
|
|
38
|
+
"@quenty/valueobject": "13.17.4-canary.11a5dcf.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
44
44
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Clip characters locally on the client of other clients so they don't interfer with physics.
|
|
3
4
|
@class ClipCharacters
|
|
@@ -7,6 +8,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
8
|
|
|
8
9
|
local BaseObject = require("BaseObject")
|
|
9
10
|
local ClipCharactersServiceConstants = require("ClipCharactersServiceConstants")
|
|
11
|
+
local Maid = require("Maid")
|
|
10
12
|
local RxBrioUtils = require("RxBrioUtils")
|
|
11
13
|
local RxCharacterUtils = require("RxCharacterUtils")
|
|
12
14
|
local RxPlayerUtils = require("RxPlayerUtils")
|
|
@@ -15,45 +17,49 @@ local ClipCharacters = setmetatable({}, BaseObject)
|
|
|
15
17
|
ClipCharacters.ClassName = "ClipCharacters"
|
|
16
18
|
ClipCharacters.__index = ClipCharacters
|
|
17
19
|
|
|
20
|
+
export type ClipCharacters = typeof(setmetatable({}, {} :: typeof({ __index = ClipCharacters }))) & BaseObject.BaseObject
|
|
21
|
+
|
|
18
22
|
--[=[
|
|
19
23
|
Prevents characters from clipping together
|
|
20
24
|
|
|
21
25
|
@return ClipCharacters
|
|
22
26
|
]=]
|
|
23
|
-
function ClipCharacters.new()
|
|
24
|
-
local self = setmetatable(BaseObject.new(), ClipCharacters)
|
|
25
|
-
|
|
26
|
-
self._maid:GiveTask(RxPlayerUtils.observePlayersBrio()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
function ClipCharacters.new(): ClipCharacters
|
|
28
|
+
local self = setmetatable(BaseObject.new() :: any, ClipCharacters)
|
|
29
|
+
|
|
30
|
+
self._maid:GiveTask(RxPlayerUtils.observePlayersBrio()
|
|
31
|
+
:Pipe({
|
|
32
|
+
RxBrioUtils.flatMapBrio(function(player)
|
|
33
|
+
return RxCharacterUtils.observeLastCharacterBrio(player)
|
|
34
|
+
end) :: any,
|
|
35
|
+
})
|
|
36
|
+
:Subscribe(function(brio)
|
|
37
|
+
if brio:IsDead() then
|
|
38
|
+
return
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
local maid, character = brio:ToMaidAndValue()
|
|
42
|
+
self:_setupCharacter(maid, character)
|
|
43
|
+
end))
|
|
38
44
|
|
|
39
45
|
return self
|
|
40
46
|
end
|
|
41
47
|
|
|
42
|
-
function ClipCharacters
|
|
48
|
+
function ClipCharacters._onDescendantAdded(_self: ClipCharacters, originalTable, descendant: Instance)
|
|
43
49
|
if not originalTable[descendant] and descendant:IsA("BasePart") then
|
|
44
50
|
originalTable[descendant] = descendant.CollisionGroup
|
|
45
51
|
descendant.CollisionGroup = ClipCharactersServiceConstants.COLLISION_GROUP_NAME
|
|
46
52
|
end
|
|
47
53
|
end
|
|
48
54
|
|
|
49
|
-
function ClipCharacters
|
|
55
|
+
function ClipCharacters._onDescendantRemoving(_self: ClipCharacters, originalTable, descendant)
|
|
50
56
|
if originalTable[descendant] then
|
|
51
57
|
descendant.CollisionGroup = originalTable[descendant]
|
|
52
58
|
originalTable[descendant] = nil
|
|
53
59
|
end
|
|
54
60
|
end
|
|
55
61
|
|
|
56
|
-
function ClipCharacters
|
|
62
|
+
function ClipCharacters._setupCharacter(self: ClipCharacters, maid: Maid.Maid, character: Model)
|
|
57
63
|
local originalTable = {}
|
|
58
64
|
|
|
59
65
|
maid:GiveTask(character.DescendantAdded:Connect(function(descendant)
|
|
@@ -77,4 +83,4 @@ function ClipCharacters:_setupCharacter(maid, character)
|
|
|
77
83
|
end
|
|
78
84
|
end
|
|
79
85
|
|
|
80
|
-
return ClipCharacters
|
|
86
|
+
return ClipCharacters
|
|
@@ -6,13 +6,13 @@ local require = require(script.Parent.loader).load(script)
|
|
|
6
6
|
|
|
7
7
|
local ClipCharacters = require("ClipCharacters")
|
|
8
8
|
local Maid = require("Maid")
|
|
9
|
+
local ServiceBag = require("ServiceBag")
|
|
9
10
|
local StateStack = require("StateStack")
|
|
10
|
-
local _ServiceBag = require("ServiceBag")
|
|
11
11
|
|
|
12
12
|
local ClipCharactersServiceClient = {}
|
|
13
13
|
ClipCharactersServiceClient.ServiceName = "ClipCharactersServiceClient"
|
|
14
14
|
|
|
15
|
-
function ClipCharactersServiceClient:Init(serviceBag:
|
|
15
|
+
function ClipCharactersServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
16
16
|
assert(not self._serviceBag, "Already initialized")
|
|
17
17
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
18
18
|
self._maid = Maid.new()
|
|
@@ -29,20 +29,22 @@ function ClipCharactersServiceClient:PushDisableCharacterCollisionsWithDefault()
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
function ClipCharactersServiceClient:Start()
|
|
32
|
-
self._maid:GiveTask(self._disableCollisions
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
self._maid:GiveTask(self._disableCollisions
|
|
33
|
+
:ObserveBrio(function(value)
|
|
34
|
+
return value
|
|
35
|
+
end)
|
|
36
|
+
:Subscribe(function(brio)
|
|
37
|
+
if brio:IsDead() then
|
|
38
|
+
return
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
local maid = brio:ToMaid()
|
|
42
|
+
maid:GiveTask(ClipCharacters.new())
|
|
43
|
+
end))
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
function ClipCharactersServiceClient:Destroy()
|
|
45
47
|
self._maid:DoCleaning()
|
|
46
48
|
end
|
|
47
49
|
|
|
48
|
-
return ClipCharactersServiceClient
|
|
50
|
+
return ClipCharactersServiceClient
|
|
@@ -6,14 +6,14 @@ local require = require(script.Parent.loader).load(script)
|
|
|
6
6
|
|
|
7
7
|
local PhysicsService = game:GetService("PhysicsService")
|
|
8
8
|
|
|
9
|
-
local Maid = require("Maid")
|
|
10
9
|
local ClipCharactersServiceConstants = require("ClipCharactersServiceConstants")
|
|
11
|
-
local
|
|
10
|
+
local Maid = require("Maid")
|
|
11
|
+
local ServiceBag = require("ServiceBag")
|
|
12
12
|
|
|
13
13
|
local ClipCharactersService = {}
|
|
14
14
|
ClipCharactersService.ServiceName = "ClipCharactersService"
|
|
15
15
|
|
|
16
|
-
function ClipCharactersService:Init(serviceBag:
|
|
16
|
+
function ClipCharactersService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
17
17
|
assert(not self._serviceBag, "Already initialized")
|
|
18
18
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
19
19
|
self._maid = Maid.new()
|
|
@@ -30,4 +30,4 @@ function ClipCharactersService:Destroy()
|
|
|
30
30
|
self._maid:DoCleaning()
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
return ClipCharactersService
|
|
33
|
+
return ClipCharactersService
|