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 fAngle
<pre>float fAngleZ
float fRelativePos
float fRelativePos


Line 177: Line 177:
myREF.setPos z fRelativePos
myREF.setPos z fRelativePos


set fAngle to player.GetAngle Z + <ANGLE OFFSET>
set fAngleZ to player.GetAngle Z + <ANGLE OFFSET>
myREF.SetAngle Z fAngle
myREF.SetAngle Z fAngleZ


set fRelativePos to player.GetPos Y + <PLAYER OFFSET> * cos fAngle
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 fAngle
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. If <Z OFFSET> should be determined by where the player is looking, this should be used:<pre>set fAngle to player.GetAngle X
<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.
set fRelativePos to player.GetPos Z - <PLAYER OFFSET> * sin fAngle
</pre>
</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>

Please note that all contributions to the Fallout3 GECK Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see GECK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)