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

299 lines
18 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>
creating flying creatures</p>
<p>Also see the documentation for &quot;<a href="scripting_globalscripts_flyin.html">global_flyin.scr</a>&quot;.</p>
<p class="subheader"> To Set Up Crash Version</p>
<p> To set this version up in the editor, you'll need:</p>
<ul type="square">
<li> spline path for the creature to follow</li>
<li> script model using the creature you want to fly in</li>
<li> an impact mark that's either a decal, or made of brushes</li>
<li> a trigger brush</li>
</ul>
<p>These four things HAVE to be there, it won't work right unless all four
elements exist.</p>
<p>You use an info_splinepath to make the path the creature will follow.
You CTRL+K them together so they're all linked in a chain. The only values
you'll want to play with per node are the speed values. The speed value
is a percentage. 1 is the default, and that's 100% (normal speed). If
you want it to go faster, you increase the number (so 2 would make the
object go 200% of normal speed, or twice as fast). If you want it to go
slower you decrease the number towards 0, but not below (so .5 would tell
the object to go 50% of normal speed, or half as fast). This is from a
node-to-node basis mind you, so you can have the objects go fast between
two nodes, and then slow down between two different nodes, etc.</p>
<p>Place a script model in the level, and set the model keyvalue towards
the creature .tik you want to use (there's a nifty little model button
you can use on the entity dialog).</p>
<p>Make an impact crater that sits on top of the ground. If you look in
the example map, you'll see it's just a simple set of brushes that can
go ontop of the ground. A decal FX would work really nice as well.</p>
<p>Make a trigger brush. THIS IS THE IMPORTANT PART. You have to place the
trigger brush on top of the crater, where the creature will intersect
it. Also, and again check out the example map, you don't want to make
the trigger brush too tall or to big as right when the creature touches
it, will it consider its self to have impacted. The IMPORTANT PART, is
that you have to make sure you check the SCRIPTSLAVE flag on the trigger
brush for this to work, if you don't, nothing will happen when the script
model passes through it. Give the triggerbrush a unique targetname</p>
<p>Once you have all of that setup, here's the next IMPORTANT step. First,
highlight the trigger. Now control+K the trigger to the impact crater.
Then control+K the impact crater to the script model. Then control+K the
script model to the first point in the spline path. IT IS VERY IMPORTANT
THAT YOU LINK THESE OBJECTS TOGETHER IN THIS ORDER! The script derives
the objects targetnames based on the order you link them together, so
if you do not link them, or link them in the improper order, it won't
work.</p>
<p class="subheader"> To Set Up Land Version</p>
<p> To set this version up in the editor, you'll need:</p>
<ul type="square">
<li> spline path for the creature to follow</li>
<li> script model using the creature you want to fly in</li>
<li> a trigger brush</li>
</ul>
<p>These 3 things HAVE to be there, it won't work right unless all 3 elements
exist.</p>
<p>The spline path is setup in the same manner as in the crash verison.</p>
<p>The script model is setup in the same manner as in the crash version.</p>
<p>The trigger brush is setup a little differently. You still need the trigger
brush to intersect the path the creature will follow, but you'll want
it to intersect it in the air. The goal of this version of the script
is to have an alien fly in and then 'hop' off of his path and attack just
above the ground. Look at the example to see what I'm talking about. Give
the triggerbrush a unique targetname.</p>
<p>As in the crash example you'll have to control+K link all these objects
together. Only this time here's the order:</p>
<ul type="square">
<li>trigger brush to script model</li>
<li> script model to first node in spline path</li>
</ul>
<p> This concludes the radiant setup portion. </p>
<p class="subheader">Script Setup and Threads to Launch</p>
<p> Here's what you need to do in your level's script file to get this to
work. You'll want to include this line just after where you declare all
your threads at the top of your script file (you can also check the global
script synopsis document):</p>
<p>Dependancies:</p>
<blockquote>
<p class="menu"> #include &quot;maps/global_scripts/global_common.scr<br>
#include &quot;maps/global_scripts/global_debugUtils.scr</p>
</blockquote>
<p>Actual script file:</p>
<blockquote>
<p class="menu"> #include &quot;maps/global_scripts/global_flyin.scr&quot;</p>
</blockquote>
<p><br>
There's a setup thread you have to run for each flyin creature you've
setup. So at the start of the level you'll want to run this thread:</p>
<blockquote>
<p class="menu">globalFlyin_setup( &quot;string value of the targetname
of the trigger&quot;, &quot;type of variation&quot; );</p>
</blockquote>
<p>The string value of the targetname of the trigger, is the trigger's targetname
WITHOUT the '$'. The type of variation should be either the word 'crash'
or 'land' without the quotes of course, and all lower case. So for example,
I've setup a crash version, and the trigger brush has a targetname of
crash_example, here's what the thread I would run would look like:</p>
<blockquote>
<p class="menu">globalFlyin_setup( &quot;crash_example&quot;, &quot;crash&quot;
);</p>
</blockquote>
<p> When in your script you're ready to activate the creature, you use this
thread, again with the string value of the targetname of the trigger.
Using the previous example with a trigger brush targetname of crash_example:</p>
<blockquote>
<p class="menu">globalFlyin_Launch( &quot;crash_example&quot; );</p>
</blockquote>
<p> this will cause the creature to flyin on the path and activate. They
can get shot out of the air as well and will explode when you do this
(pretty cool to watch actually :).</p>
<p class="subheader"> Optional Parameters</p>
<p> There is a default effect to play for when the creature crashes into
the ground, and gets shot out of the air. But you can override either
of these by entering the following keyvalues on the trigger brush in radiant(please
note, that entering a crash FX for the land version of the creature will
have no effect :)</p>
<ul type="square">
<li>uservar1 - will replace the crash effect</li>
<li> uservar2 - will replace the shot out of the air effect</li>
</ul>
<p>The Land example in the example map uses the uservar2 to set a different
shot out of the air effect if you'd like to see an example. You just enter
these as a standard keyvalue, and then the fx/fx-name-here.tik as the
actual data.</p>
<p>There is also grouping options:</p>
<ul type="square">
<li>uservar3 - Group on-death thread to launch</li>
<li>uservar4 - Group number to assign to this creature</li>
</ul>
<p>This way you can assign these guys to a group and use the onDeath thread
funcitonality</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>