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

336 lines
20 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>
spawning waves</p>
<p>Dependencies<br>
(order dependant, as in it has to be included before the global_spawnWave.scr):</p>
<blockquote>
<p class="menu"> #include &quot;maps/global_scripts/global_common.scr&quot;<br>
#include &quot;maps/global_scripts/global_array.scr&quot;</p>
</blockquote>
<p>Actual script file:</p>
<blockquote>
<p class="menu"> #include &quot;maps/global_scripts/global_spawnWave.scr&quot;</p>
</blockquote>
<p>The way it works is that you place a bunch of spawners where you want
a group of guys to spawn in waves (you can have as many groups of spawners
as you like per level). You then run the setup function that defines the
behavior of how the waves of guys need to spawn for a single group. The
parameters you can setup are number or waves to spawn, the minimum number
of guys in a wave, the maximum number of guys in a wave, and the group
id that all the spawned guys will have when they spawn. When you're ready
to start the spawn group, call the function referencing that group and
voila. </p>
<p>Here's the breakdown on the specifics:</p>
<p class="subheader">Placing Spawners</p>
<p> First thing you need to do is place a bunch of spawners for a group.
Think about the maximum number of guys you want to be able to spawn in
a single wave of the group, and make sure that you have at LEAST that
many spawners available. The reason for this is when a wave spawns, it
will never use the same spawner twice for that particular wave to prevent
AI from spawning on top of themselves. So if you want a maximum of 5 AI
to spawn in a wave, and you only have 4 spawners, it won't work and the
script will report an error.</p>
<p class="subheader">Naming spawners</p>
<p> You can have as many spawning groups in your level as you like, but
each group has to have a unique name identifier. So for example, let's
say I'm creating a fight in engineering on the enterprise and I want a
group to spawn there. I'll name this group 'spawnEngineeringGroup' (without
the quotes of course :). This is what I'm going to reference the group
as from here on out. So, when I name my spawners, ALL of the spawners
have to start with this reference, followed by a number.<br>
<br>
The spawners should be numbered in sequence starting with 1. So, in my
example, let's say I want a maximum of 5 guys to spawn in a wave, so I
place 10 spawners around the room to give some variety in location. The
spawners would be named:</p>
<blockquote>
<p class="menu">$spawnEngineeringGroup1<br>
$spawnEngineeringGroup2<br>
$spawnEngineeringGroup3<br>
$spawnEngineeringGroup4<br>
$spawnEngineeringGroup5<br>
$spawnEngineeringGroup6<br>
$spawnEngineeringGroup7<br>
$spawnEngineeringGroup8<br>
$spawnEngineeringGroup9<br>
$spawnEngineeringGroup10</p>
</blockquote>
<p class="subheader">Setting up the Spawners</p>
<p>This global script will NOT setup the spawners for you. You still have
to set what model you want to spawn, if you want it to play beam in effects
or whatever. So you need to setup your spawners.</p>
<p class="subheader"> Running the Setup Function</p>
<p> After you've setup your spawners, at the start of your level, you need
to run this setup function:</p>
<blockquote>
<p class="menu">globalSpawnWave_Setup( strGroupName, intNumberOfSpawners,
intNumberOfWaves, intMinPerWave, intMaxPerWave, intWaveId )</p>
</blockquote>
<p>Now here are the parameters and what they mean:</p>
<ul type="square">
<li><strong>strGroupName</strong> (string)<br>
This is the unique name identifier you gave the group. In my example
case, this would be 'spawnEngineeringGroup' (of course minus the quotes
:). You HAVE TO HAVE a group name or the script will not work at all
because it has to know which group you are referencing!<br>
<br>
</li>
<li><strong>intNumberOfSpawners</strong> (float)<br>
This is the number of spawners you placed for this group. In my example
case, this would be set to 10. This parameter has to be set to at LEAST
1.<br>
<br>
</li>
<li><strong>intNumberOfWaves</strong> (float)<br>
T his is the number of waves you want spawned for this group. Meaning,
when the number of spawned AI that are alive falls below the minimum
allowed per wave that you set (which will be discussed next), then it
will spawn in another wave of AI in the group. This parameter has to
be set to at LEAST 1.<br>
<br>
</li>
<li><strong>intMinPerWave</strong> (float)<br>
This is the minimum number of guys that will spawn in a wave. When a
wave spawns, it randomly picks a value between the set minimum number
of guys and the set maximum number of guys. That value is how many AI
will spawn that wave. So if I have a minimum number of guys set to 3,
and a maximum number of guys set to 5, then for every wave that spawns
in that group, between 3 and 5 guys will spawn.<br>
<br>
The minimum number of guys value also serves as the defining point on
when to spawn in the next wave (if there are waves left to spawn). So
in this case, if the number of spawned AI that are alive falls from
3 guys, to 2 guys, it has now fallen below the set minimum number of
guys allowed and will attempt to spawn another wave in this group. This
parameter has to be set to at LEAST 1.<br>
<br>
</li>
<li><strong>intMaxPerWave</strong> (float)<br>
This is the maximum number of guys that will spawn in a wave. You also
have to make sure that the number of spawners placed is equal to, or
greater than this value. For example, if I set a maximum number of AI
to 5, and I only have 4 spawners placed, this would cause a major problem,
and therefore the script will catch this and print an error message
to the console. This value also works in tandum with the intMinPerWave
value in determining how many AI to spawn in a wave.<br>
<br>
</li>
<li><strong>intWaveId</strong> (float)<br>
This is the group ID number that all the spawned AI will have. This
is primarily for use with the optional group death thread, but it MUST
be set regardless. Make sure that each spawn wave group has it's own
unique ID.</li>
</ul>
<p class="subheader"> Setting up an Optional Group Death Thread</p>
<p> If you have a situation where when all of your spawned AI from a group
are dead, and you need a thread to be called due to this, you can set
this optional goup death thread. This will ONLY run when all the AI are
dead, meaning it has gone through ALL of the waves of AI for that group.
Here is the function you run in your level script:</p>
<blockquote>
<p class="menu">globalSpawnWave_SetupDeathThread( strGroupName, strDeathThread
)</p>
</blockquote>
<p>You MUST run this after the setup function has been fully run else it
won't set the death thread properly. Here are the parameters for this
function:</p>
<ul type="square">
<li><strong>strGroupName</strong> (string)<br>
This is the unique name identifier you gave the group. In my example
case, this would be 'spawnEngineeringGroup' (of course minus the quotes
:). You HAVE TO HAVE a group name or the script will not work at all
because it has to know which group you are referencing!<br>
<br>
</li>
<li><strong>strDeathThread</strong> (string)<br>
This is the thread to call when all the spawned AI in the group are
dead</li>
</ul>
<p class="subheader"> Calling the Start function</p>
<p> When it's time to activate this group and get them spawning, call this
function:</p>
<blockquote>
<p class="menu">globalSpawnWave_Start( strGroupName )</p>
</blockquote>
<p>Here are the parameters for this function:</p>
<ul type="square">
<li><strong>strGroupName</strong> (string)<br>
This is the unique name identifier you gave the group. In my example
case, this would be 'spawnEngineeringGroup' (of course minus the quotes
:). You HAVE TO HAVE a group name or the script will not work at all
because it has to know which group you are referencing!!</li>
</ul>
<p><br>
That's it, the rest works on it's own. You do not have to worry about
AI being on top of spawners and spawning ontop of each other, that is
taken care of by the script and the func spawn.</p>
<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>