174 lines
4.2 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>4dguns documentation</title>
<link rel="stylesheet" href="../ldoc_new.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>4dguns</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><strong>item_entities.lua</strong></li>
<li><a href="../scripts/misc_helpers.html">misc_helpers</a></li>
<li><a href="../scripts/play_sound.html">play_sound</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/classes.player_model_handler.html">classes.player_model_handler</a></li>
<li><a href="../modules/default_controls.html">default_controls</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Gun.html">Gun</a></li>
<li><a href="../classes/Instantiatable_class.html">Instantiatable_class</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/readme.md.html">readme</a></li>
</ul>
</div>
<div id="content">
<h1>Script <code>item_entities.lua</code></h1>
<p>adds 3d items for guns and magazines</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Guns4d.register_item">Guns4d.register_item (itemstring, def)</a></td>
<td class="summary">replaces the item entity of the provided item with a 3d entity based on the definition</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#guns4d_itemdef">guns4d_itemdef</a></td>
<td class="summary">table defining the new 3d entity for a dropped item</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Guns4d.register_item"></a>
<strong>Guns4d.register_item (itemstring, def)</strong>
</dt>
<dd>
replaces the item entity of the provided item with a 3d entity based on the definition
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">itemstring</span>
</li>
<li><span class="parameter">def</span>
, a <a href="../scripts/item_entities.lua.html#guns4d_itemdef">guns4d_itemdef</a>
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "guns4d_itemdef"></a>
<strong>guns4d_itemdef</strong>
</dt>
<dd>
table defining the new 3d entity for a dropped item
<h3>Fields:</h3>
<ul>
<li><span class="parameter">light_source</span>
int, equivelant to minetest itemdef version
</li>
<li><span class="parameter">size</span>
int, the size of the collision box
</li>
<li><span class="parameter">mesh</span>
string, the mesh to use for the item
</li>
<li><span class="parameter">textures</span>
table, a list of textures (see minetest entity documentation)
</li>
<li><span class="parameter">collisionbox_size</span>
, the size of collisionbox in tenths of meters.
</li>
<li><span class="parameter">selectionbox</span>
vector, xyz scale of the selectionbox
</li>
<li><span class="parameter">offset</span>
vector, xyz offset of the visual object from the collision and selectionbox. (so that magazines's origin can match their bone.)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/ldoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2024-06-18 17:20:58 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>