There aren’t any error messages and the thread still goes on. I also tried to reduce the amounts of packets firing but still nothing happens. Other events seem to fire fine.
Incredible post! I’ve honestly never used packets in my projects before, and I’m new to scripting. The fact that something like this is open sourced with a provided tutorial, you’re doing beautiful things. Keep up the good work Suphi!
The packet is defined normally in the same script that had the working the same packet, I’m only using ONE packet, it works normally in other scripts including the same one I’m having issues in, but the snippet I posted refuses to send calls to the client.
The types I’m sending are all strings.
local _clientReplicate = _clientReplicator("_replicateEffects", _clientReplicator.String, {_clientReplicator.Any})
first thing you might notice is that Packet gives you more choice
you can have a vector3 that uses 6, 9, or 12 bytes where with bytenet there is only 12 byte vector3s
and for cframes packet has options 12, 15, 18 byte cframes where bytnet only has 24 byte cframes
another thing you might notice is that packet support many more types just to show a few
@Client
_effectsModule.a4a_packetsMain("_replicateEffectsMessage", _effectsModule.a4a_packetsMain.String, {_effectsModule.a4a_packetsMain.Any}):Connect(function(_effectName: string, ...)
print(_effectName, ...)
local _effectName: string = _effectName
if _effectsModule[_effectName] then
if type(_effectsModule[_effectName]) == "table" then
_effectsModule[_effectName][table.unpack(...)]()
return
end
_effectsModule[_effectName](table.unpack(...))
end
end)
@Server
local _clientReplicator = require("../../../../ReplicatedFirst/_Modules/a4a_packetsMain")
local _clientReplicate = _clientReplicator("_replicateEffects", _clientReplicator.String, {_clientReplicator.Any}) -- bugged packet that didn't send calls to client
local _clientReplicateMessage = _clientReplicator("_replicateEffectsMessage", _clientReplicator.String, {_clientReplicator.Any})
local _nemesisDialog: string = module._playDialogeNPC(Player, _killedPlayerNPCName)
if _nemesisDialog then
_clientReplicateMessage:FireClient(_playerEverKilled, "a4a_doMessage", {_nemesisDialog, "nemesis"})
_clientReplicateMessage:FireClient(Player, "a4a_doMessage", {_nemesisDialog, "killstreak"})
print(true, 18, _nemesisDialog)
end
_clientReplicateMessage:Fire("a4a_doNemesis", {_generalAllString})
I know this is off topic, but why are you prefixing every variable with an _? To my knowledge you only do that for private table members, or for when you wanna define something without shadowing something else that’s already defined
maybe we don’t have access or any documentation that I’m aware of that explains what is happening under the hood but we could assume its compression but we don’t know how it works or what type of compression it is
This is a bit off topic but I am pretty sure I saw Float16 for this, in what cases would you want to use float16, wouldn’t it be too imprecise for anything, or am I just stupid.
Oh, yes it was mentioned by WheretIB on the buffer announcement post
IIRC it internally uses zstd compression.
You can force the compression on a buffer with HttpService:JSONEncode(buffer) and that would give you a base64 encoded result of the compressed buffer.
Noticed an issue with the Signed number format, if the value is negative and then you add the 0.5 the buffer will automatically round it up which can lead to an offset of about +1.
Not a huge deal but for some people who send in directional values that stack on top of eachother it can add up fast