Difference between revisions of "Useful Scripts"
Jump to navigation
Jump to search
no edit summary
imported>Cipscis (→Terminals: Changed script so that it also works for terminals that play a short animation when activated) |
imported>Skingrad24 |
||
Line 24: | Line 24: | ||
End | End | ||
</pre> | </pre> | ||
==Ground area mark that follows the crosshair== | |||
You can see the effect of this script in this [http://www.youtube.com/watch?v=Utc5SvInb3c video] | |||
Script Type: Quest or Effect | |||
<small>For a Quest script, use a [[GameMode]] block. For an Effect script, use a [[ScriptEffectUpdate]] block.<br>Instead of activator put the name of the activator or actor you want to use, in order to use the EditorRefID of your reference in a script like this, it must be a persistent reference.</small> | |||
<pre> | |||
float xang | |||
float zang | |||
float x | |||
float y | |||
float z | |||
float playerheight | |||
float lont | |||
begin gamemode | |||
set xang to player.getangle x | |||
set zang to player.getangle z * -1 + 90 | |||
;;;;;;;;;;The formula below was found by Skingrad24 and you must mention him in your credits, thisline must remain intact | |||
if xang <= 5 | |||
set lont to 1300; you can change this value if you need to | |||
else | |||
if player.issneaking == 0 | |||
set playerheight to 322 | |||
else | |||
set playerheight to 252 | |||
endif | |||
set lont to (playerheight*cos xang/sin xang * 0.34118010537042257764) | |||
endif | |||
set xang to player.getangle x * -1 | |||
set x to lont * cos xang * cos zang | |||
set y to lont * cos xang * sin zang | |||
Activator.moveto player x y 0 | |||
endif | |||
end | |||
</pre> | |||
==Forced Relative Orientation== | ==Forced Relative Orientation== |