Editing Useful Scripts
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 169: | Line 169: | ||
<small>For a Quest or Object script, use a [[GameMode]] block. For an Effect script, use a [[ScriptEffectUpdate]] block.<br />In order to use the EditorRefID of your reference in a script like this, it must be a persistent reference.</small> | <small>For a Quest or Object script, use a [[GameMode]] block. For an Effect script, use a [[ScriptEffectUpdate]] block.<br />In order to use the EditorRefID of your reference in a script like this, it must be a persistent reference.</small> | ||
<pre>float | <pre>float fAngleZ | ||
float fRelativePos | float fRelativePos | ||
Line 177: | Line 177: | ||
myREF.setPos z fRelativePos | myREF.setPos z fRelativePos | ||
set | set fAngleZ to player.GetAngle Z + <ANGLE OFFSET> | ||
myREF.SetAngle Z | myREF.SetAngle Z fAngleZ | ||
set fRelativePos to player.GetPos Y + <PLAYER OFFSET> * cos | set fRelativePos to player.GetPos Y + <PLAYER OFFSET> * cos fAngleZ | ||
myREF.SetPos Y fRelativePos | myREF.SetPos Y fRelativePos | ||
set fRelativePos to player.GetPos X + <PLAYER OFFSET> * sin | set fRelativePos to player.GetPos X + <PLAYER OFFSET> * sin fAngleZ | ||
myREF.SetPos X fRelativePos | myREF.SetPos X fRelativePos | ||
Line 190: | Line 190: | ||
<ul> | <ul> | ||
<li><Z OFFSET> determines the reference's z offset from the player's feet. The higher this is, the further above the player's feet the reference will appear. | <li><Z OFFSET> determines the reference's z offset from the player's feet. The higher this is, the further above the player's feet the reference will appear. | ||
</li> | </li> | ||
<li><ANGLE OFFSET> determines the reference's position relative to the players. As <ANGLE OFFSET> increases, the reference's position will move around the player in an anti-clockwise direction. When <ANGLE OFFSET> is 0, the reference will appear directly in front of the player.</li> | <li><ANGLE OFFSET> determines the reference's position relative to the players. As <ANGLE OFFSET> increases, the reference's position will move around the player in an anti-clockwise direction. When <ANGLE OFFSET> is 0, the reference will appear directly in front of the player.</li> |