wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
552 stars 332 forks source link

Possible wiremod expression2 constraintcore rope-constraint setLength() bug #3090

Open raven1934 opened 3 months ago

raven1934 commented 3 months ago

Hello, a project of mine requires a rope constraint that is updating it's length during run, I tried to use winch for this but due to winches custom physics that make it super unrealistic on its behaviour, I tried to replicate what my goal was in rope-constraints, but for some reason even if the documentation of e2 says you can set rope constraints lengths by setLength() it doesn't work as expected but rather nothing happens.

I'll post here the rough setup of my project in hopes someone knows whether this is a bug or limitation to the rope-constraint itself:

To create rope constrain during the initialization of chip: rope(1,SubObject,vec(0,0,0),MainObject,vec(0,0,0),0,0.2,"cable/cable2")

During the running on update loop: SubObject:setLength(1,sin(EllapsedTime25)20)

According to wiremod documentation: Entity:setLength(Number Index, Number Length) - Sets the length of a winch/hydraulic/rope stored in this entity at a referenceid

If you have any information on how to fix it on my side or in the constraintcore, all help is appreciated.

thegrb93 commented 3 months ago

Might be a gmod bug. Starfall doesn't have the ability to set rope lengths either. You can try doing it with an elastic though.

Fasteroid commented 2 months ago

I also experienced this when designing my E2 wrecking ball mech, but I worked around it by destroying and recreating the rope as needed. Should probably look into fixing this though.