How to make a ground area mark that follows the crosshair

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Ground area mark that follows the crosshair[edit | edit source]

You can see the effect of this script in this video Script Type: Quest or Effect For a Quest script, use a GameMode block. For an Effect script, use a ScriptEffectUpdate block.
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.

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

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

end