Jump to content

Scripting Conflict with Slower Backpedaling and Triage


Centrofly

Recommended Posts

I have detected a conflict with the Slower Backpedaling mod and the Triage mod. Slower Backpedaling, as the name implies, slows down your character when moving backwards but does so by damaging your left leg and then restoring the damage done (presumably to overcome engine or scripting limitations). The issue is that if your left leg is crippled, it will damage it (which does nothing in that case) and then restore the damage done which effectively grants your left leg a sliver of health and thereby removes the crippled status. This is very annoying! Here is the script from Slower Backpedaling that is responsible for this (backPedalAgility is a global to determine whether or not agility should affect your backpedaling speed):

 

Scriptname BackPedalScript

short healOnce
short backSpeed
short isBacking

Begin GameMode

if(isBacking == 0)
if(backPedalAgility == 1)
	set backSpeed to -80 + player.getav agility * 10
	if (backSpeed > 0)
		set backSpeed to 0
	endif
else
	set backSpeed to -100 + BackPedalSpeed
endif
endif

;Repairs the damage we did to the player's leg
if(healOnce == 1)
player.Restoreav LeftMobilityCondition 1
set healOnce to 0
endif

if(player.IsMoving == 2 && isBacking == 0 && player.isRunning == 1)
set isBacking to 1
player.modav SpeedMult backSpeed

player.Damageav LeftMobilityCondition 1 ;Damages the player's leg in order to force the game to reevaluate the player's speed
set healOnce to 1
endif

if(isBacking == 1 && (player.IsMoving != 2 || player.isRunning == 0))
set isBacking to 0
set backSpeed to backSpeed  * -1
player.modav SpeedMult backSpeed

player.Damageav LeftMobilityCondition 1
set healOnce to 1
endif

End

 

Now, I know very little about scripting and I don't know how to fix this issue. My thoughts are that the script should check to see if the leg is already crippled and if so, prevent the script from adding health back to the crippled leg. I don't know if such a fix would cause other problems, though. Does anyone with some scripting experience know how to go about resolving this issue?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...