anachronox-sdk/docs/cam_talk.html

536 lines
24 KiB
HTML
Raw Normal View History

2002-01-21 00:00:00 +00:00
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Using the cam & talk commands in a window</title>
<style type="text/css">
<!--
body {
background-color:black;
text-color:lightgrey;
margin-left:12%;
margin-right:13%;
}
a {
font-weight:bold;
text-decoration:none;
color:black;
}
p {
font:12pt/16pt Arial, Geneva, sans-serif;
color:lightgrey;
margin-top:8pt;
margin-bottom:8pt;
text-indent:12pt;
}
h1 {
font:24pt/22pt Arial, Geneva, sans-serif;
color:orange;
text-align:center;
}
h2 {
font:18pt/18pt Arial, Geneva, sans-serif;
color:yellow;
text-align:left;
margin-top:24pt;
}
pre {
font:10pt/10pt Fixedsys, Courier, serif;
background-color:#202020;
color=lightgrey;
}
code {
font:10pt/15pt Fixedsys, Courier, serif;
background-color:#202020;
color=lightgrey;
}
hr {
color:red;
margin-top:-20pt;
}
hr.h2 {
color:orange;
width:50%;
text-align:left;
}
b.red {
font:light;
color:red;
}
b.green {
font-weight:light;
color:green;
}
-->
</style>
</head>
<body>
<p align="left"><font color="#808080" size="1" face="Arial">Last
updated 3/20/2000</font></p>
<p align="center"><font color="#990000" size="3"></font>&nbsp;</p>
<hr>
<h1><font face="Arial">Using the cam &amp; talk commands in a
window</font></h1>
<p><font face="Arial"></font>&nbsp;</p>
<hr>
<table border="0" cellpadding="4" cellspacing="4">
<tr>
<td> <font face="Arial" color=#FFFFFF> CONTENTS: </font> </td>
<td bgcolor="#002866"><a href="#intro"><font
color="#FFFFFF" size="2" face="Arial">1</font><font
size="2" face="Arial" color="#00FFFF">(Intro)</font></a></td>
<td bgcolor="#002866"><a href="#camdetails"><font
color="#FFFFFF" size="2" face="Arial">2</font><font
size="2" face="Arial" color="#00FFFF">(CAM Details)</font></a></td>
<td bgcolor="#002866"><a href="#talkdetails"><font
color="#FFFFFF" size="2" face="Arial">3</font><font
size="2" face="Arial" color="#00FFFF">(TALK Details)</font></a></td>
</tr>
</table>
<p><a name="intro"><font face="Arial"></font></a></p>
<h2><font face="Arial">Intro </font></h2>
<hr class="h2">
<table border="0" cellpadding="12" width="100%" bgcolor="#202020"
leftmargin="10%">
<tr>
<td><font color="#FFFF00" face="Arial"><code>talk</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>&quot;</code></font><font
color="#FFFF00" face="Arial"><code>player</code></font><font
face="Arial"><code>&quot; </code></font><font
color="#00FFFF" face="Arial"><code>||</code></font><font
face="Arial"><code> &quot;</code></font><font
color="#FFFF00" face="Arial"><code>npc</code></font><font
face="Arial"><code>&quot;</code></font><font
color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>animation
name</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>[</code></font><font color="#FFFF00"
face="Arial"><code>nostay</code></font><font
color="#00FFFF" face="Arial"><code>]</code></font><font
face="Arial"><code> <br>
</code></font><font color="#FFFF00" face="Arial"><code>talk_ex</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>entity
A</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>entity
B</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>anim
A</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>anim
B</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>[&lt;</code></font><font
color="#FFFF00" face="Arial"><code>nostay</code></font><font
face="Arial"><code> A</code></font><font color="#00FFFF"
face="Arial"><code>&gt;</code></font><font face="Arial"><code>
</code></font><font color="#00FFFF" face="Arial"><code>&lt;</code></font><font
color="#FFFF00" face="Arial"><code>nostay</code></font><font
face="Arial"><code> B</code></font><font color="#00FFFF"
face="Arial"><code>&gt;]</code></font><font face="Arial"><code>
<br>
</code></font><font color="#FFFF00" face="Arial"><code>cam</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>preset
name</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>[</code></font><font face="Arial"><code>&quot;</code></font><font
color="#FFFF00" face="Arial"><code>restore</code></font><font
face="Arial"><code>&quot;</code></font><font
color="#00FFFF" face="Arial"><code>]</code></font><font
face="Arial"><code> key</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>value</code></font><font
color="#00FFFF" face="Arial"><code>)</code></font><font
face="Arial"><code> key</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>value</code></font><font
color="#00FFFF" face="Arial"><code>)</code></font><font
face="Arial"><code> ... </code></font></td>
</tr>
</table>
<p><font face="Arial">With these three commands, you can
accomplish everything you could with the old system, and in a
more efficient and readable format. The </font><font
color="#FFFF00" face="Fixedsys">talk</font><font face="Arial">
command handles most cases. The most common dialog commands now
look something like this: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#FFFF00" face="Arial"><code>startconsole</code></font><font
face="Arial"><code> &quot;</code></font><font
color="#FFFF00" face="Arial"><code>setcharactertalk</code></font><font
face="Arial"><code> 18:1101 character_boots start talk_a;</code></font><font
color="#FFFF00" face="Arial"><code>rca</code></font><font
face="Arial"><code> 18:1101 gest_g; </code></font><font
color="#FFFF00" face="Arial"><code>cam_to</code></font><font
face="Arial"><code> pickle rel;</code></font><font
color="#68165A" face="Arial"><code>$CAMRIGHT</code></font><font
face="Arial"><code>;</code></font><font color="#FFFF00"
face="Arial"><code>cam_lagfactor</code></font><font
face="Arial"><code> 120&quot; <br>
</code></font><font color="#FFFF00" face="Arial"><code>finishconsole</code></font><font
face="Arial"><code> &quot;</code></font><font
color="#FFFF00" face="Arial"><code>cam_moverestore</code></font><font
face="Arial"><code> 1;</code></font><font color="#FFFF00"
face="Arial"><code>setcharactertalk</code></font><font
face="Arial"><code> 18:1101 character_boots stop;</code></font><font
color="#FFFF00" face="Arial"><code>cam_restore</code></font><font
face="Arial"><code>&quot; </code></font></td>
</tr>
</table>
<p><font face="Arial">Where </font><font color="#68165A"
face="Arial"><code>$CAMRIGHT</code></font><font face="Arial">
means: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#FFFF00" face="Arial"><code>cam_yaw</code></font><font
face="Arial"><code> -55;</code></font><font
color="#FFFF00" face="Arial"><code>cam_pitch</code></font><font
face="Arial"><code> -50;</code></font><font
color="#FFFF00" face="Arial"><code>cam_fardist</code></font><font
face="Arial"><code> 45;</code></font><font
color="#FFFF00" face="Arial"><code>cam_neardist</code></font><font
face="Arial"><code> 10;</code></font><font
color="#FFFF00" face="Arial"><code>cam_fwddist</code></font><font
face="Arial"><code> 45;</code></font><font
color="#FFFF00" face="Arial"><code>cam_occlude</code></font><font
face="Arial"><code> 1; </code></font><font
color="#FFFF00" face="Arial"><code>cam_delay</code></font><font
face="Arial"><code> -1;</code></font><font
color="#FFFF00" face="Arial"><code>fov</code></font><font
face="Arial"><code> 80 </code></font></td>
</tr>
</table>
<p><font face="Arial">All of this crap can now be done with
something similar to this: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#FFFF00" face="Arial"><code>cam</code></font><font
face="Arial"><code> right to(pickle rel)<br>
</code></font><font color="#FFFF00" face="Arial"><code>talk
npc</code></font><font face="Arial"><code> talk_a </code></font></td>
</tr>
</table>
<font face="Arial"><!----------------------------------------------------------></font><a name="camdetails"><font face="Arial"></font></a>
<h2><font face="Arial">CAM Details </font></h2>
<hr class="h2">
<p><font face="Arial">Camera values are defined in the file <code>caminfo.txt</code>
in the <code>anoxdata/gameflow</code> directory. The file
consists of a series of camera definitions, one per line, each
one containing one or more key/value pairs that define how the
camera should work. Here's the format, with an example: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#00FFFF" face="Arial"><code>&lt;</code></font><font
face="Arial"><code>camera name</code></font><font
color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> key</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>value</code></font><font
color="#00FFFF" face="Arial"><code>)</code></font><font
face="Arial"><code> key</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>value</code></font><font
color="#00FFFF" face="Arial"><code>)</code></font><font
face="Arial"><code> ...<br>
EX: </code></font><font color="#FFFF00" face="Arial"><code>left
yaw(55) pitch(-20) far(100) near(10) fwd(45) occlude(1)
speed(100) lag(100)</code></font><font face="Arial"><code>
</code></font></td>
</tr>
</table>
<p><font face="Arial">Before we come to the huge list of keys and
descriptions, understand that you can override any and all of the
values if you want, when you build the window. For example, if
you wanted to use the &quot;left&quot; cam from above, but wanted
to change the </font><font color="#FFFF00" face="Arial">pitch</font><font
face="Arial"> and </font><font color="#FFFF00" face="Arial">from </font><font
face="Arial">values, you would use: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#FFFF00" face="Arial"><code>cam</code></font><font
face="Arial"><code> left </code></font><font
color="#FFFF00" face="Arial"><code>pitch</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>-40</code></font><font color="#00FFFF"
face="Arial"><code>)</code></font><font face="Arial"><code>
</code></font><font color="#FFFF00" face="Arial"><code>from</code></font><font
color="#00FFFF" face="Arial"><code>(</code></font><font
face="Arial"><code>13:2321</code></font><font
color="#00FFFF" face="Arial"><code>)</code></font><font
face="Arial"><code><br>
</code></font></td>
</tr>
</table>
<p><font face="Arial">And here are all the possible keys and what
they mean: </font></p>
<table border="0" cellpadding="6" cellspacing="8" width="100%">
<tr>
<td align="center" bgcolor="#202020"><font
color="#68165A" face="Arial"><code>KEY NAME</code></font></td>
<td align="center" bgcolor="#202020"><font
color="#68165A" face="Arial"><code>DESCRIPTION</code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>restore</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>NOTE: IF
you use this in a window, it must be the first key to
come after the cam name.<br>
<br>
If present, tells the camera not to go back to normal
after the window is dismissed, unless the player moves.
Use to let the player know that there is more dialog that
they should read before going on. </code></font><font
color="#FF0000" size="5" face="Arial">NOTE: This &quot;restore&quot;
behavior may be backwards. Check back with Josh and
Squrirel. Also note that &quot;restore&quot; does NOT
require a (value) following it.</font></td>
</tr>
<tr>
<td width="220" bgcolor="#202020"><font face="Arial"><code>zip
(cam_zip)</code></font></td>
<td width="0" bgcolor="#202020"><font face="Arial"><code>If
present, the camera will cut instantly to where it's
supposed to be, rather than smoothly going there. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>from (cam_from)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>Tells the
camera where to look from. You can specify a targetname
or sequence for an entity in the map, or you can specify
absolute world coordinates (which can be easily produced
with the cam_dumpstring command)<br>
<br>
If you specify an entity that is NOT solid, the camera
looks from that entity's origin and the near, far, pitch
and yaw values are ignored.</code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>to (cam_to)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>Tells the
camera what to look at. You can specify a targetname or
sequence for an entity in the map, or you can specify
absolute world coordinates<br>
<br>
If you specify an entity that is NOT solid, the camera
looks from that entity's origin and the near, far, pitch
and yaw values are ignored.<br>
<br>
Also, if you put the word &quot;rel&quot; after the
target (with a space in between them), the camera will
look at the point directly in between the target and the
owner or from entity. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>owner (cam_owner)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>Tells the
camera that all the calculations it makes to determine
where in the world to be should be based off a different
entity. You can specify a targetname or sequence of an
entity in the world. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>yaw (cam_yaw)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The camera
will rotate this many degrees to the left or right in
relation to the source (owner or from entity). </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>pitch (cam_pitch)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The camera
will rotate this many degrees up or down in relation to
the source (owner or from entity). <br>
<br>
NOTE that negative values will cause the camera to move
up. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>far (cam_fardist)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The camera
stays this far away from the source, assuming the source
is solid. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>near (cam_neardist)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The camera
will try to stay at least this far away from the source,
assuming the source is solid. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>fwd (cam_fwddist)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The focus
point of the camera is this far in front of the target (owner
or to entity), assuming the target is solid.</code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>speed (cam_movespeed)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The
maximum speed the camera will move. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>lift (cam_lift)
</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>The focus
point of the camera is this far up from the target's
origin, assuming the target is solid. </code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>lag (cam_lagfactor)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>Limits how
fast the camera can move, and makes the in/out of the
path more smooth. Generally, speed should be larger than
lag, but some nice effects can be had by making lag
larger than speed.</code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>occlude (cam_occlude)</code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>If set to
1, the camera will freely allow anything to get between
it and the focus.</code></font></td>
</tr>
<tr>
<td bgcolor="#202020"><font face="Arial"><code>fov </code></font></td>
<td bgcolor="#202020"><font face="Arial"><code>Field of
view. </code></font></td>
</tr>
</table>
<P>
Additionally if you want to force camera between the talk position and the player position, you can use the extern:
<table border="0" cellpadding="12" width="100%" bgcolor="#202020">
<tr>
<td><font color="#FFFFFF" face="Arial"><code>cam_anoxmariomode &lt;&quot;1&quot; || &quot;0&quot;&gt;</code><BR>
Takes arguments "1", "0", or nothing. nothing == toggle. It puts the camera into "mario mode" (like when talking).
</font>
</td>
</tr>
</table>
<P>
<font face="Arial"><!----------------------------------------------------------></font><a name="talkdetails"><font
face="Arial"></font></a>
<h2><font face="Arial">TALK Details </font></h2>
<hr class="h2">
<p><font face="Arial">There are two talk commands. One is for the
most common case, where the player and an NPC are talking to
eachother, and the other is for special cases where more control
is needed, i.e. two NPC talking to eachother, or an NPC talking
to a specific player character in the party.<br>
<br>
Here's the format for those two again: </font></p>
<table border="0" cellpadding="12" width="100%" bgcolor="#202020"
leftmargin="10%">
<tr>
<td><font color="#FFFF00" face="Arial"><code>talk</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>&quot;</code></font><font
color="#FFFF00" face="Arial"><code>player</code></font><font
face="Arial"><code>&quot; </code></font><font
color="#00FFFF" face="Arial"><code>||</code></font><font
face="Arial"><code> &quot;</code></font><font
color="#FFFF00" face="Arial"><code>npc</code></font><font
face="Arial"><code>&quot;</code></font><font
color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>animation
name</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>[</code></font><font color="#FFFF00"
face="Arial"><code>nostay</code></font><font
color="#00FFFF" face="Arial"><code>]</code></font><font
face="Arial"><code> <br>
</code></font><font color="#FFFF00" face="Arial"><code>talk_ex</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>entity
A</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>entity
B</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>anim
A</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>&lt;</code></font><font face="Arial"><code>anim
B</code></font><font color="#00FFFF" face="Arial"><code>&gt;</code></font><font
face="Arial"><code> </code></font><font color="#00FFFF"
face="Arial"><code>[&lt;</code></font><font
color="#FFFF00" face="Arial"><code>nostay</code></font><font
face="Arial"><code> A</code></font><font color="#00FFFF"
face="Arial"><code>&gt;</code></font><font face="Arial"><code>
</code></font><font color="#00FFFF" face="Arial"><code>&lt;</code></font><font
color="#FFFF00" face="Arial"><code>nostay</code></font><font
face="Arial"><code> B</code></font><font color="#00FFFF"
face="Arial"><code>&gt;]</code></font><font face="Arial"><code>
</code></font></td>
</tr>
</table>
<p><font face="Arial">With the </font><font color="#FFFF00"
face="Arial"><code>talk</code></font><font face="Arial"> command,
you specify either &quot;</font><font color="#FFFF00"
face="Arial"><code>player</code></font><font face="Arial">&quot;
or &quot;</font><font color="#FFFF00" face="Arial"><code>npc</code></font><font
face="Arial">&quot; and an animation to play for that entity.
Also, whichever you specify in this command will be the default </font><font
color="#FFFF00" face="Arial"><code>cam_to</code></font><font
face="Arial"> entity. If you use the </font><font color="#FFFF00"
face="Arial"><code>nostay</code></font><font face="Arial">
command, the entity that you specified will not stop to talk, but
will keep moving or whatever it is doing.<br>
<br>
The </font><font color="#FFFF00" face="Arial"><code>talk_ex</code></font><font
face="Arial"> command is the same, except you can specify both
entities and parameters for both. </font></p>
</body>
</html>