Closed dvdvideo1234 closed 4 years ago
Literally all of my prop engines are affected by this bug. Here is the duplication: w16_roxx.txt . It is possible this can be related to this one , but in the latter, constraints to the prop-world are considered, instead of prop-prop.
The ghosted contraption is not affected by the checkbox Use World Angles
, only the spawned contraption is affected.
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
ENT:IsWorld()
checks in some cases when rotation is made ( no difference )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 SANE
manner:
CreateConstraint: Slider
[1]<Ent1> = [Entity]<Entity [110][gmod_wire_thruster]>{Entity [110][gmod_wire_thruster]}
[2]<Ent2> = [Entity]<Entity [113][prop_physics]>{Entity [113][prop_physics]}
[3]<Bone1> = [number]<0>{0}
[4]<Bone2> = [number]<0>{0}
[5]<LPos1> = [Vector]<-0.009991 0.002121 2.282107>{-0.009991 0.002121 2.282107}
[6]<LPos2> = [Vector]<0.001543 -18.000153 -6.999977>{0.001543 -18.000153 -6.999977}
[7]<width> = [number]<1>{1}
[8]<material> = [string]<cable/cable>{nil}
Create slider request
GMOD: Forcing sane values for slider constraint!
Create slider constraint: Entity [0][phys_slideconstraint]
Every time this GMOD: Forcing sane values for slider constraint!
is shown the bug is triggered. No exception!
It seems like when it moves it away it does something to it when the slider is created.
Thiggers this ( Source: Discord GMOD forum ) and i seems it is a gmod slider protection or something:
Merged here: https://github.com/Facepunch/garrysmod-issues/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:
CreateConstraint: Slider
[1]<Ent1> = [Entity]<Entity [69][gmod_wire_thruster]>{Entity [69][gmod_wire_thruster]}
[2]<Ent2> = [Entity]<Entity [66][prop_physics]>{Entity [66][prop_physics]}
[3]<Bone1> = [number]<0>{0}
[4]<Bone2> = [number]<0>{0}
[5]<LPos1> = [Vector]<-0.009991 0.002121 2.282107>{-0.009991 0.002121 2.282107}
LEN: 5.2081161168704
[6]<LPos2> = [Vector]<0.000514 -5.999893 -6.999992>{0.000514 -5.999893 -6.999992}
LEN: 84.998611726345
[7]<width> = [number]<1>{1}
[8]<material> = [string]<cable/cable>{nil}
Ent1Ang = 45.000 90.000 0.000
Ent2Ang = 0.000 90.000 0.000
EntityPos = 6.002121 10.255859 3.236801
Create slider request
[1]E: Entity [69][gmod_wire_thruster],Entity [69][gmod_wire_thruster]
[1]P: -183.668045 -76.585129 -9979.854492
[1]A: 45.000 90.000 0.000
[1]L: -0.009991 0.002121 2.282107
[2]E: Entity [66][prop_physics],Entity [66][prop_physics]
[2]P: -189.670166 -86.840988 -9983.090820
[2]A: 0.000 90.000 0.000
[2]L: 0.000514 -5.999893 -6.999992
WLEN:281.30494295392
LLEN:122.18164192589
GMOD: Forcing sane values for slider constraint!
Create slider constraint: Entity [0][phys_slideconstraint]
After slider
[1]P: -183.668045 -76.585129 -9979.854492
[1]A: 45.000 90.000 0.000
[2]P: -189.670166 -86.840988 -9983.090820
[2]A: 0.000 90.000 0.000
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 Hello, Done: https://github.com/wiremod/advdupe2/pull/316
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. Here is a version with removed Diff: https://github.com/wiremod/advdupe2/pull/316/files#diff-acb623eeeb53481b1e82274b16a2d0d4413abd6b7cf5f0b67f18950f566bdf54&?w=1
@thegrb93 This now fixed by @Rubat on the pre-release branch of GMOD. Cheers. You can merge the file if you like. I am closing this.
Kk