@@ -23,11 +23,11 @@ function Create(self)
23
23
self .fireVel = 40 -- This immediately overwrites the .ini FireVel
24
24
self .maxLineLength = 400 -- Shorter rope for faster gameplay
25
25
self .setLineLength = 0
26
- self .lineStrength = 40 -- How much " force" the rope can take before breaking
26
+ self .lineStrength = 10000 -- EXTREMELY HIGH force threshold - virtually unbreakable (was 120)
27
27
28
28
self .limitReached = false
29
- self .stretchMode = false -- Alternative elastic pull mode a là Liero
30
- self .stretchPullRatio = 0.01 -- How much the rope stretches when pulling in stretch mode
29
+ self .stretchMode = false -- Disabled for rigid rope behavior
30
+ self .stretchPullRatio = 0.0 -- No stretching allowed for rigid rope
31
31
self .pieSelection = 0 -- 0 is nothing, 1 is full retract, 2 is partial retract, 3 is partial extend, 4 is full extend
32
32
33
33
self .climbDelay = 8 -- Faster climbing for shorter rope
@@ -45,17 +45,14 @@ function Create(self)
45
45
-- Rope physics variables from VelvetGrapple
46
46
self .currentLineLength = 0
47
47
self .longestLineLength = 0
48
- self .cablespring = 0.15 -- VelvetGrapple constraint stiffness
48
+ self .cablespring = 0.01 -- Very low for completely rigid rope behavior (was 0.05)
49
49
50
50
-- Dynamic rope segment calculation variables
51
51
self .minSegments = 1 -- Minimum number of segments
52
52
self .maxSegments = 500 -- Maximum number of segments
53
53
self .segmentLength = 12 -- Target length per segment (increased for better performance)
54
54
self .currentSegments = self .minSegments -- Current number of segments
55
55
56
- -- Verlet physics friction for stability
57
- self .usefriction = 0.99 -- Matches VelvetGrapple
58
-
59
56
-- Mousewheel control variables
60
57
self .shiftScrollSpeed = 8.0 -- Faster rope control with Shift+Mousewheel
61
58
@@ -125,9 +122,9 @@ function Update(self)
125
122
self .ToDelete = false
126
123
self .ToSettle = false
127
124
128
- -- Make sure we have a minimum viable rope length to avoid issues
129
- if self .actionMode == 1 and self .currentLineLength < 1 then
130
- self .currentLineLength = math.max ( 1 , SceneMan : ShortestDistance ( self . parent . Pos , self . Pos , self . mapWrapsX ). Magnitude )
125
+ -- Make sure we have valid rope data, but allow zero length
126
+ if self .actionMode == 1 and self .currentLineLength < 0 then
127
+ self .currentLineLength = 0 -- Allow zero length compression
131
128
end
132
129
133
130
-- Update line length when in flight
@@ -172,8 +169,20 @@ function Update(self)
172
169
-- Attached mode - run full physics simulation
173
170
RopePhysics .updateRopePhysics (self , startPos , endPos , self .currentLineLength )
174
171
175
- -- Apply constraints to maintain rope structure and length
176
- RopePhysics .applyRopeConstraints (self , self .currentLineLength )
172
+ -- Apply constraints and check for rope breaking (extremely high threshold)
173
+ local ropeBreaks = RopePhysics .applyRopeConstraints (self , self .currentLineLength )
174
+ if ropeBreaks or self .shouldBreak then
175
+ -- Rope snapped due to EXTREME tension (500% stretch)
176
+ self .ToDelete = true
177
+ if self .parent and self .parent :IsPlayerControlled () then
178
+ -- Add screen shake and sound effect when rope breaks
179
+ FrameMan :SetScreenScrollSpeed (10.0 ) -- More dramatic shake for extreme break
180
+ if self .returnSound then
181
+ self .returnSound :Play (self .parent .Pos )
182
+ end
183
+ end
184
+ return -- Exit early since rope is breaking
185
+ end
177
186
end
178
187
179
188
-- Special handling for attached targets (MO grabbing)
@@ -205,13 +214,6 @@ function Update(self)
205
214
206
215
-- Draw the rope using the renderer module
207
216
RopeRenderer .drawRope (self , player )
208
-
209
- -- Show rope tension indicator when necessary
210
- RopeRenderer .showTensionIndicator (self , player )
211
-
212
- -- Show debug info temporarily to help diagnose issues
213
- local debugPos = self .Pos + Vector (10 , - 30 ) -- Define a position for debug text
214
- RopeRenderer .showDebugInfo (self , player , debugPos )
215
217
216
218
-- Update lineVec and lineLength based on current positions
217
219
self .lineVec = SceneMan :ShortestDistance (self .parent .Pos , self .Pos , self .mapWrapsX )
@@ -223,17 +225,29 @@ function Update(self)
223
225
self .Pos .Y = self .apy [self .currentSegments ]
224
226
end
225
227
226
- -- Update current line length based on action mode
228
+ -- Update current line length based on action mode - CENTRALIZED CONTROL
227
229
if self .actionMode == 1 and self .limitReached == false then
228
230
-- Always update rope length while in flight - rope should be tight
229
231
self .currentLineLength = self .lineLength
232
+ self .setLineLength = self .currentLineLength
230
233
elseif self .actionMode > 1 then
231
- -- When attached, maintain set line length for physics constraints
232
- -- currentLineLength should only be updated by player input or automatic climbing
234
+ -- When attached, currentLineLength is controlled by input/auto-climbing
235
+ -- Ensure it stays within bounds
236
+ self .currentLineLength = math.max (10 , math.min (self .currentLineLength , self .maxLineLength ))
237
+ self .setLineLength = self .currentLineLength
233
238
end
234
239
235
- -- Check if line length exceeds maximum
236
- RopeStateManager .checkLineLengthUpdate (self )
240
+ -- Single length limit check - removed redundant checkLineLengthUpdate call
241
+ if self .currentLineLength > self .maxLineLength then
242
+ self .currentLineLength = self .maxLineLength
243
+ self .setLineLength = self .maxLineLength
244
+ if not self .limitReached then
245
+ self .limitReached = true
246
+ self .clickSound :Play (self .parent .Pos )
247
+ end
248
+ else
249
+ self .limitReached = false
250
+ end
237
251
238
252
if self .parentGun and self .parentGun .ID ~= rte .NoMOID then
239
253
self .parent = ToMOSRotating (MovableMan :GetMOFromID (self .parentGun .RootID ))
@@ -340,15 +354,12 @@ function Update(self)
340
354
-- Process input based climbing
341
355
RopeInputController .handleRopePulling (self )
342
356
343
- -- Process terrain pull physics
344
- if self .actionMode == 2 and RopeStateManager .applyTerrainPullPhysics (self ) then
345
- self .ToDelete = true
346
- end
357
+ -- DISABLE force-based physics - using pure Verlet constraint system instead
358
+ -- The RopePhysics.applyRopeConstraints handles all position constraints
359
+ -- No need for additional spring forces that conflict with rigid constraints
347
360
348
- -- Process MO pull physics
349
- if self .actionMode == 3 and RopeStateManager .applyMOPullPhysics (self ) then
350
- self .ToDelete = true
351
- end
361
+ -- UNBREAKABLE ROPE: No automatic unhooking due to target destruction
362
+ -- Rope remains attached even if target MO is destroyed for maximum persistence
352
363
end
353
364
354
365
-- Check if we should unhook via double-tap mechanic
0 commit comments