#Steam Workshop::Roblox style camera
1 messages · Page 1 of 1 (latest)
no, why?
It produces weird results
like what?
could you send a vid?
Not at home
oh ok
what actually happens?
that is weird
this is the code that controls that
would it be because of those angle_p/y convars?
I've replace those with local variables and it still does that
i think i tried that initially
its annopying because SetupMove is the only shared relm hook
and CalcView only sets the variable on the client
yeah no it doesnt work
i think i figured out what was happening, i tried to make a fix but idk if it works. could you test it for me?
sure
thanks
I don't know why but when the addons in the server content pack it doesn't start but when I extract the lua files and put them in an addon they start
it's still not working on a server
and you left a print in
oh huh
also thats pretty weird
the only solution then is to have it only run on the server
maybe
ill try that
try again now?
thats super annoying
i did try one other thing, ill just send it directly to you to save trouble with the actuall addon
same thing
what do you think i could do?
Sets the serverside move angles, making the movement keys act as if player was facing that direction.
This function is predicted, and should be called shared with matching data on client and server.
thats what i did to this
oh
maybe this?
that's the function that should be called on both
?
FinishMove?
same context
Finish move makes me spin the direction I'm holding
that just means SetMoveAngles isnt being set
I'm not sure
im fairly sure its all because this isnt being set on the client for some reason
im not sure why
are the convars allowed to be called on server like that
could you quickly add a print(camAim)under that to see what comes out?
I don't think you can use convars like that on the server
per person
Maybe NWInt and NWBool?
like replace the convars with those?
yes
but this implies that if i set it on the client the server wont see any change
okay
i mean it works fine for most of the other hooks, but a big reason for using convars was that it seemed to be shared between the server and the client
really?
thatd make sense
but do these?
I don't know
I'm trying
local camAim
if CLIENT then camAim = Angle(GetConVar("roblox_cam_angle_p"):GetFloat(), GetConVar("roblox_cam_angle_y"):GetFloat(), 0) end
if SERVER then camAim = Angle(ply:GetNWInt("roblox_cam_angle_p"), ply:GetNWInt("roblox_cam_angle_y"), 0) end
print(camAim)```
it works
but it's laggy
if CLIENT then
local cacheP = 0
local cacheY = 0
hook.Add("InputMouseApply", "rbxCamCalc", function(cmd, x, y, angle)
local ply = LocalPlayer()
if not ply.rbxFreeCam then ply.rbxFreeCam = angle end
ply.rbxFreeCam.p = math.NormalizeAngle(ply.rbxFreeCam.p + y / 50)
ply.rbxFreeCam.y = math.NormalizeAngle(ply.rbxFreeCam.y - x / 50)
ply.rbxFreeCam.p = math.Clamp(ply.rbxFreeCam.p, -89, 89)
getAng(ply.rbxFreeCam)
if cacheP ~= ply.rbxFreeCam.p or cacheY ~= ply.rbxFreeCam.y then
cacheP = ply.rbxFreeCam.p
cacheY = ply.rbxFreeCam.y
net.Start("roblox_cam_angle")
net.WriteEntity(ply)
net.WriteInt(ply.rbxFreeCam.p, 32)
net.WriteInt(ply.rbxFreeCam.y, 32)
net.SendToServer()
end
if distChanged and GetConVar("roblox_cam_classic"):GetBool() then ply.rbxFreeCam.p = camSkew.p end
if GetConVar("roblox_cam_shiftlock"):GetBool() and not ply:InVehicle() or GetConVar("roblox_cam_dist"):GetInt() < 1 then return end
return true
end)
end
if SERVER then
util.AddNetworkString("roblox_cam_angle")
net.Receive("roblox_cam_angle", function(len)
local ply = net.ReadEntity()
local p = net.ReadInt(32)
local y = net.ReadInt(32)
ply:SetNWInt("roblox_cam_angle_p", p)
ply:SetNWInt("roblox_cam_angle_y", y)
print("recieved")
end)
end```
just need a better way to send data to the server in InputMouseApply
works fine in single player
what if instead of using NWInt you just used something like ply.rbxCamAngle
tried it and it seems to do the same thing
idk how itl react on multiplayer
might be exactly the same
oh ok
this works
still laggy
that kinda almost looks like its trying to aim towards where you were last standing
thats realy weird
I don't know how to network it better
idk if you can
do you want credit on the addon page?
are you using this?
yeah
sure
idk what else i could do
not have it work in multiplayer
for some reason the addon doesn't work in a content pack on the server
like as the .gma file?
as in +host_workshop_collection
idk, im not familiar with gmod servers
whats ur steam link?
no
oh ok