📄 qc-mdl.htm
字号:
<HTML><HEAD>
<TITLE>Quake-C Specificacions v1.0</TITLE>
<LINK REV="MADE" HREF="mailto:100625.2622@compuserve.com">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1><FONT COLOR="#007F00"><A NAME="QC-MDL">Quake-C Model definitions</A></FONT></H1>
<p><i>(Derived from information published by Steve Tietze)</i></p>
<p>Here are a few definitions that are commonly found in the
Quake-C code defining the behavior of animated models (monsters,
players, etc...).
</p>
<p>Most of this information is not interpreted by the Quake-C compiler,
but it's useful for the program <b>modelgen</b> that generates the models.
</p>
<h4>Model name</h4>
<pre>
<b><a name="s_modelname">$modelname</a></b> <i>name</i>
</pre>
<i>name</i> is the name of the model file defining the object.<br>
ex: <b>$name armor</b>
<h4>directory</h4>
<pre>
<b><a name="s_cd">$cd</a></b> <i>dir</i>
</pre>
Specify the directory where your model file (.MDL) is located.<br>
ex: <b>$cd /evil/models/armor</b>
<h4>Special animation flags</h4>
<pre>
<b><a name="s_flags">$flags</a></b> <i>rotation</i>
</pre>
This field is not interpreted by Quake-C, but it's useful for the
program <b>modelgen</b> that generates the models.<br>
Rotation of the object. <br>
ex: <b>$flags 8</b><br>
Possible values for the flags:
<ul>
<li> 8: the object keeps rotating, like armors.
<li> other values are not known yet
</ul>
<h4>Origin</h4>
<pre>
<b><a name="s_origin">$origin</a></b> <i>x y z</i>
</pre>
This field is not interpreted by Quake-C, but it's useful for the
program <b>modelgen</b> that generates the models.<br>
Location of the object within the bounding box, in the quake editor.<br>
ex: <b>$origin 0 0 8</b>
<h4>Scale factor</h4>
<pre>
<b><a name="s_scale">$scale</a></b> <i>number</i>
</pre>
This field is not interpreted by Quake-C, but it's useful for the
program <b>modelgen</b> that generates the models.<br>
<i>number</i> comes from the texmake number that is generated.<br>
You can use different values if you want.<br>
ex: <b>$scale 4</b>
<h4>Base</h4>
<pre>
<b><a name="s_base">$base</a></b> <i>object</i>
</pre>
This field is not interpreted by Quake-C, but it's useful for the
program <b>modelgen</b> that generates the models.<br>
<i>object</i> is the name of a model file, that will be used as
a kind of starting position, for animation.
<h4>Skin file</h4>
<pre>
<b><a name="s_skin">$skin</a></b> <i>skinfile</i>
</pre>
This field is not interpreted by Quake-C, but it's useful for the
program <b>modelgen</b> that generates the models.<br>
<i>skinfile</i> is the name (without extension) of the <b>.lbm</b> file that defines
the skin of the object, as generated by the program <b>texmake</b>.
<h4>Frame definitions</h4>
<pre>
<b><a name="s_frame">$frame</a></b> <i>frame1</i> <i>frame2</i> ...
</pre>
This defines several animation frames of the object.<br>
For every animation frame defined, you must also define a Quake-C function,
that will be called during this animation frame. For instance:<br>
<pre>
<b>$frame walk1 walk2 walk3 walk4</b>
void() man_walk1 = [ <b>$walk1</b>, man_walk2 ] { ... some code ... };
void() man_walk2 = [ <b>$walk2</b>, man_walk3 ] { ... some code ... };
void() man_walk3 = [ <b>$walk3</b>, man_walk4 ] { ... some code ... };
void() man_walk4 = [ <b>$walk4</b>, man_walk1 ] { ... some code ... };
</pre>
<p>In the brackets, the first parameter defines the name of the frame
(as found in the model file), and the second parameter defined the
function that is to be executed in the next frame (by setting the
value of self.<a href="qc-enty.htm#dot_nextthink" target="content">nextthink</a>).</p>
<p>Most of these functions do nothing special, but some can be very complex
(for instance, the functions that are called when the monster tries
to see a player).</p>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -