ef2-ubertools-gdk/Documentation/content/scripting_globalscripts_common.html
2003-08-18 00:00:00 +00:00

505 lines
25 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_common.scr</p>
<p class="subheader">Dependancies</p>
<p> none</p>
<p class="subheader">Purpose</p>
<p> This script contains basic functions for use on all levels, along with
definitions for<br>
constansts that are used on all level</p>
<p class="subheader">How to use</p>
<p> See the description for each function</p>
<p>Constant variables that have been assigned:</p>
<p> FALSE = 0<br>
TRUE = 1<br>
NULL = -1</p>
<p>So as long as you include this global script, you can use these variables
in place of their assigned counterparts. One warning, and this is a problem
with the scripting language, when you initially declare your variable,
you can not set it equale to another variable. So for example this will
not work:</p>
<p>float newVariable = TRUE;</p>
<p>You have to assign it to an actual number value for the initialization,
and then anytime after that you can use the constants.</p>
<p class="subheader">External Functions</p>
<p> <strong>globalCommon_AssertEntity( entPassedEntity, strMessage )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Checks the passed in entity to see if it is valid. If it's not, the
game will stop and display the passed in message.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entPassedEntity</strong> (entity)<br>
This is the entity to perform the check on.<br>
<br>
</li>
<li> <strong>strMessage</strong> (string)<br>
This is the message to print on the screen before stopping the game.</li>
</ul>
<p> <strong>globalCommon_Autosave()</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Used to help simplify autosaving so people don't have to write as much
script. It performs an autosave when called.</p>
<p><strong>Parms:</strong><br>
None</p>
</blockquote>
<p> <strong>globalCommon_OnUse( entOnUseTargetname , strOnUseThread ) </strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
To simplify setting up of an onuse function by automating the pause
and thread assignment</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li><strong> entOnUseTargetname</strong> (entity)<br>
T his is the entity to wait for the 'onuse' action to occur.<br>
<br>
</li>
<li> <strong>strOnUseThread</strong> (string)<br>
T his is thread to execute when the object is used.</li>
</ul>
<p> <strong>globalCommon_OnDamage( entOnDamageTargetname, strOnDamageThread
) </strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
To simplify setting up of an ondamage function by automating the pause
and thread assignment</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entOnDamageTargetname</strong> (entity)<br>
This is the entity to wait for the 'ondamage' action to occur.<br>
<br>
</li>
<li> <strong>strOnDamageThread</strong> (string)<br>
T his is thread to execute when the object is damaged.</li>
</ul>
<p> <strong>globalCommon_OnTouch( entOnTouchTargetname, strOnTouchThread
)</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
To simplify setting up of an ontouch function by automating the pause
and thread assignment</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entOnTouchTargetname</strong> (entity)<br>
This is the entity to wait for the 'ontouch' action to occur.<br>
<br>
</li>
<li> <strong>strOnTouchThread</strong> (string)<br>
This is thread to execute when the object is touched.</li>
</ul>
<p> <strong>globalCommon_OnTrigger( entOnTriggerTargetname, strOnTriggerThread
) </strong> </p>
<blockquote>
<p> <strong>Purpose:</strong><br>
To simplify setting up of an ontrigger function by automating the pause
and thread assignment</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entOnTriggerTargetname</strong> (entity)<br>
This is the entity to wait for the 'ontrigger' action to occur.<br>
<br>
</li>
<li> <strong>strOnTriggerThread</strong> (string)<br>
This is thread to execute when the object is triggered.</li>
</ul>
<p> <strong>globalCommon_OnBlock( entOnBlockTargetname, strOnBlockThread
) </strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
To simplify setting up of an onblock function by automating the pause
and thread assignment</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entOnBlockTargetname</strong> (entity)<br>
This is the entity to wait for the 'onblock' action to occur.<br>
<br>
</li>
<li> <strong>strOnBlockThread</strong> (string)<br>
This is thread to execute when the object is blocked.</li>
</ul>
<p> <strong>globalCommon_AiDummyHide( entAiDummyToHide ) </strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Takes the passed in AI character, turns their AI off, hides them, and
makes them notsolid.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entAiDummyToHide</strong> (entity)<br>
This is the AI character to turn off, hide, and make notsolid.</li>
</ul>
<p> <strong>globalCommon_AiDummyShow( entAiDummyToShow )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Takes the passed in AI character, shows them, makes them solid, and
puts them in the 'idle' animation.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entAiDummyToShow</strong> (entity)<br>
This is the AI character to show, make solid, and set the 'idle' pose
on.</li>
</ul>
<p> <strong>globalCommon_AiActor( entAiActor )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Takes the passed in AI character, turns on their AI, makes them pushable,
shows them, and makes them solid.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entAiActor</strong> (entity)<br>
This is the AI character to effect.</li>
</ul>
<p> <strong>globalCommon_AiDummy ( entAiDummy , strAiDummyAnim )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Takes the passed in AI character, turns off their AI, makes them not
pushable, shows them, and sets the passed in animation.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>entAiDummy</strong> (entity)<br>
This is the AI character to effect.<br>
<br>
</li>
<li> <strong>strAiDummyAnim</strong> (string)<br>
This is the animation to set the character to. If &quot;&quot; is passed,
then it won't attempt to set any animation.</li>
</ul>
<p> <strong>globalCommon_AiActorUseWeapon( currentActor, weaponToUse )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Takes the passed in AI character and makes them use the passed in weapon.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>currentActor</strong> (entity)<br>
This is the AI character to affect.<br>
<br>
</li>
<li> <strong>weaponToUse</strong> (string)<br>
This is the weapon to make the actor use. If set to 'current', it will
use the weapon the player is using.</li>
</ul>
<p> <strong>globalCommon_SpawnScriptModel( spawnedTikiName, spawnedTargetName,
spawedOrigin, spawnedAngle )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Spawns a script model at the passed in origin, facing the passed in
angle.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>spawnedTikiName</strong> (string)<br>
This is the tiki to use.<br>
<br>
</li>
<li> <strong>spawnedTargetName</strong> (string)<br>
This is the targetname to give the script model.<br>
<br>
</li>
<li> <strong>spawedOrigin</strong> (vector)<br>
This is the origin to spawn it at.<br>
<br>
</li>
<li> <strong>spawnedAngle</strong> (float)<br>
This is the angle to face it after it's spawned.</li>
</ul>
<p> <strong>globalCommon_SpawnActor( spawnedTikiName, spawnedTargetName,
spawedOrigin, spawnedAngle )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Spawns an AI charcter at the passed in origin, facing the passed in
angle.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>spawnedTikiName</strong> (string)<br>
Tthis is the tiki to use.<br>
<br>
</li>
<li> <strong>spawnedTargetName</strong> (string)<br>
This is the targetname to give the AI character.<br>
<br>
</li>
<li> <strong>spawedOrigin</strong> (vector)<br>
This is the origin to spawn it at.<br>
<br>
</li>
<li> <strong>spawnedAngle</strong> (float)<br>
This is the angle to face it after it's spawned.</li>
</ul>
<p> <strong>globalCommon_ActorRandomNodePatrolWork( currentActor, nodePatrolWork,
animationToPlayPerNode, totalNumberOfNodes )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Used for characters who's AI will be off. Lets them constantly pick
amongst several pre- defined work nodes, walks them over to one, and
plays a passed in animation. Then loops to perform the same tasks.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>currentActor</strong> (entity)<br>
This is the AI character entity to perform this function on.<br>
<br>
</li>
<li> <strong>nodePatrolWork</strong> (string)<br>
This is the identifier for all nodes this charcater can pick from.<br>
<br>
</li>
<li> <strong>animationToPlayPerNode</strong> (string)<br>
This is the animation to play once the character reaches a node.<br>
<br>
</li>
<li> <strong>totalNumberOfNodes</strong> (float)<br>
This is the total number of nodes in the group.</li>
</ul>
<p> <strong>globalCommon_ActorRandomNodeWork( currentActor, nodePatrolWork,
animationToPlayPerNode, totalNumberOfNodes )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Used for characters who's AI will be off. Lets them pick amongst several
pre- defined work nodes, walks them over to one, and plays a passed
in animation. This function does not loop.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>currentActor</strong> (entity)<br>
This is the AI character entity to perform this function on.<br>
<br>
</li>
<li> <strong>nodePatrolWork</strong> (string)<br>
This is the identifier for all nodes this charcater can pick from.<br>
<br>
</li>
<li> <strong>animationToPlayPerNode</strong> (string)<br>
This is the animation to play once the character reaches a node.<br>
<br>
</li>
<li> <strong>totalNumberOfNodes</strong> (float)<br>
This is the total number of nodes in the group.</li>
</ul>
<p> <strong>globalCommon_ActorNodeWork( currentActor, nodePatrolWork, animationToPlayPerNode,
nodeToWorkAt )</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Used for characters who's AI will be off. Takes the passed in specific
node of a defined group of work nodes, walks them over to it, and plays
a passed in animation. This function does not loop.</p>
</blockquote>
<ul type="square">
<strong>Parms:</strong>
<li> <strong>currentActor</strong> (entity)<br>
This is the AI character entity to perform this function on.<br>
<br>
</li>
<li> <strong>nodePatrolWork</strong> (string)<br>
This is the identifier for all nodes this charcater can pick from.<br>
<br>
</li>
<li> <strong>animationToPlayPerNode</strong> (string)<br>
This is the animation to play once the character reaches a node.<br>
<br>
</li>
<li> <strong>nodeToWorkAt</strong> (float)<br>
This is the number of the node in the group of nodes to work at.</li>
</ul>
<p> <strong>globalCommon_SetupContextDialog( currentActor, theActorName
)</strong></p>
<blockquote>
<p> <strong>Purpose:</strong><br>
Loads all the +use and context sensitive dialog on the passed in teammate,
provided there is dialog recorded for that teammate.</p>
</blockquote>
<ul type="square"><strong>Parms:</strong>
<li> <strong>currentActor</strong> (entity)<br>
This is the AI character entity to perform this function on.<br>
<br>
<li> <strong>theActorName</strong> (string)<br>
This is the string used to concactinate the .mp3 file names for all
the context dialog. The only possible choices are:
<ul>
<li>&quot;telsia&quot;
<li>&quot;jurot&quot;
<li>&quot;chell&quot;
<li>&quot;chang&quot;
<li>&quot;korban&quot;
</ul>
</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>