Generate HTML docs with LDoc
parent
58ce4bf7fb
commit
3860749d31
|
@ -0,0 +1,67 @@
|
|||
<!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>Creatures Revived</title>
|
||||
<link rel="stylesheet" href="ldoc.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>cmer</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/register.lua.html">register.lua</a></li>
|
||||
<li><a href="modules/common.lua.html">common.lua</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<table class="module_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/register.lua.html">register.lua</a></td>
|
||||
<td class="summary">MOB Registration</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/common.lua.html">common.lua</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/AntumDeluge/LDoc">LDoc 1.4.6-antum-2</a></i>
|
||||
<i style="float:right;">Last updated 2021-05-05 14:19:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,303 @@
|
|||
/* BEGIN RESET
|
||||
|
||||
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 2.8.2r1
|
||||
*/
|
||||
html {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
fieldset,img {
|
||||
border: 0;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
del,ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
li {
|
||||
margin-left: 20px;
|
||||
}
|
||||
caption,th {
|
||||
text-align: left;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
q:before,q:after {
|
||||
content: '';
|
||||
}
|
||||
abbr,acronym {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
sup {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
sub {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
legend {
|
||||
color: #000;
|
||||
}
|
||||
input,button,textarea,select,optgroup,option {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
input,button,textarea,select {*font-size:100%;
|
||||
}
|
||||
/* END RESET */
|
||||
|
||||
body {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
font-family: arial, helvetica, geneva, sans-serif;
|
||||
background-color: #ffffff; margin: 0px;
|
||||
}
|
||||
|
||||
code, tt { font-family: monospace; font-size: 1.1em; }
|
||||
span.parameter { font-family:monospace; }
|
||||
span.parameter:after { content:":"; }
|
||||
span.types:before { content:"("; }
|
||||
span.types:after { content:")"; }
|
||||
.type { font-weight: bold; font-style:italic }
|
||||
|
||||
body, p, td, th { font-size: .95em; line-height: 1.2em;}
|
||||
|
||||
p, ul { margin: 10px 0 0 0px;}
|
||||
|
||||
strong { font-weight: bold;}
|
||||
|
||||
em { font-style: italic;}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 20px 0 20px 0;
|
||||
}
|
||||
h2, h3, h4 { margin: 15px 0 10px 0; }
|
||||
h2 { font-size: 1.25em; }
|
||||
h3 { font-size: 1.15em; }
|
||||
h4 { font-size: 1.06em; }
|
||||
|
||||
a:link { font-weight: bold; color: #004080; text-decoration: none; }
|
||||
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
|
||||
a:link:hover { text-decoration: underline; }
|
||||
|
||||
hr {
|
||||
color:#cccccc;
|
||||
background: #00007f;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
blockquote { margin-left: 3em; }
|
||||
|
||||
ul { list-style-type: disc; }
|
||||
|
||||
p.name {
|
||||
font-family: "Andale Mono", monospace;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: rgb(245, 245, 245);
|
||||
border: 1px solid #C0C0C0; /* silver */
|
||||
padding: 10px;
|
||||
margin: 10px 0 10px 0;
|
||||
overflow: auto;
|
||||
font-family: "Andale Mono", monospace;
|
||||
}
|
||||
|
||||
pre.example {
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
table.index { border: 1px #00007f; }
|
||||
table.index td { text-align: left; vertical-align: top; }
|
||||
|
||||
#container {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
#product {
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#product big {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#main {
|
||||
background-color: #f0f0f0;
|
||||
border-left: 2px solid #cccccc;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
float: left;
|
||||
width: 14em;
|
||||
vertical-align: top;
|
||||
background-color: #f0f0f0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#navigation h2 {
|
||||
background-color:#e7e7e7;
|
||||
font-size:1.1em;
|
||||
color:#000000;
|
||||
text-align: left;
|
||||
padding:0.2em;
|
||||
border-top:1px solid #dddddd;
|
||||
border-bottom:1px solid #dddddd;
|
||||
}
|
||||
|
||||
#navigation ul
|
||||
{
|
||||
font-size:1em;
|
||||
list-style-type: none;
|
||||
margin: 1px 1px 10px 1px;
|
||||
}
|
||||
|
||||
#navigation li {
|
||||
text-indent: -1em;
|
||||
display: block;
|
||||
margin: 3px 0px 0px 22px;
|
||||
}
|
||||
|
||||
#navigation li li a {
|
||||
margin: 0px 3px 0px -1em;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin-left: 14em;
|
||||
padding: 1em;
|
||||
width: 700px;
|
||||
border-left: 2px solid #cccccc;
|
||||
border-right: 2px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#about {
|
||||
clear: both;
|
||||
padding: 5px;
|
||||
border-top: 2px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font: 12pt "Times New Roman", "TimeNR", Times, serif;
|
||||
}
|
||||
a { font-weight: bold; color: #004080; text-decoration: underline; }
|
||||
|
||||
#main {
|
||||
background-color: #ffffff;
|
||||
border-left: 0px;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin-left: 2%;
|
||||
margin-right: 2%;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 1em;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
display: none;
|
||||
}
|
||||
pre.example {
|
||||
font-family: "Andale Mono", monospace;
|
||||
font-size: 10pt;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
}
|
||||
|
||||
table.module_list {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.module_list td {
|
||||
border-width: 1px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
}
|
||||
table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
|
||||
table.module_list td.summary { width: 100%; }
|
||||
|
||||
|
||||
table.function_list {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.function_list td {
|
||||
border-width: 1px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
}
|
||||
table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
|
||||
table.function_list td.summary { width: 100%; }
|
||||
|
||||
ul.nowrap {
|
||||
overflow:auto;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
|
||||
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
|
||||
dl.table h3, dl.function h3 {font-size: .95em;}
|
||||
|
||||
/* stop sublists from having initial vertical space */
|
||||
ul ul { margin-top: 0px; }
|
||||
ol ul { margin-top: 0px; }
|
||||
ol ol { margin-top: 0px; }
|
||||
ul ol { margin-top: 0px; }
|
||||
|
||||
/* make the target distinct; helps when we're navigating to a function */
|
||||
a:target + * {
|
||||
background-color: #FF9;
|
||||
}
|
||||
|
||||
|
||||
/* styles for prettification of source */
|
||||
pre .comment { color: #558817; }
|
||||
pre .constant { color: #a8660d; }
|
||||
pre .escape { color: #844631; }
|
||||
pre .keyword { color: #aa5050; font-weight: bold; }
|
||||
pre .library { color: #0e7c6b; }
|
||||
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
|
||||
pre .string { color: #8080ff; }
|
||||
pre .number { color: #f8660d; }
|
||||
pre .operator { color: #2239a8; font-weight: bold; }
|
||||
pre .preprocessor, pre .prepro { color: #a33243; }
|
||||
pre .global { color: #800080; }
|
||||
pre .user-keyword { color: #800080; }
|
||||
pre .prompt { color: #558817; }
|
||||
pre .url { color: #272fc2; text-decoration: underline; }
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
<!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>Creatures Revived</title>
|
||||
<link rel="stylesheet" href="../ldoc.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>cmer</h1>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="../api.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/register.lua.html">register.lua</a></li>
|
||||
<li><strong>common.lua</strong></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>common.lua</code></h1>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.rnd">cmer.rnd (<i>tab</i>, <i>errval</i>)</a></td>
|
||||
<td class="summary">Returns a weighted random table element.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.compare_pos">cmer.compare_pos (<i>pos1</i>, <i>pos2</i>)</a></td>
|
||||
<td class="summary">Compares two positions.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.findTarget">cmer.findTarget (<i>search_obj</i>, <i>pos</i>, <i>radius</i>, <i>search_type</i>, <i>ignore_mob</i>[, <i>xray</i>], <i>no_count</i>)</a></td>
|
||||
<td class="summary">Returns table of found objects (as ObjectRef) and boolean player_near.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.dropItems">cmer.dropItems (<i>pos</i>, <i>drops</i>)</a></td>
|
||||
<td class="summary">Drops items at position <code>pos</code>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "cmer.rnd"></a>
|
||||
<strong>cmer.rnd (<i>tab</i>, <i>errval</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns a weighted random table element. </p>
|
||||
|
||||
<p> chance_sum of table must be 1.</p>
|
||||
|
||||
<p> Example: cmer.rnd({elem1 = {chance = 0.7}, {elem2 = {chance = 0.3}})
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">tab</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">errval</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
Weighted random table element.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "cmer.compare_pos"></a>
|
||||
<strong>cmer.compare_pos (<i>pos1</i>, <i>pos2</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Compares two positions.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">pos1</span>
|
||||
<span class="types"><span class="type">pos</span></span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">pos2</span>
|
||||
<span class="types"><span class="type">pos</span></span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
<code>true</code> if pos1 == pos2.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "cmer.findTarget"></a>
|
||||
<strong>cmer.findTarget (<i>search_obj</i>, <i>pos</i>, <i>radius</i>, <i>search_type</i>, <i>ignore_mob</i>[, <i>xray</i>], <i>no_count</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns table of found objects (as ObjectRef) and boolean player_near.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">search_obj</span>
|
||||
Searching object. Can be <code>nil</code>.
|
||||
</li>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">pos</span></span>
|
||||
Starting position for search radius.
|
||||
</li>
|
||||
<li><span class="parameter">radius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Radius for searching in blocks/node.
|
||||
</li>
|
||||
<li><span class="parameter">search_type</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Specifies returned object requirements(One of <strong><em>all</em></strong>, <strong><em>hostile</em></strong> (ignores <code>ignore_mob</code> if specified), <strong><em>nonhostile</em></strong>, <strong><em>player</em></strong>, <strong><em>mates</em></strong> (requires <code>ignore_mob</code> specifies)).
|
||||
</li>
|
||||
<li><span class="parameter">ignore_mob</span>
|
||||
Specifies creature that is ignored or searched, depending on <code>search_type</code>.
|
||||
</li>
|
||||
<li><span class="parameter">xray (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Allows searching through blocks/nodes (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">no_count</span>
|
||||
Skips collecting loop and returns just the boolean player_near.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
Table of found objects (as <code>ObjectRef</code>) and boolean player_near.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "cmer.dropItems"></a>
|
||||
<strong>cmer.dropItems (<i>pos</i>, <i>drops</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Drops items at position <code>pos</code>.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><span class="type">pos</span></span>
|
||||
Where to drop items.
|
||||
</li>
|
||||
<li><span class="parameter">drops</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
List of item <code>DropDef</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/AntumDeluge/LDoc">LDoc 1.4.6-antum-2</a></i>
|
||||
<i style="float:right;">Last updated 2021-05-05 14:19:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,974 @@
|
|||
<!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>Creatures Revived</title>
|
||||
<link rel="stylesheet" href="../ldoc.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>cmer</h1>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="../api.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Definition_Tables">Definition Tables </a></li>
|
||||
<li><a href="#Callbacks">Callbacks </a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><strong>register.lua</strong></li>
|
||||
<li><a href="../modules/common.lua.html">common.lua</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>register.lua</code></h1>
|
||||
<p>MOB Registration</p>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.register_mob">cmer.register_mob (<i>def</i>)</a></td>
|
||||
<td class="summary">Registers a new mob.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef">CreatureDef</a></td>
|
||||
<td class="summary">Creature definition table.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Definition_Tables">Definition Tables </a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#StatsDef">StatsDef</a></td>
|
||||
<td class="summary">Stats definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#ModeDef">ModeDef</a></td>
|
||||
<td class="summary">Modes definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#ModelDef">ModelDef</a></td>
|
||||
<td class="summary">Model definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#AnimationDef">AnimationDef</a></td>
|
||||
<td class="summary">Animations defiintion table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#SoundsDef">SoundsDef</a></td>
|
||||
<td class="summary">Sounds definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#SoundDef">SoundDef</a></td>
|
||||
<td class="summary">Sound definition.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#DropDef">DropDef</a></td>
|
||||
<td class="summary">Item drops definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CombatDef">CombatDef</a></td>
|
||||
<td class="summary">Combat definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#SpawnDef">SpawnDef</a></td>
|
||||
<td class="summary">Spawning definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#ABMNodesDef">ABMNodesDef</a></td>
|
||||
<td class="summary">ABM nodes definition table.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#SpawnerDef">SpawnerDef</a></td>
|
||||
<td class="summary">Spawner definition table.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Callbacks">Callbacks </a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef.on_rightclick">CreatureDef.on_rightclick (<i>self</i>, <i>clicker</i>)</a></td>
|
||||
<td class="summary">Called when mob is right-clicked.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef.on_punch">CreatureDef.on_punch (<i>self</i>, <i>puncher</i>)</a></td>
|
||||
<td class="summary">Called when mob is punched.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef.on_step">CreatureDef.on_step (<i>self</i>, <i>dtime</i>)</a></td>
|
||||
<td class="summary">Called each server step.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef.on_activate">CreatureDef.on_activate (<i>self</i>, <i>staticdata</i>)</a></td>
|
||||
<td class="summary">Called when mob (re-)activated.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#CreatureDef.get_staticdata">CreatureDef.get_staticdata (<i>self</i>)</a></td>
|
||||
<td class="summary">Called when mob is punched.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#cmer.register_alias">cmer.register_alias (<i>old_mob</i>, <i>new_mob</i>)</a></td>
|
||||
<td class="summary">Registers an alias for other mob, e.g.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "cmer.register_mob"></a>
|
||||
<strong>cmer.register_mob (<i>def</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Registers a new mob.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">def</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#CreatureDef">CreatureDef</a></span>
|
||||
Creature definition table.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
<code>true</code> if successfule.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "CreatureDef"></a>
|
||||
<strong>CreatureDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Creature definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
E.g. "creatures:sheep".
|
||||
</li>
|
||||
<li><span class="parameter">ownable</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Flag for defining if entity is ownable by players (default: <em>false</em>).
|
||||
</li>
|
||||
<li><span class="parameter">stats</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#StatsDef">StatsDef</a></span>
|
||||
Stats definitions.
|
||||
</li>
|
||||
<li><span class="parameter">modes</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#ModeDef">ModeDef</a></span>
|
||||
Entity bahavior defintions.
|
||||
</li>
|
||||
<li><span class="parameter">model</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#ModelDef">ModelDef</a></span>
|
||||
Model definitions.
|
||||
</li>
|
||||
<li><span class="parameter">sounds (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Table of <a href="../modules/register.lua.html#SoundDef">SoundDef</a>.
|
||||
</li>
|
||||
<li><span class="parameter">drops (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
List of item <a href="../modules/register.lua.html#DropDef">DropDef</a>. Can also be a function. receives "self" reference.
|
||||
</li>
|
||||
<li><span class="parameter">combat (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#CombatDef">CombatDef</a></span>
|
||||
Specifies behavior of hostile mobs in "attack" mode.
|
||||
</li>
|
||||
<li><span class="parameter">spawning (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#SpawnDef">SpawnDef</a></span>
|
||||
Defines spawning in world.
|
||||
</li>
|
||||
<li><span class="parameter">on_rightclick</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
see: <a href="../modules/register.lua.html#CreatureDef.on_rightclick">CreatureDef.on_rightclick</a>
|
||||
</li>
|
||||
<li><span class="parameter">on_punch</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
see: <a href="../modules/register.lua.html#CreatureDef.on_punch">CreatureDef.on_punch</a>
|
||||
</li>
|
||||
<li><span class="parameter">on_step</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
see: <a href="../modules/register.lua.html#CreatureDef.on_step">CreatureDef.on_step</a>
|
||||
</li>
|
||||
<li><span class="parameter">on_activate</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
see: <a href="../modules/register.lua.html#CreatureDef.on_activate">CreatureDef.on_activate</a>
|
||||
</li>
|
||||
<li><span class="parameter">get_staticdata</span>
|
||||
<span class="types"><span class="type">callback</span></span>
|
||||
see: <a href="../modules/register.lua.html#CreatureDef.get_staticdata">CreatureDef.get_staticdata</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Definition_Tables"></a>Definition Tables </h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "StatsDef"></a>
|
||||
<strong>StatsDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Stats definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">hp</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Full health level (1 HP = 1/2 player heart).
|
||||
</li>
|
||||
<li><span class="parameter">hostile (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Is mob hostile (required for mode "attack") (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">lifetime (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
After which time mob despawns, in seconds.
|
||||
</li>
|
||||
<li><span class="parameter">dies_when_tamed (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Stop despawn when tamed (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">can_jump (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Height in nodes (default: 0).
|
||||
</li>
|
||||
<li><span class="parameter">can_swim (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Can mob swim or will it drown (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">can_fly (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Allows to fly (requires mode "fly") and disable step sounds (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">can_burn (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Takes damage of lava (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">can_panic (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Runs fast around when hit (requires mode "walk") (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">has_falldamage (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Deals damage if falling more than 3 blocks (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">has_kockback (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Get knocked back when hit (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">sneaky (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Disables step sounds if <code>true</code> (default: <code>false</code>).
|
||||
</li>
|
||||
<li><span class="parameter">light (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
|
||||
<p> Which light level will burn creature (requires can_burn = true).</p>
|
||||
|
||||
<p> Example:</p>
|
||||
<pre><code> light = {min=10, max=15}
|
||||
</code></pre>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "ModeDef"></a>
|
||||
<strong>ModeDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Modes definition table. </p>
|
||||
|
||||
<p> Entity behavior definition. Behavior types are <strong><em>idle</em></strong>, <strong><em>walk</em></strong>, <strong><em>attack</em></strong>, <strong><em>follow</em></strong>, <strong><em>eat</em></strong>, <strong><em>death</em></strong>, & <strong><em>panic</em></strong>. The sum of all modes must be 1.0.</p>
|
||||
|
||||
<p> Example:</p>
|
||||
<pre><code> modes = {
|
||||
idle = {chance=0.3,},
|
||||
walk = {chance=0.7, moving_speed=1,},
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">chance</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Number between 0.0 and 1.0 (<strong>*NOTE:</strong> sum of all modes MUST be 1.0*). If chance is 0 then mode is not chosen automatically.
|
||||
</li>
|
||||
<li><span class="parameter">duration</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Time in seconds until the next mode is chosen (depending on chance).
|
||||
</li>
|
||||
<li><span class="parameter">moving_speed (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Moving speed (walking/flying/swimming).
|
||||
</li>
|
||||
<li><span class="parameter">update_yaw (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Timer in seconds until the looking dir is changed. If moving_speed > 0 then the moving direction is also changed.
|
||||
</li>
|
||||
<li><span class="parameter">radius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
<em>(follow & eat modes only)</em> Search distance in blocks/nodes for player.
|
||||
</li>
|
||||
<li><span class="parameter">timer</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
<em>(follow & eat modes only)</em> Time in seconds between each check for player.
|
||||
</li>
|
||||
<li><span class="parameter">items</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
<em>(follow & eat modes only)</em> Table of items to make mob follow in format {<Itemname>, <Itemname>}; e.g. {"farming:wheat"}.
|
||||
</li>
|
||||
<li><span class="parameter">nodes</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
<em>(eat mode only)</em> Eatable nodes in format {<Itemname>, <Itemname>}; e.g. {"default:dirt_with_grass"}.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "ModelDef"></a>
|
||||
<strong>ModelDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Model definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">mesh</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Mesh name (see Minetest Documentation for supported filetypes).
|
||||
</li>
|
||||
<li><span class="parameter">textures</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Table of textures (see Minetest Documentation).
|
||||
</li>
|
||||
<li><span class="parameter">collisionbox</span>
|
||||
<span class="types"><span class="type">NodeBox</span></span>
|
||||
Defines mesh collision box (see Minetest Documentation).
|
||||
</li>
|
||||
<li><span class="parameter">rotation (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Sets rotation offset when moving (default: 0.0).
|
||||
</li>
|
||||
<li><span class="parameter">backface_culling (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Set to <code>true</code> to enable backface culling.
|
||||
</li>
|
||||
<li><span class="parameter">animations (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Table of <a href="../modules/register.lua.html#AnimationDef">AnimationDef</a> used if defined.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "AnimationDef"></a>
|
||||
<strong>AnimationDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Animations defiintion table. </p>
|
||||
|
||||
<p> Animations coincide with modes. E.g. <strong><em>idle</em></strong>, <strong><em>walk</em></strong>, etc.</p>
|
||||
|
||||
<p> Example:</p>
|
||||
<pre><code> animations = {
|
||||
idle = {start=25, stop=75, speed=15,},
|
||||
walk = {start=75, stop=100, speed=15,},
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">start</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Start frame.
|
||||
</li>
|
||||
<li><span class="parameter">stop</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
End frame.
|
||||
</li>
|
||||
<li><span class="parameter">speed</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Animation speed.
|
||||
</li>
|
||||
<li><span class="parameter">loop (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If <code>false</code>, animation if just played once (default: <code>true</code>).
|
||||
</li>
|
||||
<li><span class="parameter">duration (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
<em>(death mode only)</em> Sets time the animation needs until mob is removed.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "SoundsDef"></a>
|
||||
<strong>SoundsDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Sounds definition table. </p>
|
||||
|
||||
<p> Sounds can be defined for these actions: <strong>*on_damage*</strong>, <strong>*on_death*</strong>, <strong><em>swim</em></strong>, & <strong><em>random</em></strong>.</p>
|
||||
|
||||
<p> <strong><em>random</em></strong> is a table of <a href="../modules/register.lua.html#SoundDef">SoundDef</a> that will be played randomly during the modes for which they are set.</p>
|
||||
|
||||
<p> Example:</p>
|
||||
<pre><code> sounds = {
|
||||
on_damage = {name="creatures_horse_neigh_02", gain=1.0},
|
||||
on_death = {name="creatures_horse_snort_02", gain=1.0},
|
||||
random = {
|
||||
idle = {name="creatures_horse_snort_01", gain=1.0},
|
||||
follow = {name="creatures_horse_neigh_01", gain=1.0, time_min=10},
|
||||
},
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">on_damage (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#SoundDef">SoundDef</a></span>
|
||||
Sound played when entity is hit.
|
||||
</li>
|
||||
<li><span class="parameter">on_death (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#SoundDef">SoundDef</a></span>
|
||||
Sound played when entity dies.
|
||||
</li>
|
||||
<li><span class="parameter">swim (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#SoundDef">SoundDef</a></span>
|
||||
Sound played while entity is swimming.
|
||||
</li>
|
||||
<li><span class="parameter">Random (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Sounds that will play randomly during specified modes. E.g. <strong><em>idle</em></strong>, <strong><em>walk</em></strong>, etc.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "SoundDef"></a>
|
||||
<strong>SoundDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Sound definition.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Sound file name without file type extension (e.g. "my<em>sound", not "my</em>sound.ogg") (see Minetest documentation).
|
||||
</li>
|
||||
<li><span class="parameter">gain</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Sound gain (see Minetest documentation).
|
||||
</li>
|
||||
<li><span class="parameter">distance (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Distance in blocks/nodes at which sound can be heard.
|
||||
</li>
|
||||
<li><span class="parameter">time_min (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
<em>(random mode only)</em> Minimum time in seconds between sounds.
|
||||
</li>
|
||||
<li><span class="parameter">time_max (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
<em>(random mode only)</em> Maximum time in seconds between sounds.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "DropDef"></a>
|
||||
<strong>DropDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Item drops definition table. </p>
|
||||
|
||||
<p> Example:</p>
|
||||
<pre><code> drops = {
|
||||
{"default:wood"}, -- 1 item with 100% chance
|
||||
{"default:wool", 1, chance=0.3}, -- 1 item with 30% chance
|
||||
{"default:stick", {min=2, max=3}, chance=0.2}, -- between 2-3 items with 20% chance
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "CombatDef"></a>
|
||||
<strong>CombatDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Combat definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">attack_damage</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
How much damage is dealt on each hit.
|
||||
</li>
|
||||
<li><span class="parameter">attack_speed (<em>optional</em>)</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Time in seconds between hits (default: 1.0).
|
||||
</li>
|
||||
<li><span class="parameter">attack_radius</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Distance in blocks mob can reach to hit.
|
||||
</li>
|
||||
<li><span class="parameter">search_enemy</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
<code>true</code> to search enemies to attack.
|
||||
</li>
|
||||
<li><span class="parameter">search_timer</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Time in seconds to search an enemy (only if none found yet).
|
||||
</li>
|
||||
<li><span class="parameter">search_radius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Radius in blocks within enemies are searched.
|
||||
</li>
|
||||
<li><span class="parameter">search_type</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
What enemy is being searched (see types at <code>cmer.findTarget</code>).
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "SpawnDef"></a>
|
||||
<strong>SpawnDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Spawning definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">abm_nodes</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#ABMNodesDef">ABMNodesDef</a></span>
|
||||
On what nodes mob can spawn.
|
||||
</li>
|
||||
<li><span class="parameter">abm_interval</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Time in seconds until Minetest tries to find a node with set specs.
|
||||
</li>
|
||||
<li><span class="parameter">abm_chance</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Chance is 1/<chance>.
|
||||
</li>
|
||||
<li><span class="parameter">max_number</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Maximum mobs of this kind per mapblock (16x16x16).
|
||||
</li>
|
||||
<li><span class="parameter">number</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
How many mobs are spawned if found suitable spawn position. Can be <code>int</code> or <a href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a>: number = {min=<value>, max=<value>}
|
||||
</li>
|
||||
<li><span class="parameter">time_range (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Time range in time of day format (0-24000) (table with <em>min</em> & <em>max</em> values).
|
||||
</li>
|
||||
<li><span class="parameter">light (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Min and max lightvalue at spawn position (table with <em>min</em> & <em>max</em> values).
|
||||
</li>
|
||||
<li><span class="parameter">height_limit (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Min and max height (world Y coordinate) (table with <em>min</em> & <em>max</em> values).
|
||||
</li>
|
||||
<li><span class="parameter">spawn_egg (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Is set a spawn_egg is added to creative inventory (table with <em>description</em> & <em>texture</em> values).
|
||||
</li>
|
||||
<li><span class="parameter">spawner (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="../modules/register.lua.html#SpawnerDef">SpawnerDef</a></span>
|
||||
Is set a spawner_node is added to creative inventory.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "ABMNodesDef"></a>
|
||||
<strong>ABMNodesDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
ABM nodes definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">spawn_on (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
List of nodes on which the mob can spawn.
|
||||
</li>
|
||||
<li><span class="parameter">neighbors</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
List of nodes that should be neighbors where mob can spawn. Can be nil or table as above. "air" is forced always as neighbor.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "SpawnerDef"></a>
|
||||
<strong>SpawnerDef</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Spawner definition table.
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">range</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Defines an area (in blocks/nodes) within mobs are spawned.
|
||||
</li>
|
||||
<li><span class="parameter">number</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Maxmimum number of mobs spawned in area defined via range.
|
||||
</li>
|
||||
<li><span class="parameter">description (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Item description as string.
|
||||
</li>
|
||||
<li><span class="parameter">light (<em>optional</em>)</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
Min and max lightvalue at spawn position.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Callbacks"></a>Callbacks </h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "CreatureDef.on_rightclick"></a>
|
||||
<strong>CreatureDef.on_rightclick (<i>self</i>, <i>clicker</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called when mob is right-clicked.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">clicker</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Prevents default action when returns <code>true</code>.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "CreatureDef.on_punch"></a>
|
||||
<strong>CreatureDef.on_punch (<i>self</i>, <i>puncher</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called when mob is punched.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">puncher</span>
|
||||
Can be <code>nil</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Prevents default action when returns <code>true</code>.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "CreatureDef.on_step"></a>
|
||||
<strong>CreatureDef.on_step (<i>self</i>, <i>dtime</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called each server step.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">dtime</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Prevents default action when returns <code>true</code>.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "CreatureDef.on_activate"></a>
|
||||
<strong>CreatureDef.on_activate (<i>self</i>, <i>staticdata</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called when mob (re-)activated. </p>
|
||||
|
||||
<p> Note: staticdata is deserialized by MOB-Engine (including costum values).
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">staticdata</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "CreatureDef.get_staticdata"></a>
|
||||
<strong>CreatureDef.get_staticdata (<i>self</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Called when mob is punched. </p>
|
||||
|
||||
<p> Must return a table to save mob data (serialization is done by MOB-Engine).
|
||||
e.g:
|
||||
``<code></p>
|
||||
<pre><code>return {
|
||||
costum\_mob\_data = self.my\_value,
|
||||
}
|
||||
</code></pre>
|
||||
<p> </code>``
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">self</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
||||
|
||||
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "cmer.register_alias"></a>
|
||||
<strong>cmer.register_alias (<i>old_mob</i>, <i>new_mob</i>)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Registers an alias for other mob, e.g. from other mods or removed ones.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">old_mob</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Name of mob to be replaced. E.g. "creatures:oerrki"
|
||||
</li>
|
||||
<li><span class="parameter">new_mob</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
||||
Name of mob that will replace instances old one. E.g. "creatures:oerkki"
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
<code>true</code> if successful.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/AntumDeluge/LDoc">LDoc 1.4.6-antum-2</a></i>
|
||||
<i style="float:right;">Last updated 2021-05-05 14:19:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue