Difference between revisions of "RampRumble - ObjectReference"

Jump to navigation Jump to search
imported>JustinOther
m (→‎Examples: Floatified float parameter)
imported>Thingy Person
 
Line 7: Line 7:
== Syntax ==
== Syntax ==
<source lang="papyrus">
<source lang="papyrus">
bool Function RampRumble(float power = 0.5, float duration = 0.25, float falloff = 1600.0)
bool Function rampRumble(float power = 0.5, float duration = 0.25, float falloff = 1600.0)
if power > 1.0 || power <= 0
endif
float playerDist = game.getplayer().getDistance(self)
if playerDist < falloff
float intensity = (1 - (playerDist / falloff))
intensity = intensity*power
if intensity > 1.0
intensity = 1.0
elseif intensity <= 0
intensity = 0
return false
endif
game.shakeCamera(game.getPlayer(), intensity)
game.shakeController(intensity, intensity, duration)
return true
else
return False
endif
endFunction
</source>
</source>


Navigation menu