Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Speedflips 0.1
- 'A Quick Flipper Speedhack by NF
- 'Needs two triggers around each flipper named TriggerLF and TriggerRF
- 'Recommended flipper strength: 5000-6000 @ mass 1
- '(Any faster will cause the flipper code to break)
- 'the faster the flipper, the more sharp the shots will get.
- 'Bugs:
- 'Triggers can cause stutter if they trigger multiple times very quickly. Haven't seen this happen yet but it's possible
- 'Flippers
- dim m1, m2, m3, m4
- 'adjust speed coefficient here
- '(Coordinates. x = IN ball velocity, y = OUT ball speed coefficient)
- 'x1, y1, x2, y2
- m1 = 1 : m2 = 1 : m3 = 220 : m4 = 0
- dim RFon, LFon : LFon = True : RFon = True
- Sub FalloffnF(ThresholdMin, Y1, ThresholdMax, Y2) 'thresholdmin, bounce% #1, thresholdmax, bounce% #2 - falloff between these two points
- dim FinalSpeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- if finalspeed < ThresholdMin then exit sub 'if ball is below minimum threshold
- ' if finalspeed < ThresholdMin then : tb1.text = finalspeed : exit sub 'if ball is below minimum threshold
- Dim SlopeMath, ModElast
- SlopeMath = (Y2 - Y1) / (ThresholdMax - ThresholdMin)
- ModElast = SlopeMath * (FinalSpeed - ThresholdMax) + Y2
- if finalspeed > ThresholdMax then ModElast = Y2 'ball is above max threshold
- activeball.velx = activeball.velx * ModElast
- activeball.vely = activeball.vely * ModElast
- ' playsound "woodhit", 0, 10 'debug stuff
- ' tbFlipper.text = ModElast & " slope?:" & slopemath & vbnewline & _
- ' finalspeed & "-> " & SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- ' TBflipper.TimerEnabled = 1
- End Sub
- Sub TBflipper_Timer() : me.timerenabled = 0 : me.text = "..." : End Sub 'clear debug box
- leftflipper.eostorque = (2175/leftflipper.strength) : rightflipper.eostorque = leftflipper.eostorque
- TriggerLF.TimerInterval = 32 : TriggerRF.TimerInterval = 32
- Sub TriggerLF_Timer(): LFon = False : me.TimerEnabled = 0 : End Sub
- Sub TriggerLF_UnHit(): if LFon then FalloffnF m1, m2, m3, m4 End If : End Sub
- Sub TriggerRF_Timer(): RFon = False : me.TimerEnabled = 0 : End Sub
- Sub TriggerRF_UnHit(): if RFon then FalloffnF m1, m2, m3, m4 End If : End Sub
- 'Modify your flipper subs to add these two lines...
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_FlipperUp",DOFContactors), 0, LVL(0.5), -0.1, 0.1
- LeftFlipper.RotateToEnd
- TriggerLF.TimerEnabled = 1 'speed hack
- LFon = True 'speed hack
- Else
- PlaySound SoundFX("fx_FlipperDown",DOFContactors), 0, LVL(0.5), -0.1, 0.1
- LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_FlipperUp",DOFContactors), 0, LVL(0.3), 0.1, 0.1
- RightFlipper.RotateToEnd
- TriggerRF.TimerEnabled = 1 'speed hack
- RFon = True 'speed hack
- Else
- PlaySound SoundFX("fx_FlipperDown",DOFContactors), 0, LVL(0.3), 0.1, 0.1
- RightFlipper.RotateToStart
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement