Although it clearly needs more work, this thing has been distracting me from the rest of the jungle, so I've finally decided to stop trying to perfect it and give it over to whoever would like to make it better. It should be placed on an activator that uses either a bc_scum mesh or a water mesh from OOT.
I've tried to copy it exactly as I printed it out, so if I did a good job, then copy+pasting it right into a new script should work, though my typing skills have seen better days.
Code: Select all
begin TR_Po_WaterStepSound
;v1.13
short PCStartPosX
short PCStartPosY
short PCPosX
short PCPosY
short Move
short Step
short Sound
float Timer
float Switch
short speed
if ( MenuMode == 1 )
return
endif
set PCPosX to "player"->GetPos, X
set PCPosY to "player"->GetPos, Y
if ( Sound == 1 )
if ( Timer < Switch )
set Timer to Timer + GetSecondsPassed
return
else
set Sound to 0
set Timer to 0
endif
endif
if ( GetStandingPC == 1 )
if ( PCPosX != PCStartPosX )
set Move to 1
elseif ( PCPosY != PCStartPosY )
set Move to 1
endif
if ( Move == 1 )
if ( Step == 1 )
;if ( GetSoundPlaying "FootWaterRight" == 0 )
PlaySound, "FootWaterLeft"
set Step to 0
;endif
else
;if ( GetSoundPlaying "FootWaterLeft" == 0 )
PlaySound, "FootWaterRight"
set Step to 1
;endif
endif
set Sound to 1
set Move to 0
endif ;end move==1
set PCStartPosX to PCPosX
set PCStartPosY to PCPosY
if ( speed != player->GetSpeed )
if ( player->GetSpeed >= 100 )
set Switch to 0.375
elseif ( player->GetSpeed < 35 )
set Switch to 0.7
elseif ( player->GetSpeed < 65 )
set Switch to 0.5
elseif ( player->GetSpeed < 100 )
set Switch to 0.45
endif
set speed to "player"->GetSpeed
endif
endif ;end StandingPC == 1
end