-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Piston engine sliders are pasted with with constraint up/down instead of desired degree angle #306
Comments
|
I may look at this and related issue this weekend |
@thegrb93 Oke..Tell me if I can help somehow .. |
Ok... Modded the sv_clipboard.txt as:
for k, v in pairs(Ent.Constraints) do
-- Filter duplicator blocked constraints out.
if not v.DoNotDuplicate then index = v:GetCreationID()
if (index and not Constraints[index]) then Constraints[index] = v end
end
end
if(Constraint.Type:lower() == "slider" and Key == "material") then
Val = Val or "cable/cable"
else
Val = Val or false
end
What I received is quite interesting as every time the tool requests from GMod to create slider, an internal check is triggered, which defaults the arguments to a
Every time this |
Merged here: Facepunch/garrysmod-issues#4631 Slider lengths from the discord thread. The possible solution for really checking the slider length is by using world coordinates. local WPos1 = Ent1:LocalToWorld(LPos1)
local WPos2 = Ent2:LocalToWorld(LPos2)
if((WPos1 - WPos2):LengthSqr() < 1) then ..... Pretty sure that the length is not zero:
|
Debugging code: if(Constraint.Type:lower() == "slider") then
print("Create slider request")
print("[1]E: "..tostring(first)..","..tostring(Args[1]))
print("[1]P: "..tostring(first:GetPos()))
print("[1]A: "..tostring(first:GetAngles()))
print("[1]L: "..tostring(Args[5]))
print("[2]E: "..tostring(second)..","..tostring(Args[2]))
print("[2]P: "..tostring(second:GetPos()))
print("[2]A: "..tostring(second:GetAngles()))
print("[2]L: "..tostring(Args[6]))
local WPos1 = Args[1]:LocalToWorld(Vector(Args[5]))
local WPos2 = Args[2]:LocalToWorld(Vector(Args[6]))
print("WLEN:"..tostring((WPos1 - WPos2):LengthSqr()))
print("LLEN:"..tostring((Args[5] - Args[6]):LengthSqr()))
end |
The new sv_clipboard sv_clipboard.txt |
Could you pull request your changes? It would be cleaner and easier to review that way. |
Test Dev branch in an hour or so and @ me if it's fixed or not. |
@thegrb93 @robotboy655 |
Just the specific changes, not the code style corrections please. |
Keep code style corrections to their own PR. |
@thegrb93 This is intended for debugging purposes only. Do you mean you want to review and merge the PR.. ? If so I can easily change it ;) |
Ah ok, I didn't know it was just debug. Maybe separate the debug changes from the code style changes and have them as two PRs. That way you can have code style changes merged and we can actually see the debug stuff. |
@thegrb93 I will commit another mod, so to remove the debug prints and you can easily switch between them. |
Kk |
The text was updated successfully, but these errors were encountered: