ef2-ubertools-gdk/Documentation/content/scripting_globalscripts_acc...

454 lines
24 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ÜberTools Game Development Kit</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript">
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a name="top"></a>
<table width="702" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="../images/header.jpg" width="702" height="101" border="0"></td>
</tr>
<tr>
<td width=158 valign="top"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="menu">
<!-- Keep all menus within masterdiv-->
<div id="masterdiv">
<img src="../images/navigation.jpg" width="158" height="27"><br>
UberTools GDK
<div class="menutitle" onclick="SwitchMenu('sub0')">&raquo; Introduction &amp; Contents</div>
<span class="submenu" id="sub0">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="../start.html">Introduction</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="../start.html#2">Utilities</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="../start.html#3">Source Files</a><br>
</span>
<br>Level Design<br>
<div class="menutitle" onclick="SwitchMenu('sub1')">&raquo; Setting Up UberRadiant</div>
<span class="submenu" id="sub1">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html">That Scary Error Msg</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#2">General Tab</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#3">Display Tab</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#4">User Interface Tab</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#5">Keyboard Shortcuts Tab</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#6">Colors Tab</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_setup.html#7">Game / Paths Tab</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub2')">&raquo; Building Your First Room</div>
<span class="submenu" id="sub2">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html">Editor Interface Basics</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#2">Choosing Your Textures</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#3">Building The Room</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#4">Adding a Light</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#5">Adding a Player Start</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#6">Compiling Your Level</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_firstroom.html#7">Viewing the Level</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub3')">&raquo; Constructing Terrain</div>
<span class="submenu" id="sub3">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_terrain.html">Setting up the Tools</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_terrain.html#2">Creating Terrain</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_terrain.html#3">Modifying the Textures</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="radiant_terrain.html#4">Adding More Terrain</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub4')">&raquo; Additional Reference</div>
<span class="submenu" id="sub4">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="ldesign_lighting.html">Lighting System</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="ldesign_terrain.html">Terrain Texture Blending</a><br>
</span>
<br>Scripting<br>
<div class="menutitle" onclick="SwitchMenu('sub5')">&raquo; Scripting Tutorials</div>
<span class="submenu" id="sub5">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_syntax.html">Scripting Syntax</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_waves.html">Spawning Waves</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_flying.html">Creating Flying Creatures</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_tripwires.html">Setting Up Tripwires</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub6')">&raquo; Global Script Synopsis</div>
<span class="submenu" id="sub6">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts.html">Introduction</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_accelmove.html">global_accelerated</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_accelmove.html">Movement.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_archetype.html">global_archetype.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_array.html">global_array.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_cinefx.html">global_cinematicFX.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_common.html">global_common.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_debug.html">global_debugUtils.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_flyin.html">global_flyin.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_math.html">global_math.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_ploadout.html">global_playerLoadout.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_soundpan.html">global_soundPan.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_spawnwave.html">global_spawnWave.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_transport.html">global_Transport.scr</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="scripting_globalscripts_tripwire.html">global_tripwire.scr</a><br>
</span>
<div class="menutitle" onclick="SwitchMenu('sub7')">&raquo; Classes Reference</div>
<span class="submenu" id="sub7">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="allclasses_g.html">Game Module</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="allclasses_cl.html">Client Module</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="allclasses_cg.html">Client Game Module</a><br>
</span>
<br>Older Documentation<br>
<div class="menutitle" onclick="SwitchMenu('sub8')">&raquo; Heavy Metal FAKK2</div>
<span class="submenu" id="sub8">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_camera.html">Camera Documentation</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_clientsidecmds.html">Client Side Commands</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_gui.html">GUI Documentation</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_ingameutils.html">In-Game Utilities</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_max2skl.html">MAX2SKL Reference</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_shadermanual.html">Shader Manual</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_soundsystem.html">Sound System</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="fakk2_tiki.html">TIKI Model System</a><br>
</span>
<br>Other<br>
<div class="menutitle" onclick="SwitchMenu('sub9')">&raquo; Web Links &amp; Credits</div>
<span class="submenu" id="sub9">
&nbsp;&nbsp;&nbsp;&nbsp;<a href="other_links.html">Web Links</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="other_credits.html">Credits</a><br>
</span>
</div>
</td>
</tr>
</table></td>
<td width="13" background="../images/vert_line.jpg"><img src="../images/vert_line.jpg" width="13" height="1"></td>
<td valign="top" width="533"><p class="header"><br>
global_acceleratedMovement.scr</p>
<p class="subheader">Dependencies</p>
<p> #include &quot;maps/global_scripts/global_common.scr&quot;<br>
#include &quot;maps/global_scripts/global_math.scr&quot;</p>
<p class="subheader">Purpose</p>
<p> Commands that move objects in accelerated ways</p>
<p class="subheader"> How To Use</p>
<p> Call these functions on a script object or script model in your level
passing the desired parameters.</p>
<p class="subheader">External Functions</p>
<p><strong>globalAccelMove_AxisAligned( entityName, totalTime, totalDistance,
moveDirection )</strong> </p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Moves a script object with acceleration along an axial path (up, down,
north, south, east, west) ADDENDUM - This is the older method, you should
use the new acceleration commands listed below</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entityName</strong> (string)<br>
The targetname of the script object to accelerate with no '$' in the
name.<br>
<br>
</li>
<li> <strong>totalTime</strong> (float)<br>
The total time it should take to move its distance.<br>
<br>
</li>
<li> <strong>totalDistance</strong> (float)<br>
Tthe distance it should move on it's choosen axis.<br>
<br>
</li>
<li> <strong>moveDirection</strong> (string)<br>
The axial direction to move .
<ul>
<li>up - moves the object up
<li>down - moves the object down
<li>north - moves the object north
<li>south - moves the object south
<li>east - moves the object east
<li>west - moves the object west
</ul>
</li>
</ul>
<p> <strong>globalAccelMove( entObject, vecMove, fltTime, strCurve, strSound
)<br>
globalAccelMoveX( entObject, fltDistance, fltTime, strCurve, strSound
)<br>
globalAccelMoveY( entObject, fltDistance, fltTime, strCurve, strSound
)<br>
globalAccelMoveZ( entObject, fltDistance, fltTime, strCurve, strSound
)<br>
</strong> </p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Move an object using one of 3 acceleration curve types in absolute directions.
This means using North, South, East, West movement commands rather than
relative movement commands.</p>
<p><strong>How to setup:</strong><br>
Make a script model or object that you wish to use. Call one of these
functions on it. If you want to wait until the move is finished before
proceeding in your script, call this function in-line. If you would
like your script to progress and not wait, then call this function with
the 'thread' command.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li><strong>entObject</strong> (entity)<br>
The script object to move with acceleration.<br>
<br>
</li>
<li><strong>vecMove</strong> (vector)<br>
The distance to move for X, Y, and Z axis. You enter the distance you
want the object to move on all 3 axis from it's current position. So
X handles the East/West motion, Y handles the North/South motion, and
Z handles the Up/Down motion.<br>
<br>
Positive X is East, negative X is West, positive Y is North, negative
Y is South, positive Z is Up, negative Z is Down. Syntax for vectors
are 'x y z' with the apostraphe's. So as an example, a value of '512
-256 64' will make the object move East 512 units, South 256 units,
and Up 64 units.<br>
<br>
OR<br>
<br>
<strong>fltDistance</strong> (float)<br>
ONLY when using one of the single axis commands, just pass the distance
for that axis only.<br>
<br>
</li>
<li><strong>fltTime</strong> (float)<br>
The time to take for the move, just like the .time parameter on an object.<br>
<br>
</li>
<li> <strong>strCurve</strong> (string)<br>
The acceleration curve to use, there are 3 options: <br>
<ul>
<br>
<li>rampup - this will make the object start from still and ramp up
to it's maximum velocity
<li>rampdown - this will make the object start at maximum velocity
and slow down to still
<li>rampupdown - this will make the object start from still, ramp
up to it's maximum velocity, the slow down to still again
<li>&quot;none&quot; - this will make the object move linearly (with
no acceleration) <br>
<br>
</ul>
<li>strSound - string, a path to the sound to play on this object as it
moves. The sound will start playing the moment it moves. Entering &quot;&quot;
will play no sound.</li>
</ul>
<p> <strong>globalAccelMove_Relative(entObject, vecMove, fltTime, strCurve,
strSound)<br>
globalAccelMove_RelativeX(entObject, fltDistance, fltTime, strCurve, strSound)<br>
globalAccelMove_RelativeY(entObject, fltDistance, fltTime, strCurve, strSound)<br>
globalAccelMove_RelativeZ(entObject, fltDistance, fltTime, strCurve, strSound)
</strong></p>
<blockquote>
<p> <strong>Purpose:<br>
</strong>Move an object using one of 3 acceleration curve types in a
relative movement. This means using Right, Left, Forward, Backward movement
commands. The forward direction is determined by the 'angle' keyvalue
set on the object. ADDENDUM: Relative movement commands only work on
an objects horizontal axis, or straight up / down. This means that you
can not face an object South and Down and expect it to move Forward
in that direction. It would only move forward on it's horizontal axis,
but not Down.</p>
<p><strong>How to setup:</strong><br>
Make a script model or object that you wish to use. Call on of these
functions on it. If you want to wait until the move is finished before
proceeding in your script, call this function in-line. If you would
like your script to progress and no wait, then call this function with
the 'thread' command.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entObject</strong> (entity)<br>
The script object to move with acceleration.<br>
<br>
</li>
<li><strong>vecMove</strong> (vector)<br>
The distance to move for X, Y, and Z axis. You enter the distance you
want the object to move on all 3 axis from it's current position. So
X handles the Right/Left motion, Y handles the Forward/Backward motion,
and Z handles the Up/Down motion.<br>
<br>
Positive X is Right, negative X is Left, positive Y is Forward, negative
Y is Backward, positive Z is Up, negative Z is Down. Syntax for vectors
are 'x y z' with the apostraphe's. So as an example, a value of '512
-256 64' will make the object move Right 512 units, Backward 256 units,
and Up 64 units.<br>
<br>
OR<br>
<br>
<strong>fltDistance</strong> (float)<br>
ONLY when using one of the single axis commands, just pass the distance
for that axis only.<br>
<br>
</li>
<li><strong>fltTime</strong> (float)<br>
The time to take for the move, just like the .time parameter on an object.<br>
<br>
</li>
<li> <strong>strCurve</strong> (string)<br>
The acceleration curve to use, there are 3 options:<br>
<br>
<ul>
<li>&quot;rampup&quot; - this will make the object start from still
and ramp up to it's maximum velocity.
<li>&quot;rampdown&quot; - this will make the object start at maximum
velocity and slow down to still.
<li>&quot;rampupdown&quot; - this will make the object start from
still, ramp up to it's maximum velocity, the slow down to still
again.
<li>&quot;none&quot; - this will make the object move linearly (with
no acceleration)<br>
<br>
</ul>
</li>
<li> <strong>strSound</strong> (string)<br>
A path to the sound to play on this object as it moves. The sound will
start playing the moment it moves. Entering &quot;&quot; will play no
sound.
</ul>
<p> <strong>globalAccelMove_Rotate( entObject, vecMove, fltTime, strCurve,
strSound )<br>
globalAccelMove_RotateX( entObject, fltDistance, fltTime, strCurve, strSound
)<br>
globalAccelMove_RotateY( entObject, fltDistance, fltTime, strCurve, strSound
)<br>
globalAccelMove_RotateZ( entObject, fltDistance, fltTime, strCurve, strSound
)</strong>
<blockquote>
<p> <strong>Purpose:</strong><br>
Rotate an object using one of 3 acceleration curve types.</li> </ul>
</p>
<p><strong>How to setup:</strong><br>
Make a script model or object that you wish to use. Call this function
on it. If you want to wait until the move is finished before proceeding
in your script, call this function in-line. If you would like your script
to progress and no wait, then call this function with the 'thread' command.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entObject</strong> (entity)<br>
The script object to rotate with acceleration.<br>
<br>
</li>
<li><strong>vecMove</strong> (vector)<br>
The rotational distance in degrees on X, Y, and Z axis. Positive or
negative controls the direction (positive is counterclockwise, negative
is clockwise). Syntax for vectors is 'x y z' (with the apostrophes).<br>
<br>
OR<br>
<br>
<strong>fltDistance</strong> (float)<br>
ONLY when using one of the single axis commands, just pass the distance
for that axis only.<br>
<br>
</li>
<li><strong>fltTime</strong> (float)<br>
The time to take for the move, just like the .time parameter on an object.<br>
<br>
</li>
<li> <strong>strCurve</strong> (string), <br>
The acceleration curve to use, there are 3 options:<br>
<br>
<ul>
<li>&quot;rampup&quot; - this will make the object start from still
and ramp up to it's maximum velocity
<li>&quot;rampdown&quot; - this will make the object start at maximum
velocity and slow down to still
<li>&quot;rampupdown&quot; - this will make the object start from
still, ramp up to it's maximum velocity, the slow down to still
again
<li>&quot;none&quot; - this will make the object move linearly (with
no acceleration).<br>
<br>
</ul>
</li>
<li> strSound - string, a path to the sound to play on this object as
it moves. The sound will be start playing the moment it moves. Entering
&quot;&quot; will play no sound.</li>
</ul>
<p> <strong>globalAccelMove_Pendulum( entObject, vecMove, fltTime, fltFriction,
strSound )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Swings an object back and forth on the desired axis in a pendulum motion.</p>
<p><strong>How to setup:</strong><br>
Position and orient your script object in what would be the dead center
position (the bottom of the swing). Don't forget to have an origin brush
on the object if it's a script object. For a script model, bind it to
a script origin, then pass the script origin into this function)</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entObject</strong> (entity)<br>
The script object to perform the pendulum motion on vecMove - vector,
this is the amplitude of the pendulum swing per axis (half the total
arc) in degrees. So if you enter a value of 15 degrees on one axis,
the full swing will be 30 degrees on that axis. Syntax for vectors is
'x y z' (with the apostrophes).</li>
<li> <strong>fltTime</strong> (float)<br>
The total time it takes to perform one full swing (from one extreme,
to the other extreme, and then back to the first extreme again).<br>
<br>
</li>
<li> <strong>fltFriction</strong> (float)<br>
This is a percentage value between 0 and 1. This is the percentage of
the amplitude that will be subtracted from the swing each time the object
passes through it's starting position. Enter a value of 0 for infinite
(frictionless).<br>
<br>
</li>
<li> <strong>strSound</strong> (string)<br>
A path to the sound to play on this object as it swings. The sound will
be played each time the object is at it's maximum outer extents and
swings on down to center.</li>
</ul>
<p>&nbsp;</p></td>
</tr>
<tr>
<td colspan="3"><img src="../images/footer.jpg" width="702" height="36" border="0" usemap="#Map"><br>
<img src="../images/hor_line.jpg" width="702" height="1"></td>
</tr>
<tr>
<td colspan="3" class="legal"><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="legal"> Copyright &copy;2003 Ritual Entertainment, Inc. All rights reserved.<br>
Please do not email Ritual Entertainment with questions about the
UberTools Game Development Kit. It is provided as is and is not supported by Ritual Entertainment.</td>
<td><a href="http://www.ritual.com/tech/overview.html" target="_blank"><img src="../images/uber_logo.jpg" width="43" height="56" hspace="4" border="0"></a></td>
<td><a href="http://www.ritual.com" target="_blank"><img src="../images/ritual_logo.jpg" width="100" height="56" hspace="4" border="0"></a></td>
</tr>
</table>
<p align="center">&nbsp;</p></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="601,10,693,28" href="#top">
</map>
</body>
</html>