Itās for this, I define other variables such as services normally while leaving out the rest
I dunno, the standard for roblox is that you use camel case for normal/temporary variables, Iāve just never seen it thatās all :V
I fixed that and yet the packet still refuses to send anything to the client, I genuinely donāt know whatās the cause anymore.
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
nice thanks for sharing I did not read the anoucments of buffers so was not aware
thatās intended behaviour because the value is floored when its converted from a float to a Integer
math.floor(10.5) = 10
math.floor(-10.5) = -10
it really depends on your usecase feel free to use any type you like its not mandatory to use the smallest type but its there if anyone needs it
When adding to a minus the value goes down though -10 + 0.5 is -9.5 which is floored to -9 isnāt it?
yes so adding 0.5 would be like adding 1 because it gets floored
and subtracting 0.5 from a positive number would be like subtracting 1
I donāt think your understanding my point
When a negative number is passed into the function say -9 it adds to make it -8.5 as you are adding then floors it to be -8 whereas if that was a positive number then that would be 9.5 then floored to 9. It creates a difference between the values
If you pass in a vector 2 s16 of 0,-2 it would come out as 0,-1
local Packet = require(ReplicatedStorage.Packet)
local Something = Packet("Something", {[Packet.String] = Packet.Vector3F24})
How would you do something like this? This example code wonāt work.
Can anyone tell me what this error means???
Iāve been getting a few errors like this regarding the Packet Module.
Iāve also gotten āAttempt to index nil with ResponseParametersā
And i do not think iāve done anything wrong
It comes from this line 329 inside the module
oh OK I get it now your talking about the vector types where we use signed types OK Iāll fix that in next update
local Packet = require(ReplicatedStorage.Packet)
local Something = Packet("Something", Packet.Any)
but this is not as efficient as pre defining the keys as now the module will also need to send the key
this means it was not able to find the packet
this can happen because
-
the packet was not setup on both server and client
-
packets have different types defined on server and client
make sure you setup the packets as soon as the server starts
I am doing just that, i even printed how many times they were being made to see if i had any dupes that had different types, i made this packet twice on server and client and these are the types on all of them:
CLIENT:
SERVER:
Keep in mind that im using the PACKET.Any Type because the previous type i was using was not working, even though i was sending the correct datatype and value, i even checked multiple times using prints inside the Packet module.
(And as you can also see they are setup when the server starts, also indicated by the line number being very low)
(Another note is that, in Studio there is no error but when i go into my ROBLOX Game this error pops up)