khanat-opennel-code/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type/code.html
2010-05-06 02:08:41 +02:00

2402 lines
198 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Ryzom AI service: Le script d&apos;AI</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<div class="header">
<div class="nav">
<!-- <a href="../../../index.html">Liam3</a> -->
</div>
<div class="index">
<a href="index.html">Main Page</a>
<a href="modules.html">Modules</a>
<a href="hierarchy.html">Class Hierarchy</a>
<a href="todo.html">Todo</a>
<a href="annotated.html">Compound List</a>
<a href="files.html">File List</a>
<a href="pages.html">Related Pages</a>
</div>
</div>
<div class="maindox">
<!-- Generated by Doxygen 1.5.2 -->
<h1><a class="anchor" name="code">Le script d'AI</a></h1><h2><a class="anchor" name="general">
General information</a></h2>
Its a C like code.<p>
Comments are defined after two slashes like this: <div class="fragment"><pre class="fragment"><span class="comment">// my comment</span>
</pre></div><p>
Code is used to specify decisions for state machine on group. Each group can have different variables and functions, they can only be affected via code only.<p>
Variables don't need to be defined before they are used. They are automatically created with value equals to 0 or "".<p>
Variables are either floating point numbers (no prefix), character strings ('$' prefix) or script contexts ('@' prefix).<p>
There are two special object that are hard-coded and that can be used to call function:<ul>
<li>parent: represent the parent group of the current group</li><li>caller: represent the group that called a function on the current group</li></ul>
<p>
Additionnaly one can reference any static group defined in the same AI instance by its name. The usage is similar to that of 'parent' and 'caller'. In fact 'parent', 'caller' and group names are a kind of pseudo-contexts and can be used as such (without the '@' prefix).<h2><a class="anchor" name="debugAndLog">
Debug and log</a></h2>
There are two special function for debug and logging:<ul>
<li>print: used for debug purpose, removed in release mode</li><li>log: used to display any information that should be read in release mode</li></ul>
<p>
Syntax: <div class="fragment"><pre class="fragment">print(<span class="stringliteral">"foo"</span>);
log(<span class="stringliteral">"bar"</span>);
</pre></div><p>
NB: you can put any number of const string (e.g. "toto") and var (<code>float</code> or <code>$string</code>) separated by coma. All the string representation are concatenated to form the final string.<p>
E.g: <div class="fragment"><pre class="fragment">print(<span class="stringliteral">"Ma position est "</span>, x, <span class="stringliteral">":"</span>, y);
</pre></div><h2><a class="anchor" name="aboutFunctions">
About functions</a></h2>
You can dynamically define function on the group.<p>
This function are called <em>script function</em> or <em>user function</em> (as opposed to the hard coded <20>native function<6F>).<p>
User functions don't have parameters.<p>
Functions can be defined this way: <div class="fragment"><pre class="fragment">my_function()
{
print(<span class="stringliteral">"message"</span>); <span class="comment">// print a message</span>
mavar = 5*mavar; <span class="comment">// the variable mavar is now equals to mavar*5</span>
caller.mavar = mavar; <span class="comment">// the variable mavar of the caller's is now equal to mavar (see bellow for more explanation)</span>
}
</pre></div> You can call a function like this (note that if a function is not defined for a group, nothing is called): <div class="fragment"><pre class="fragment">my_function(); <span class="comment">// call my_function from this group</span>
group1_tryker.my_function(); <span class="comment">// call my_function for group1_tryker (inside this function the current group is accessible via caller keyword) </span>
</pre></div><h2><a class="anchor" name="variableManipulation">
Variable manipulation</a></h2>
Some simple mathematical operators can be used: +, -, /, * with parenthesis or not.<p>
E.g.: <div class="fragment"><pre class="fragment">mavar =(5*mavar+1)/3;
</pre></div> Note that the negative operator should be used with caution, YOU MUST add a space after the <20>-<2D> symbol.<p>
You can do comparison with variables and or numbers (can be used for if and while statements). Note that you can't do mathematical computation inside the if parameter (you CANNOT write if (x+10 &lt; 20)). <div class="fragment"><pre class="fragment">mavar = 10;
<span class="keywordflow">if</span>(mavar &lt; 10)
{
...
}
</pre></div> In the above code we could replace <em>caller</em> by <em>parent</em> which is another keyword that indicate the parent of a machine state.<p>
The parent/children relation is defined for dynamic spawned groups (see below native functions).<h2><a class="anchor" name="codeFlowStructure">
Code flow structure</a></h2>
<h3><a class="anchor" name="codeFlowStructureClassic">
Classical code flow constructs</a></h3>
<em>while</em>, <em>if</em>, <em>else</em> can be used as in C.<h3><a class="anchor" name="codeFlowStructureOnChildren">
onchildren</a></h3>
<em>onchildren</em> special construct allow you to execute a script block on all the child of the current group. <div class="fragment"><pre class="fragment">onchildren()
{
...
}
</pre></div><h3><a class="anchor" name="codeFlowStructureOnChildren">
onchildren</a></h3>
<em>random</em> special construct allow you to execute randomly a block of code among several. One instruction in the block following rand keyword is chosen and executed. This instruction can be a block, in which case the whole block is executed. <div class="fragment"><pre class="fragment">random()
{
block1();
{ <span class="comment">// Block2 begin</span>
print(<span class="stringliteral">"foo"</span>);
} <span class="comment">// Block2 end</span>
(bar)block3(baf);
}
</pre></div><h2><a class="anchor" name="nativeFunctionCalls">
Native function calls</a></h2>
Native calls are available too. Native calls offer hard coded services to the scripter.<p>
Native calls have input and output parameters (AKA parameters and return values). <div class="fragment"><pre class="fragment">(destVar1,destVar2)nativeMethod(ParamVar1);
</pre></div> This line calls the function nativeMethod for the current group. The left parenthesis are used to define output arguments, the right for input arguments.<h2><a class="anchor" name="nativeFunctionList">
Quick reference list of native functions</a></h2>
<h3><a class="anchor" name="nativeFunctionsSpawn">
Spawn/despawn</a></h3>
<ul>
<li><a class="el" href="code.html#spawn__">spawn__</a></li><li><a class="el" href="code.html#despawn_f_">despawn_f_</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsTriggers">
Event handler creation</a></h3>
<ul>
<li><a class="el" href="code.html#addHpUpTrigger_ff_">addHpUpTrigger_ff_</a></li><li><a class="el" href="code.html#addHpDownTrigger_ff_">addHpDownTrigger_ff_</a></li><li><a class="el" href="code.html#delHpUpTrigger_ff_">delHpUpTrigger_ff_</a></li><li><a class="el" href="code.html#delHpDownTrigger_ff_">delHpDownTrigger_ff_</a></li><li><a class="el" href="code.html#addHpUpTrigger_fs_">addHpUpTrigger_fs_</a></li><li><a class="el" href="code.html#addHpDownTrigger_fs_">addHpDownTrigger_fs_</a></li><li><a class="el" href="code.html#delHpUpTrigger_fs_">delHpUpTrigger_fs_</a></li><li><a class="el" href="code.html#delHpDownTrigger_fs_">delHpDownTrigger_fs_</a></li><li><a class="el" href="code.html#addNamedEntityListener_ssf_">addNamedEntityListener_ssf_</a></li><li><a class="el" href="code.html#delNamedEntityListener_ssf_">delNamedEntityListener_ssf_</a></li><li><a class="el" href="code.html#addNamedEntityListener_sss_">addNamedEntityListener_sss_</a></li><li><a class="el" href="code.html#delNamedEntityListener_sss_">delNamedEntityListener_sss_</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsActions">
Actions</a></h3>
<ul>
<li><a class="el" href="code.html#setEvent_f_">setEvent_f_</a></li><li><a class="el" href="code.html#getEventParam_f_f">getEventParam_f_f</a></li><li><a class="el" href="code.html#getEventParam_f_s">getEventParam_f_s</a></li><li><a class="el" href="code.html#setTimer_ff_">setTimer_ff_</a></li><li><a class="el" href="code.html#timerSetRyzomDaytime_fff_">timerSetRyzomDaytime_fff_</a></li><li><a class="el" href="code.html#timerDisable_f_">timerDisable_f_</a></li><li><a class="el" href="code.html#timerSuspend_f_">timerSuspend_f_</a></li><li><a class="el" href="code.html#timerResume_f_">timerResume_f_</a></li><li><a class="el" href="code.html#timerAdd_ff_">timerAdd_ff_</a></li><li><a class="el" href="code.html#timerIsEnabled_f_f">timerIsEnabled_f_f</a></li><li><a class="el" href="code.html#timerIsSuspended_f_f">timerIsSuspended_f_f</a></li><li><a class="el" href="code.html#dssStartAct_ff_">dssStartAct_ff_</a></li><li><a class="el" href="code.html#postNextState_s_">postNextState_s_</a></li><li><a class="el" href="code.html#moveToZone_ss_">moveToZone_ss_</a></li><li><a class="el" href="code.html#waitInZone_s_">waitInZone_s_</a></li><li><a class="el" href="code.html#stopMoving__">stopMoving__</a></li><li><a class="el" href="code.html#wander__">wander__</a></li><li><a class="el" href="code.html#downScaleHP_f_">downScaleHP_f_</a></li><li><a class="el" href="code.html#upScaleHP_f_">upScaleHP_f_</a></li><li><a class="el" href="code.html#scaleHP_f_">scaleHP_f_</a></li><li><a class="el" href="code.html#setHPLevel_f_">setHPLevel_f_</a></li><li><a class="el" href="code.html#addHP_f_">addHP_f_</a></li><li><a class="el" href="code.html#aiAction_s_">aiAction_s_</a></li><li><a class="el" href="code.html#aiActionSelf_s_">aiActionSelf_s_</a></li><li><a class="el" href="code.html#setPlayerController_ss_">setPlayerController_ss_</a></li><li><a class="el" href="code.html#clearPlayerController_s_">clearPlayerController_s_</a></li><li>activateEasterEgg_fffsfff_</li><li><a class="el" href="code.html#deactivateEasterEgg_fff_">deactivateEasterEgg_fff_</a></li><li><a class="el" href="code.html#receiveMissionItems_ssc_">receiveMissionItems_ssc_</a></li><li><a class="el" href="code.html#giveMissionItems_ssc_">giveMissionItems_ssc_</a></li><li><a class="el" href="code.html#talkTo_sc_">talkTo_sc_</a></li><li>giveRewardTo_sc_</li></ul>
<h3><a class="anchor" name="nativeFunctionsGroupCreation">
Group creation</a></h3>
<ul>
<li><a class="el" href="code.html#newNpcChildGroup_sss_">newNpcChildGroup_sss_</a></li><li><a class="el" href="code.html#newNpcChildGroup_sssf_">newNpcChildGroup_sssf_</a></li><li><a class="el" href="code.html#newNpcChildGroupPos_ssff_">newNpcChildGroupPos_ssff_</a></li><li><a class="el" href="code.html#newNpcChildGroupPos_ssfff_">newNpcChildGroupPos_ssfff_</a></li><li><a class="el" href="code.html#newNpcChildGroupMl_sssf_">newNpcChildGroupMl_sssf_</a></li><li><a class="el" href="code.html#newNpcChildGroupMl_sssff_">newNpcChildGroupMl_sssff_</a></li><li><a class="el" href="code.html#newNpcChildGroupPosMl_ssfff_">newNpcChildGroupPosMl_ssfff_</a></li><li><a class="el" href="code.html#newNpcChildGroupPosMl_ssffff_">newNpcChildGroupPosMl_ssffff_</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsPrimitiveLookup">
Primitive lookup</a></h3>
<ul>
<li><a class="el" href="code.html#getGroupTemplateWithFlags_ss_s">getGroupTemplateWithFlags_ss_s</a></li><li><a class="el" href="code.html#getGroupTemplateWithFlags_sss_s">getGroupTemplateWithFlags_sss_s</a></li><li><a class="el" href="code.html#getZoneWithFlags_sss_s">getZoneWithFlags_sss_s</a></li><li><a class="el" href="code.html#getZoneWithFlags_ssss_s">getZoneWithFlags_ssss_s</a></li><li><a class="el" href="code.html#getNeighbourZoneWithFlags_sss_s">getNeighbourZoneWithFlags_sss_s</a></li><li><a class="el" href="code.html#getNeighbourZoneWithFlags_ssss_s">getNeighbourZoneWithFlags_ssss_s</a></li><li><a class="el" href="code.html#getNearestZoneWithFlags_ffss_s">getNearestZoneWithFlags_ffss_s</a></li><li><a class="el" href="code.html#getNearestZoneWithFlags_ffsss_s">getNearestZoneWithFlags_ffsss_s</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsGroupAccessors">
Group parameters</a></h3>
<ul>
<li><a class="el" href="code.html#getMidPos__ff">getMidPos__ff</a></li><li><a class="el" href="code.html#getStateName__s">getStateName__s</a></li><li><a class="el" href="code.html#setActivity_s_">setActivity_s_</a></li><li><a class="el" href="code.html#setDynEnergy_sff_">setDynEnergy_sff_</a></li><li><a class="el" href="code.html#copyDynEnergy_sff_">copyDynEnergy_sff_</a></li><li><a class="el" href="code.html#setAggro_ff_">setAggro_ff_</a></li><li><a class="el" href="code.html#setCanAggro_f_">setCanAggro_f_</a></li><li><a class="el" href="code.html#clearAggroList_f_">clearAggroList_f_</a></li><li><a class="el" href="code.html#clearAggroList__">clearAggroList__</a></li><li><a class="el" href="code.html#setAttackable_f_">setAttackable_f_</a></li><li><a class="el" href="code.html#setPlayerAttackable_f_">setPlayerAttackable_f_</a></li><li><a class="el" href="code.html#setBotAttackable_f_">setBotAttackable_f_</a></li><li><a class="el" href="code.html#setFactionAttackableAbove_sff_">setFactionAttackableAbove_sff_</a></li><li><a class="el" href="code.html#setFactionAttackableBelow_sff_">setFactionAttackableBelow_sff_</a></li><li><a class="el" href="code.html#setMode_s_">setMode_s_</a></li><li><a class="el" href="code.html#setDespawnTime_f_">setDespawnTime_f_</a></li><li><a class="el" href="code.html#setRespawnTime_f_">setRespawnTime_f_</a></li><li><a class="el" href="code.html#setAutoSpawn_f_">setAutoSpawn_f_</a></li><li><a class="el" href="code.html#setFactionProp_ss_">setFactionProp_ss_</a></li><li><a class="el" href="code.html#addProfileParameter_s_">addProfileParameter_s_</a></li><li><a class="el" href="code.html#addProfileParameter_ss_">addProfileParameter_ss_</a></li><li><a class="el" href="code.html#addProfileParameter_sf_">addProfileParameter_sf_</a></li><li><a class="el" href="code.html#removeProfileParameter_s_">removeProfileParameter_s_</a></li><li><a class="el" href="code.html#addBotChat_s_">addBotChat_s_</a></li><li><a class="el" href="code.html#clearBotChat__">clearBotChat__</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsPhraseManagement">
Phrase management</a></h3>
<ul>
<li><a class="el" href="code.html#setSimplePhrase_ss_">setSimplePhrase_ss_</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsPersistency">
Persistency functions</a></h3>
<ul>
<li><a class="el" href="code.html#dataGetVar_s_s">dataGetVar_s_s</a></li><li><a class="el" href="code.html#dataGetVar_s_f">dataGetVar_s_f</a></li><li><a class="el" href="code.html#dataSetVar_ss_">dataSetVar_ss_</a></li><li><a class="el" href="code.html#dataSetVar_sf_">dataSetVar_sf_</a></li><li><a class="el" href="code.html#dataSave__">dataSave__</a></li></ul>
<h3><a class="anchor" name="nativeFunctionBoss">
Boss Functions</a></h3>
<h4><a class="anchor" name="nativeFunctionsBossText">
Sending Text/Emote/System with parameters</a></h4>
<ul>
<li><a class="el" href="code.html#phraseBegin__">phraseBegin__</a></li><li><a class="el" href="code.html#phrasePushValue_sf_">phrasePushValue_sf_</a></li><li><a class="el" href="code.html#phrasePushString_ss_">phrasePushString_ss_</a></li><li><a class="el" href="code.html#phraseEndNpcMsg_fss_">phraseEndNpcMsg_fss_</a></li><li><a class="el" href="code.html#phraseEndSystemMsg_fss_">phraseEndSystemMsg_fss_</a></li><li><a class="el" href="code.html#phraseEndEmoteMsg_fs_">phraseEndEmoteMsg_fs_</a></li></ul>
<h4><a class="anchor" name="nativeFunctionsBossTime">
Knowing Date of the server / Time in game</a></h4>
<ul>
<li><a class="el" href="code.html#getServerTimeStr__s">getServerTimeStr__s</a></li><li><a class="el" href="code.html#getServerTime__s">getServerTime__s</a></li><li><a class="el" href="code.html#getRyzomDateStr__s">getRyzomDateStr__s</a></li><li><a class="el" href="code.html#getRyzomDate__s">getRyzomDate__s</a></li></ul>
<h4><a class="anchor" name="nativeFunctionBossPlayer">
Knowing infos on the player</a></h4>
<ul>
<li><a class="el" href="code.html#isPlayerAlived_s_f">isPlayerAlived_s_f</a></li><li><a class="el" href="code.html#getPlayerStat_ss_f">getPlayerStat_ss_f</a></li><li><a class="el" href="code.html#getPlayerDistance_fs_f">getPlayerDistance_fs_f</a></li><li><a class="el" href="code.html#getCurrentPlayerEid__s">getCurrentPlayerEid__s</a></li><li><a class="el" href="code.html#queryEgs_sscfs_">queryEgs_sscfs_</a></li><li><a class="el" href="nf__grp_8cpp.html#d2af57df2391ce4adbd131172e6e2c0b">queryEgs_ssscfs_</a></li></ul>
<h4><a class="anchor" name="nativeFunctionBossBotInfo">
Infos on bot</a></h4>
<ul>
<li><a class="el" href="code.html#getBotIndex_s_f">getBotIndex_s_f</a></li><li><a class="el" href="code.html#getBotEid_f_s">getBotEid_f_s</a></li><li><a class="el" href="code.html#getCurrentSpeakerEid__s">getCurrentSpeakerEid__s</a></li><li><a class="el" href="code.html#getBotIndexByName_s_f">getBotIndexByName_s_f</a></li><li><a class="el" href="code.html#isGroupAlived__f">isGroupAlived__f</a></li><li><a class="el" href="code.html#isBotAlived_f_f">isBotAlived_f_f</a></li></ul>
<h4><a class="anchor" name="nativeFunctionBossAggro">
Aggro functions</a></h4>
<ul>
<li><a class="el" href="code.html#getCurrentPlayerAggroListTarget_f_s">getCurrentPlayerAggroListTarget_f_s</a></li><li><a class="el" href="code.html#getRandomPlayerAggroListTarget_f_s">getRandomPlayerAggroListTarget_f_s</a></li><li><a class="el" href="code.html#getAggroListElement_ff_s">getAggroListElement_ff_s</a></li><li><a class="el" href="code.html#getAggroListSize_f_f">getAggroListSize_f_f</a></li><li><a class="el" href="code.html#setAggroListTarget_fs_">setAggroListTarget_fs_</a></li><li><a class="el" href="code.html#setGroupAggroListTarget_s_">setGroupAggroListTarget_s_</a></li><li><a class="el" href="code.html#setManagerAggroListTarget_ss_">setManagerAggroListTarget_ss_</a></li><li><a class="el" href="code.html#setAggro_ff_">setAggro_ff_</a></li><li><a class="el" href="code.html#setCanAggro_f_">setCanAggro_f_</a></li><li><a class="el" href="code.html#clearAggroList__">clearAggroList__</a></li></ul>
<h4><a class="anchor" name="nativeFunctionTeleport">
Teleport Functions</a></h4>
<ul>
<li><a class="el" href="code.html#teleportPlayer_sffff_">teleportPlayer_sffff_</a></li><li><a class="el" href="code.html#summonPlayer_fs_">summonPlayer_fs_</a></li></ul>
<h3><a class="anchor" name="nativeFunctionsMisc">
Misc function (not related to current group)</a></h3>
<h4><a class="anchor" name="nativeFunctionsMiscMath">
Math functions</a></h4>
<ul>
<li><a class="el" href="code.html#clamp_fff_f">clamp_fff_f</a></li><li><a class="el" href="code.html#min_ff_f">min_ff_f</a></li><li><a class="el" href="code.html#max_ff_f">max_ff_f</a></li><li><a class="el" href="code.html#rndm_ff_f">rndm_ff_f</a></li><li><a class="el" href="code.html#floor_f_f">floor_f_f</a></li><li><a class="el" href="code.html#ceil_f_f">ceil_f_f</a></li><li><a class="el" href="code.html#round_f_f">round_f_f</a></li><li><a class="el" href="code.html#abs_f_f">abs_f_f</a></li><li><a class="el" href="code.html#sin_f_f">sin_f_f</a></li><li><a class="el" href="code.html#asin_f_f">asin_f_f</a></li><li><a class="el" href="code.html#sinh_f_f">sinh_f_f</a></li><li><a class="el" href="code.html#cos_f_f">cos_f_f</a></li><li><a class="el" href="code.html#acos_f_f">acos_f_f</a></li><li><a class="el" href="code.html#cosh_f_f">cosh_f_f</a></li><li><a class="el" href="code.html#tan_f_f">tan_f_f</a></li><li><a class="el" href="code.html#atan_f_f">atan_f_f</a></li><li><a class="el" href="code.html#tanh_f_f">tanh_f_f</a></li><li><a class="el" href="code.html#sqrt_f_f">sqrt_f_f</a></li><li><a class="el" href="code.html#exp_f_f">exp_f_f</a></li><li><a class="el" href="code.html#pow_ff_f">pow_ff_f</a></li></ul>
<h4><a class="anchor" name="nativeFunctionsMiscString">
String functions</a></h4>
<ul>
<li><a class="el" href="code.html#strlen_s_f">strlen_s_f</a></li><li><a class="el" href="code.html#substr_sff_s">substr_sff_s</a></li><li><a class="el" href="code.html#strtof_s_f">strtof_s_f</a></li><li><a class="el" href="code.html#strtof_s_ff">strtof_s_ff</a></li><li><a class="el" href="code.html#strtof_s_fff">strtof_s_fff</a></li><li><a class="el" href="code.html#import_s_">import_s_</a></li></ul>
<h4><a class="anchor" name="nativeFunctionsMiscNelVar">
NeL variables management</a></h4>
<ul>
<li><a class="el" href="code.html#setNelVar_sf_">setNelVar_sf_</a></li><li><a class="el" href="code.html#getNelVar_s_f">getNelVar_s_f</a></li><li><a class="el" href="nf__state__instance_8cpp.html#ed736ee7b59d206acbc916aa6f1e46e6">delNelVar_sf_</a></li><li><a class="el" href="code.html#setNelVar_ss_">setNelVar_ss_</a></li><li><a class="el" href="code.html#getNelVar_s_s">getNelVar_s_s</a></li><li><a class="el" href="code.html#delNelVar_ss_">delNelVar_ss_</a></li></ul>
<h4><a class="anchor" name="nativeFunctionsMiscNamedEntities">
Named entities management</a></h4>
<ul>
<li><a class="el" href="code.html#createNamedEntity_s_">createNamedEntity_s_</a></li><li><a class="el" href="code.html#setNamedEntityProp_sss_">setNamedEntityProp_sss_</a></li><li><a class="el" href="code.html#setNamedEntityPropCb_sss_">setNamedEntityPropCb_sss_</a></li><li><a class="el" href="code.html#getNamedEntityProp_ss_s">getNamedEntityProp_ss_s</a></li><li><a class="el" href="code.html#destroyNamedEntity_s_">destroyNamedEntity_s_</a></li></ul>
<h4><a class="anchor" name="nativeFunctionsMiscManagers">
Foreign managers access</a></h4>
<ul>
<li><a class="el" href="code.html#spawnManager_s_">spawnManager_s_</a></li><li><a class="el" href="code.html#despawnManager_s_">despawnManager_s_</a></li></ul>
<h2><a class="anchor" name="nativeFunctions">
Detailed documentation of native functions</a></h2>
<h3><a class="anchor" name="copyDynEnergy_sff_">
copyDynEnergy_sff_</a></h3>
Copy energy values from an index to another, on all groups matching the specified request. Valid index values are integers from 0 to 3.<p>
Request is of the form "[family-&lt;family_name&gt;] [cellZone-&lt;cellzone_name&gt;]". Names can contain wild cards (? and *).<p>
Arguments: s(Request), f(IndexSrc), f(IndexDst) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Request</em>&nbsp;</td><td>is a request of the form "[family-&lt;family_name&gt;] [cellZone-&lt;cellzone_name&gt;]" </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>IndexSrc</em>&nbsp;</td><td>is a an index number in energy system </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>IndexDst</em>&nbsp;</td><td>is a an index number in energy system</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()copyDynEnergy(<span class="stringliteral">"family-tribu*"</span>, SourceIndex , DestinationIndex); <span class="comment">// Copy the dyn energy of groups defined by family-tribu* from slot SourceIndex to slot DestinationIndex</span>
</pre></div><h3><a class="anchor" name="setDynEnergy_sff_">
setDynEnergy_sff_</a></h3>
Sets energy values on an index, on all groups matching the specified request. Valid index values are integers from 0 to 3. Valid values range from 0 to 1.<p>
Request is of the form "[family-&lt;family_name&gt;] [cellZone-&lt;cellzone_name&gt;]". Names can contain wild cards (? and *).<p>
Arguments: s(Request), f(Index), f(Value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Request</em>&nbsp;</td><td>is a request of the form "[family-&lt;family_name&gt;] [cellZone-&lt;cellzone_name&gt;]" </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Index</em>&nbsp;</td><td>is a an index number in energy system </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Value</em>&nbsp;</td><td>is a an energy value for energy system</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setDynEnergy(<span class="stringliteral">"family-tribu*"</span>, Index, Energy); <span class="comment">// Sets the dyn energy of all groups defined by family-tribu* to Energy in slot Index</span>
</pre></div><h3><a class="anchor" name="clamp_fff_f">
clamp_fff_f</a></h3>
Clamps a value between lim1 and lim2. Low bound is the min value of (lim1,lim2), up bound the max value. If input value is out of [low_bound;up_bound], this function returns the nearest limit of value.<p>
Arguments: f(value),f(lim1),f(lim2) -&gt; f(clamped_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is the value to clamp </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>lim1</em>&nbsp;</td><td>is a clamp limit </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>lim2</em>&nbsp;</td><td>is a clamp limit </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>clamped_value</em>&nbsp;</td><td>is the clamped value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(percentage)clamp(ratio, 0, 1);
</pre></div><h3><a class="anchor" name="min_ff_f">
min_ff_f</a></h3>
Returns the lowest of two values.<p>
Arguments: f(value1),f(value2) -&gt; f(min_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value1</em>&nbsp;</td><td>is a value to compare </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value2</em>&nbsp;</td><td>is a value to compare </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>min_value</em>&nbsp;</td><td>is the min value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(shortest)min(left, right);
</pre></div><h3><a class="anchor" name="max_ff_f">
max_ff_f</a></h3>
Returns the highest of two values.<p>
Arguments: f(value1),f(value2) -&gt; f(max_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value1</em>&nbsp;</td><td>is a value to compare </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value2</em>&nbsp;</td><td>is a value to compare </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>max_value</em>&nbsp;</td><td>is the max value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(longest)max(left, right);
</pre></div><h3><a class="anchor" name="rndm_ff_f">
rndm_ff_f</a></h3>
Returns a random value in interval [min;max[. max must be higher than min.<p>
Arguments: f(min),f(max) -&gt; f(random_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>min</em>&nbsp;</td><td>is a lower bound of the possible returned values </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>max</em>&nbsp;</td><td>is a upper bound of the possible returned values </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>random_value</em>&nbsp;</td><td>is a random value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(val)rndm(0, 1);
</pre></div><h3><a class="anchor" name="floor_f_f">
floor_f_f</a></h3>
Returns the highest integer lower than or equal to input value.<p>
Arguments: f(value) -&gt; f(floored_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>floored_value</em>&nbsp;</td><td>is an integer</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(count)floor(value);
</pre></div><h3><a class="anchor" name="ceil_f_f">
ceil_f_f</a></h3>
Returns the lowest integer higher than or equal to input value.<p>
Arguments: f(value) -&gt; f(ceiled_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ceiled_value</em>&nbsp;</td><td>is an integer</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(count)ceil(value);
</pre></div><h3><a class="anchor" name="round_f_f">
round_f_f</a></h3>
Returns the integer closest to input value.<p>
Arguments: f(value) -&gt; f(rounded_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ceiled_value</em>&nbsp;</td><td>is an integer</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(count)round(value);
</pre></div><h3><a class="anchor" name="abs_f_f">
abs_f_f</a></h3>
Returns the absolute value of the input value.<p>
Arguments: f(value) -&gt; f(rounded_value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>absolute_value</em>&nbsp;</td><td>is a positive value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(dist)abs(diff);
</pre></div><h3><a class="anchor" name="sin_f_f">
sin_f_f</a></h3>
Returns the sinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is sin(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)sin(x);
</pre></div><h3><a class="anchor" name="asin_f_f">
asin_f_f</a></h3>
Returns the arcsinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is asin(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)asin(x);
</pre></div><h3><a class="anchor" name="sinh_f_f">
sinh_f_f</a></h3>
Returns the hyperbolic sinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is sinh(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)sinh(x);
</pre></div><h3><a class="anchor" name="cos_f_f">
cos_f_f</a></h3>
Returns the cosinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is cos(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)cos(x);
</pre></div><h3><a class="anchor" name="acos_f_f">
acos_f_f</a></h3>
Returns the arccosinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is acos(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)acos(x);
</pre></div><h3><a class="anchor" name="cosh_f_f">
cosh_f_f</a></h3>
Returns the hyperbolic cosinus of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is cosh(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)cosh(x);
</pre></div><h3><a class="anchor" name="tan_f_f">
tan_f_f</a></h3>
Returns the tangent of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is tan(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)tan(x);
</pre></div><h3><a class="anchor" name="atan_f_f">
atan_f_f</a></h3>
Returns the arctangent of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is atan(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)atan(x);
</pre></div><h3><a class="anchor" name="tanh_f_f">
tanh_f_f</a></h3>
Returns the hyperbolic tangent of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is tanh(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)tanh(x);
</pre></div><h3><a class="anchor" name="sqrt_f_f">
sqrt_f_f</a></h3>
Returns the square root of the input value.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is sqrt(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)sqrt(x);
</pre></div><h3><a class="anchor" name="exp_f_f">
exp_f_f</a></h3>
Returns the exponent of the input value (ie e^x).<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>is a real value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>is exp(x)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(y)exp(x);
</pre></div><h3><a class="anchor" name="pow_ff_f">
pow_ff_f</a></h3>
Returns the base^exponent.<p>
Arguments: f(x) -&gt; f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pow</em>&nbsp;</td><td>is the base </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>exponent</em>&nbsp;</td><td>is the exponent </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ret</em>&nbsp;</td><td>is base^exponent</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(max)exp(2, nbits);
</pre></div><h3><a class="anchor" name="strlen_s_f">
strlen_s_f</a></h3>
Returns the length of a string.<p>
Arguments: s(string) -&gt; f(length) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>is a string </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>is the length of the input string</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(length)strlen($str);
</pre></div><h3><a class="anchor" name="substr_sff_s">
substr_sff_s</a></h3>
Returns a substring of the input string.<p>
Arguments: s(string),f(start),f(length) -&gt; s(substring) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>is a string </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>start</em>&nbsp;</td><td>is the first character to copy </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>is the length of the returned string </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>substring</em>&nbsp;</td><td>is the substring of string starting at character <em>start</em> and <em>length</em> characters long</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(length)substr($str);
</pre></div><h3><a class="anchor" name="strtof_s_f">
strtof_s_f</a></h3>
Converts a string to a float.<p>
Arguments: s(string) -&gt; f(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>is a string </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is the converted value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(val)strtof($str);
</pre></div><h3><a class="anchor" name="strtof_s_ff">
strtof_s_ff</a></h3>
Converts a string to a float.<p>
Arguments: s(string) -&gt; f(value),f(isfloat) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>is a string </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is the converted value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>isfloat</em>&nbsp;</td><td>is 1 if the input string contained a value, otherwise 0</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(val, isfloat)strtof($str);
</pre></div><h3><a class="anchor" name="strtof_s_fff">
strtof_s_fff</a></h3>
Converts a string to a float.<p>
Arguments: s(string) -&gt; f(value),f(isfloat),f(isfull) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>is a string </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is the converted value </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>isfloat</em>&nbsp;</td><td>is 1 if the input string contained a value, otherwise 0 </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>isfull</em>&nbsp;</td><td>is 1 if the input string only contained the converted value, otherwise 0</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(val, isfloat, isfull)strtof($str);
</pre></div><h3><a class="anchor" name="createNamedEntity_s_">
createNamedEntity_s_</a></h3>
Creates a named entity in current AIS. A named entity is an entity containing only 4 fields (name, state, param1, param2) and that can appear on web admin.<p>
Arguments: s(name) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to create</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()createNamedEntity(<span class="stringliteral">"Invasion"</span>);
</pre></div><h3><a class="anchor" name="setNamedEntityProp_sss_">
setNamedEntityProp_sss_</a></h3>
Sets a property of an existing named entity. Valid property names are:<ul>
<li>state</li><li>param1</li><li>param2 Name of the entity cannot be changed. This function does not trigger listeners associated with the entity property.</li></ul>
<p>
Arguments: s(name),s(prop),s(content) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>content</em>&nbsp;</td><td>is a the value to set</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setNamedEntityProp(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, <span class="stringliteral">"Active"</span>);
</pre></div><h3><a class="anchor" name="setNamedEntityPropCb_sss_">
setNamedEntityPropCb_sss_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#setNamedEntityProp_sss_">setNamedEntityProp_sss_</a></dd></dl>
This function does trigger listeners associated with the entity property.<p>
Arguments: s(name),s(prop),s(content) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>content</em>&nbsp;</td><td>is a the value to set</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setNamedEntityPropCb(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, <span class="stringliteral">"Active"</span>);
</pre></div><h3><a class="anchor" name="getNamedEntityProp_ss_s">
getNamedEntityProp_ss_s</a></h3>
Returns the content of a named entity property. Valid property names are:<ul>
<li>state</li><li>param1</li><li>param2 Name of the entity cannot be retrieved, because it must be known to access the entity.</li></ul>
<p>
Arguments: s(name),s(prop) -&gt; s(content) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to modify </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>content</em>&nbsp;</td><td>is a the content of the specified field</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($state)getNamedEntityProp(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>);
</pre></div><h3><a class="anchor" name="destroyNamedEntity_s_">
destroyNamedEntity_s_</a></h3>
Destroys a named entity.<p>
Arguments: s(name) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to destroy</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()destroyNamedEntity(<span class="stringliteral">"Invasion"</span>);
</pre></div><h3><a class="anchor" name="setSimplePhrase_ss_">
setSimplePhrase_ss_</a></h3>
Creates a phrase ID of the form <em>phraseName(){[phraseContent]}</em>.<p>
Arguments: s(phraseName),s(phraseContent) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>phraseName</em>&nbsp;</td><td>is a the id of the phrase to define </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>phraseContent</em>&nbsp;</td><td>is the text associated with the phrase</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setSimplePhrase(<span class="stringliteral">"HELLO"</span>, <span class="stringliteral">"Salut, ca va ?"</span>); <span class="comment">// <20>quivalent <20> "HELLO(){[Salut, ca va ?]}"</span>
</pre></div><h3><a class="anchor" name="dataGetVar_s_s">
dataGetVar_s_s</a></h3>
Returns the content of a script data variable. Data variable name is composed of a file name and a variable name separated with ':', like in "file:variable".<p>
Arguments: s(name) -&gt; s(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the data variable </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the content of the data variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($state)dataGetVar(<span class="stringliteral">"Fyros:Patrol1State"</span>);
</pre></div><h3><a class="anchor" name="dataGetVar_s_f">
dataGetVar_s_f</a></h3>
Returns the content of a script data variable. Data variable name is composed of a file name and a variable name separated with ':', like in "file:variable".<p>
Arguments: s(name) -&gt; f(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the data variable </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the content of the data variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(nbPatrol)dataGetVar(<span class="stringliteral">"Fyros:PatrolCount"</span>);
</pre></div><h3><a class="anchor" name="dataSetVar_ss_">
dataSetVar_ss_</a></h3>
Changes the content of a script data variable. Data variable name is composed of a file name and a variable name separated with ':', like in "file:variable".<p>
Arguments: s(name),s(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the data variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the content of the data variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()dataSetVar(<span class="stringliteral">"Fyros:Patrol1State"</span>, <span class="stringliteral">"Active"</span>);
</pre></div><h3><a class="anchor" name="dataSetVar_sf_">
dataSetVar_sf_</a></h3>
Changes the content of a script data variable. Data variable name is composed of a file name and a variable name separated with ':', like in "file:variable".<p>
Arguments: s(name),s(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the data variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the content of the data variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()dataSetVar(<span class="stringliteral">"Fyros:PatrolCount"</span>, nbPatrol);
</pre></div><h3><a class="anchor" name="dataSave__">
dataSave__</a></h3>
Save all previously written script data variables to file. This must be done explicitly, otherwise modified variables are not saved. This is primarily necessary to save CPU, because writing operations can take time. This also permit to ensure data integrity if a crash occurs between the writing of two related variables.<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()dataSave();
</pre></div><h3><a class="anchor" name="setZoneState_sf_">
setZoneState_sf_</a></h3>
Arguments: -&gt;<p>
arg0: is the zone name id<p>
arg1: if zone is not pvp arg1 is interpreted as a boolean (0 - inactive, 1 - active) if zone is a pvp zone arg1 is interpreted as 0 - inactive 1 - active with faction point rewards 2 - active without faction point rewards<p>
<div class="fragment"><pre class="fragment">()setZoneState(<span class="stringliteral">"toto"</span>, 1.0);
</pre></div><h3><a class="anchor" name="setEvent_f_">
setEvent_f_</a></h3>
Triggers a user event.<p>
Arguments: f(EventId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>EventId</em>&nbsp;</td><td>is the user event id to be triggered</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setEvent(0); <span class="comment">// Triggers the event 0</span>
</pre></div><h3><a class="anchor" name="setTimer_ff_">
setTimer_ff_</a></h3>
Sets a timer delay and start it.<p>
Arguments: f(DeltaTime), f(TimerId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>DeltaTime</em>&nbsp;</td><td>is the time (in ticks) before the timer event is triggered </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setTimer(200, 0); <span class="comment">// Sets the timer t0 to 200 ticks</span>
</pre></div><h3><a class="anchor" name="timerSetRyzomDaytime_fff_">
timerSetRyzomDaytime_fff_</a></h3>
Set a timer at a specified hour in Ryzom time and start it.<p>
Arguments: f(TimerId), f(Hour), f(Minute) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Hour</em>&nbsp;</td><td>is the hour we want the timer to trigger </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Minute</em>&nbsp;</td><td>is the minute we want the timer to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()timerSetRyzomDaytime(0, 13, 45); <span class="comment">// create a timer at 13h45 (Ryzom time)</span>
</pre></div><h3><a class="anchor" name="timerIsEnabled_f_f">
timerIsEnabled_f_f</a></h3>
Test if a timer is enabled.<p>
Arguments: f(TimerId) -&gt; f(IsEnabled) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>IsEnabled</em>&nbsp;</td><td>1 if the timer is enabled</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(isEnabled)timerIsEnabled(0); <span class="comment">// test if the timer t0 is enabled and put the ret in isEnabled variable</span>
</pre></div><h3><a class="anchor" name="timerIsSuspended_f_f">
timerIsSuspended_f_f</a></h3>
Test if a timer is suspended.<p>
Arguments: f(TimerId) -&gt; f(IsSuspended) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>IsSuspended</em>&nbsp;</td><td>1 if the timer is suspended</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(isSuspended)timerIsSuspended(0); <span class="comment">// test if the timer t0 is suspended and put the ret in isSuspended variable</span>
</pre></div><h3><a class="anchor" name="timerSuspend_f_">
timerSuspend_f_</a></h3>
Suspend a timer.<p>
Arguments: f(TimerId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()timerSuspend(0); <span class="comment">// suspend the timer t0</span>
</pre></div><h3><a class="anchor" name="timerDisable_f_">
timerDisable_f_</a></h3>
Disable a timer.<p>
Arguments: f(TimerId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()timerDisable(0); <span class="comment">// disable the timer t0</span>
</pre></div><h3><a class="anchor" name="timerResume_f_">
timerResume_f_</a></h3>
Resume a timer.<p>
Arguments: f(TimerId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()timerResume(0); <span class="comment">// resume the timer t0</span>
</pre></div><h3><a class="anchor" name="timerAdd_ff_">
timerAdd_ff_</a></h3>
Add a delta time to a timer.<p>
Arguments: f(TimerId), f(DeltaTime) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>TimerId</em>&nbsp;</td><td>is the timer ID </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>DeltaTime</em>&nbsp;</td><td>is the delta time in ticks</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()timerAdd(0, 41); <span class="comment">// add 41 ticks to the next trigger</span>
()timerAdd(0, -10); <span class="comment">// remove 10 ticks to the next trigger</span>
</pre></div><h3><a class="anchor" name="dssStartAct_ff_">
dssStartAct_ff_</a></h3>
Request the start of a dss Act.<p>
Arguments: f(SessionId), f(ActId)-&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>SessionId</em>&nbsp;</td><td>is the id session </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ActId</em>&nbsp;</td><td>is the id of the act (0 = permanent content)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()dssStartAct(42,2); <span class="comment">// Start the 2ond act of the session 42</span>
</pre></div><h3><a class="anchor" name="postNextState_s_">
postNextState_s_</a></h3>
Triggers a state change.<p>
Arguments: s(StateName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateName</em>&nbsp;</td><td>is the name of the next state</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()postNextState(<span class="stringliteral">"state_invasion_2"</span>); <span class="comment">// Post the next state named 'state_invasion_2' if found in this state machine</span>
()postNextState($name_var); <span class="comment">// Post the next state named by name_var if found in this state machine</span>
</pre></div><h3><a class="anchor" name="import_s_">
import_s_</a></h3>
Imports (executes in current context as a script function) a script defined in a script rep.<p>
Arguments: s(libName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>libName</em>&nbsp;</td><td>is the library name</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()<span class="keyword">import</span>(<span class="stringliteral">"script_boss"</span>);
</pre></div><h3><a class="anchor" name="setNelVar_sf_">
setNelVar_sf_</a></h3>
Sets the content of a NeL Variable. The variable is created if it doesn't exist.<p>
Arguments: s(varId),f(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to set </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value to set</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setNelVar(<span class="stringliteral">"BotCount"</span>, 32);
</pre></div><h3><a class="anchor" name="getNelVar_s_f">
getNelVar_s_f</a></h3>
Returns the content of a NeL Variable. The variable is created if it doesn't exist.<p>
Arguments: s(varId) -&gt; f(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to set </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value of the variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(botCount)getNelVar(<span class="stringliteral">"BotCount"</span>);
</pre></div><h3><a class="anchor" name="delNelVar_ss_">
delNelVar_ss_</a></h3>
Detetes a NeL Variable. Passed value is used to determine the type of the variable. Content of that value is ignored.<p>
Arguments: s(varId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to delete </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a a value of the same type of the variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delNelVar(<span class="stringliteral">"BotCount"</span>, 0);
</pre></div><h3><a class="anchor" name="setNelVar_ss_">
setNelVar_ss_</a></h3>
Sets the content of a NeL Variable. The variable is created if it doesn't exist.<p>
Arguments: s(varId),s(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to set </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value to set</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setNelVar(<span class="stringliteral">"BotFamily"</span>, <span class="stringliteral">"the_killers"</span>);
</pre></div><h3><a class="anchor" name="getNelVar_s_s">
getNelVar_s_s</a></h3>
Returns the content of a NeL Variable. The variable is created if it doesn't exist.<p>
Arguments: s(varId) -&gt; s(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to set </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value of the variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(botFamily)getNelVar(<span class="stringliteral">"BotFamily"</span>);
</pre></div><h3><a class="anchor" name="delNelVar_ss_">
delNelVar_ss_</a></h3>
Detetes a NeL Variable. Passed value is used to determine the type of the variable. Content of that value is ignored.<p>
Arguments: s(varId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>varId</em>&nbsp;</td><td>is a the name of the variable to delete </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a a value of the same type of the variable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delNelVar(<span class="stringliteral">"BotFamily"</span>, <span class="stringliteral">""</span>);
</pre></div><h3><a class="anchor" name="getStateName__s">
getStateName__s</a></h3>
Returns the name of the current state.<p>
Arguments: -&gt; s(StateName) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>StateName</em>&nbsp;</td><td>is the name of the current state</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($name)getStateName();
</pre></div><h3><a class="anchor" name="spawn__">
spawn__</a></h3>
Spawns the current group.<p>
Arguments: -&gt;<h3><a class="anchor" name="despawn_f_">
despawn_f_</a></h3>
Depawns the current group.<p>
Arguments: f(Immediatly) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>Immediatly</em>&nbsp;</td><td>is whether the groups spawns immediatly (1) or not (0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()despawn(0); <span class="comment">// despawn</span>
()despawn(1); <span class="comment">// despawn immediatement</span>
</pre></div><h3><a class="anchor" name="isAlived__f">
isAlived__f</a></h3>
Test if the group is alived<p>
Arguments: -&gt; f(Immediatly) <dl class="return" compact><dt><b>Returns:</b></dt><dd>1 if group is spawned</dd></dl>
<div class="fragment"><pre class="fragment">(alive)isAlived();
</pre></div><h3><a class="anchor" name="newNpcChildGroupPos_ssfff_c">
newNpcChildGroupPos_ssfff_c</a></h3>
Used to create a dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(Dispersion) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupPos(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 30);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPos_ssfff_">
newNpcChildGroupPos_ssfff_</a></h3>
Used to create a dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(Dispersion) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupPos(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 30);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPos_ssff_c">
newNpcChildGroupPos_ssff_c</a></h3>
Used to create a dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupPos(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPos_ssff_">
newNpcChildGroupPos_ssff_</a></h3>
Used to create a dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupPos(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPosMl_ssffff_c">
newNpcChildGroupPosMl_ssffff_c</a></h3>
Used to create a multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(BaseLevel), f(Dispersion) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupPosMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 13, 7.5);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPosMl_ssffff_">
newNpcChildGroupPosMl_ssffff_</a></h3>
Used to create a multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(BaseLevel), f(Dispersion) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupPosMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 13, 7.5);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPosMl_ssfff_c">
newNpcChildGroupPosMl_ssfff_c</a></h3>
Used to create a multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(BaseLevel) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupPosMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 13);
</pre></div><h3><a class="anchor" name="newNpcChildGroupPosMl_ssfff_">
newNpcChildGroupPosMl_ssfff_</a></h3>
Used to create a multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), f(x), f(y), f(BaseLevel) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the spawned group on x axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the spawned group on y axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupPosMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, x, y, 13);
</pre></div><h3><a class="anchor" name="getMidPos__ff">
getMidPos__ff</a></h3>
Returns the position (x, y) of the current group.<p>
Arguments: -&gt; f(x), f(y) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>position of the group on x axis </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>position of the group on y axis</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(x, y)getMidPos();
</pre></div><h3><a class="anchor" name="newNpcChildGroup_sssf_c">
newNpcChildGroup_sssf_c</a></h3>
Used to create dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(Dispersion) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroup(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 10);
</pre></div><h3><a class="anchor" name="newNpcChildGroup_sssf_">
newNpcChildGroup_sssf_</a></h3>
Used to create dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(Dispersion) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroup(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 10);
</pre></div><h3><a class="anchor" name="newNpcChildGroup_sss_c">
newNpcChildGroup_sss_c</a></h3>
Used to create dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(Dispersion) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroup(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone);
</pre></div><h3><a class="anchor" name="newNpcChildGroup_sss_">
newNpcChildGroup_sss_</a></h3>
Used to create dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(Dispersion) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroup(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone);
</pre></div><h3><a class="anchor" name="newNpcChildGroupMl_sssff_c">
newNpcChildGroupMl_sssff_c</a></h3>
Used to create multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(BaseLevel), f(Dispersion) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 2, 50);
</pre></div><h3><a class="anchor" name="newNpcChildGroupMl_sssff_">
newNpcChildGroupMl_sssff_</a></h3>
Used to create multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(BaseLevel), f(Dispersion) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Dispersion</em>&nbsp;</td><td>is the dispersion radius in meters when spawning a group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 2, 50);
</pre></div><h3><a class="anchor" name="newNpcChildGroupMl_sssf_c">
newNpcChildGroupMl_sssf_c</a></h3>
Used to create multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(BaseLevel) -&gt; c(Group) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Group</em>&nbsp;</td><td>is the newly created group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@grp)newNpcChildGroupMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 12);
</pre></div><h3><a class="anchor" name="newNpcChildGroupMl_sssf_">
newNpcChildGroupMl_sssf_</a></h3>
Used to create multilevel dynamic npc group (a parent/children relation is defined).<p>
Arguments: s(GroupTemplate), s(StateMachine), s(Zone), f(BaseLevel) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is the name of a template npc group defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>StateMachine</em>&nbsp;</td><td>is the name of a state machine defined in the same AIInstance </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is returned by the getZoneWithFlags methods </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BaseLevel</em>&nbsp;</td><td>is the base level of the spawned group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()newNpcChildGroupMl(<span class="stringliteral">"class_forager"</span>, <span class="stringliteral">"state_machine_1"</span>, $zone, 12);
</pre></div><h3><a class="anchor" name="spawnManager_s_">
spawnManager_s_</a></h3>
Spawns a manager.<p>
Arguments: s(ManagerName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ManagerName</em>&nbsp;</td><td>is the name of the manager to spawn</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()spawnManager(<span class="stringliteral">"NPC Manager"</span>); <span class="comment">// Spawns all the NPCs in the NPC manager called "NPC Manager"</span>
</pre></div><h3><a class="anchor" name="despawnManager_s_">
despawnManager_s_</a></h3>
Despawns a manager.<p>
Arguments: s(ManagerName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ManagerName</em>&nbsp;</td><td>is the name of the manager to despawn</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()despawnManager(<span class="stringliteral">"NPC Manager"</span>); <span class="comment">// Despawns all the NPCs in the NPC manager called "NPC Manager"</span>
</pre></div><h3><a class="anchor" name="getGroupTemplateWithFlags_sss_s">
getGroupTemplateWithFlags_sss_s</a></h3>
Returns the name of a randomly chosen group template corresponding to specified flags.<p>
Arguments: s(OneOf), s(Mandatory), s(ExceptFlags) -&gt; s(GroupTemplate) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptFlags</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is a group template matching at least one of OneOf flags, all Manadatory flags and none of ExceptFlags</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($group)getGroupTemplateWithFlags(<span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>); <span class="comment">// Get a group which matches 'invasion', 'outpost' and either 'food' or 'rest' flags.</span>
</pre></div><h3><a class="anchor" name="getGroupTemplateWithFlags_ss_s">
getGroupTemplateWithFlags_ss_s</a></h3>
Returns the name of a randomly chosen group template corresponding to specified flags.<p>
Arguments: s(OneOf), s(Mandatory) -&gt; s(GroupTemplate) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>GroupTemplate</em>&nbsp;</td><td>is a group template matching at least one of OneOf flags and all Manadatory flags</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($group)getGroupTemplateWithFlags(<span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>); <span class="comment">// Get a group which matches 'invasion', 'outpost' and either 'food' or 'rest' flags.</span>
</pre></div><h3><a class="anchor" name="getZoneWithFlags_ssss_s">
getZoneWithFlags_ssss_s</a></h3>
The first parameter is a list of 'one match enough' zone flags. The zones must have at least one of these flags to be selected. The second parameter is a list of 'all required' zone flag. The zones must have all these flags to be selected. The fourth parameter is a list of 'all forbidden' zone flag. The zones must not have any of these flags to be selected. Additionnaly the returned zone cannot be ExceptZone. Last argument specifies a list of flags that the selected zone cannot have.<p>
With the list of selectable zone, the system then select a zone based on entity density in each selected zone. The system will select the least populated zone. It then returns the zone name.<p>
Priority is given to current Cell, and after that to all cells.<p>
Arguments: s(OneOf), s(Mandatory), s(ExceptZone), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptZone</em>&nbsp;</td><td>is a zone name </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptProperties</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getZoneWithFlags(<span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>, $oldzone); <span class="comment">// Get a zone which matches invasion, outpost and either food or rest flags with the best score except $oldzone.</span>
($zone)getZoneWithFlags(<span class="stringliteral">"boss"</span>, <span class="stringliteral">""</span>, $oldzone); <span class="comment">// Get a zone which matches boss flag with the best score except the $oldzone</span>
</pre></div><h3><a class="anchor" name="getZoneWithFlags_sss_s">
getZoneWithFlags_sss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_ssss_s">getZoneWithFlags_ssss_s</a></dd></dl>
Arguments: s(OneOf), s(Mandatory), s(ExceptZone) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptZone</em>&nbsp;</td><td>is a zone name </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getZoneWithFlags(<span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>, $oldzone); <span class="comment">// Get a zone which matches invasion, outpost and either food or rest flags with the best score except $oldzone.</span>
($zone)getZoneWithFlags(<span class="stringliteral">"boss"</span>, <span class="stringliteral">""</span>, $oldzone); <span class="comment">// Get a zone which matches boss flag with the best score except the $oldzone</span>
</pre></div><h3><a class="anchor" name="getNearestZoneWithFlags_ffsss_s">
getNearestZoneWithFlags_ffsss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_ssss_s">getZoneWithFlags_ssss_s</a></dd></dl>
The zone returned by this function is the nearest from the specified point and taking into account the zone free space.<p>
Arguments: f(X), f(Y), s(OneOf), s(Mandatory), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>X</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Y</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptProperties</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getNearestZoneWithFlags(x, y, <span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>, <span class="stringliteral">"stayaway"</span>);
</pre></div><h3><a class="anchor" name="getNearestZoneWithFlags_ffss_s">
getNearestZoneWithFlags_ffss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_sss_s">getZoneWithFlags_sss_s</a></dd></dl>
The zone returned by this function is the nearest from the specified point and taking into account the zone free space.<p>
Arguments: f(X), f(Y), s(OneOf), s(Mandatory), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>X</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Y</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getNearestZoneWithFlags(x, y, <span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>);
</pre></div><h3><a class="anchor" name="getNearestZoneWithFlagsStrict_ffsss_s">
getNearestZoneWithFlagsStrict_ffsss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_ssss_s">getZoneWithFlags_ssss_s</a></dd></dl>
The zone returned by this function is the nearest from the specified point without taking into account the zone free space.<p>
Arguments: f(X), f(Y), s(OneOf), s(Mandatory), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>X</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Y</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptProperties</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getNearestZoneWithFlagsStrict(x, y, <span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>, <span class="stringliteral">"stayaway"</span>);
</pre></div><h3><a class="anchor" name="getNearestZoneWithFlagsStrict_ffss_s">
getNearestZoneWithFlagsStrict_ffss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_sss_s">getZoneWithFlags_sss_s</a></dd></dl>
The zone returned by this function is the nearest from the specified point without taking into account the zone free space.<p>
Arguments: f(X), f(Y), s(OneOf), s(Mandatory), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>X</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Y</em>&nbsp;</td><td>is the position of the zone we are looking for on the X axis </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching at least one of OneOf flags, all Manadatory flags and can't be ExceptZone</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone)getNearestZoneWithFlagsStrict(x, y, <span class="stringliteral">"food|rest"</span>, <span class="stringliteral">"invasion|outpost"</span>);
</pre></div><h3><a class="anchor" name="getNeighbourZoneWithFlags_ssss_s">
getNeighbourZoneWithFlags_ssss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_ssss_s">getZoneWithFlags_ssss_s</a></dd></dl>
Here priority is given to current Cell, after that to neighbour Cells, and finally to all cells. CurrentZone cannot be returned.<p>
Arguments: s(CurrentZone), s(OneOf), s(Mandatory), s(ExceptProperties) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>CurrentZone</em>&nbsp;</td><td>is a zone name </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ExceptProperties</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching the specified flags</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone1)getNeighbourZoneWithFlags($zone, <span class="stringliteral">"boss"</span>, <span class="stringliteral">""</span>, $exceptflag); <span class="comment">// Get the zone in the neighbour cells of the one containing $zone which matches specified flags</span>
</pre></div><h3><a class="anchor" name="getNeighbourZoneWithFlags_sss_s">
getNeighbourZoneWithFlags_sss_s</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#getZoneWithFlags_sss_s">getZoneWithFlags_sss_s</a></dd></dl>
Here priority is given to current Cell, after that to neighbour Cells, and finally to all cells. CurrentZone cannot be returned.<p>
Arguments: s(CurrentZone), s(OneOf), s(Mandatory) -&gt; s(Zone) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>CurrentZone</em>&nbsp;</td><td>is a zone name </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>OneOf</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mandatory</em>&nbsp;</td><td>is a '|' separated list of flags </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone matching the specified flags</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($zone1)getNeighbourZoneWithFlags($zone, <span class="stringliteral">"boss"</span>, <span class="stringliteral">""</span>); <span class="comment">// Get the zone in the neighbour cells of the one containing $zone which matches specified flags</span>
</pre></div><h3><a class="anchor" name="setAggro_ff_">
setAggro_ff_</a></h3>
Sets aggro parameters of current group.<p>
Arguments: f(Range), f(NbTicks) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Range</em>&nbsp;</td><td>is a aggro range in meters </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>NbTicks</em>&nbsp;</td><td>is a aggro update period in ticks</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setAggro(Range, NbTicks); <span class="comment">// Sets the aggro range of the group to Range, updated every NbTicks ticks</span>
</pre></div><h3><a class="anchor" name="setCanAggro_f_">
setCanAggro_f_</a></h3>
Let a bot aggro or prevent it from aggroing.<p>
Arguments: f(CanAggro) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>CanAggro</em>&nbsp;</td><td>tells whether the bot can aggro (!=0) or not (==0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setCanAggro(0);
</pre></div><h3><a class="anchor" name="clearAggroList_f_">
clearAggroList_f_</a></h3>
Reset the aggrolist of a bot.<p>
Arguments: f(bool don't send lost aggro message to EGS) -&gt;<p>
<div class="fragment"><pre class="fragment">()clearAggroList(0/1);
</pre></div><h3><a class="anchor" name="clearAggroList__">
clearAggroList__</a></h3>
Reset the aggrolist of a bot.<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()clearAggroList();
</pre></div><h3><a class="anchor" name="setMode_s_">
setMode_s_</a></h3>
Sets the mode of every bot of the group. Valid modes are:<ul>
<li>Normal</li><li>Sit</li><li>Eat</li><li>Rest</li><li>Alert</li><li>Hungry</li><li>Death</li></ul>
<p>
Arguments: s(Mode) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Mode</em>&nbsp;</td><td>is the mode name to set</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setMode(<span class="stringliteral">"Alert"</span>);
</pre></div><h3><a class="anchor" name="setAutoSpawn_f_">
setAutoSpawn_f_</a></h3>
Determine if the current group should respawn automatically after despawn.<p>
Arguments: f(AutoSpawn) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>AutoSpawn</em>&nbsp;</td><td>is whether the group automatically rewpawns (1) or not (0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setAutoSpawn(1);
</pre></div><h3><a class="anchor" name="setHPLevel_f_">
setHPLevel_f_</a></h3>
Sets the current HP level of each bot of the group.<p>
Arguments: f(Coef) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is the percentage of its max HP each creature will have</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setHPLevel(0.8);
</pre></div><h3><a class="anchor" name="setHPScale_f__f_">
setHPScale_f__f_</a></h3>
Sets the current HP level of level of each bot of the group. its maxHitPoints eg: for a bot HP = 850 and MaxHP = 1000 ()setHPScale_f_(0); HP will be 0 so DeltaHp = 850 ()setHPScale_f_(1); HP will be 100 so DeltaHp = 150 ()setHPScale_f_(0.5); HP will be 500 so DeltaHp = 350 if bot HP = 840 and Max abd setHpRatio(0) HP will be 0<p>
Arguments: f(Coef) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is the percentage of its max HP each creature will *BE*</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setHPLevel(0.8);
</pre></div><h3><a class="anchor" name="scaleHP_f_">
scaleHP_f_</a></h3>
Scales the bots HP.<p>
Arguments: f(Coef) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is the percentage of its current HP each creature will have</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()scaleHP(2);
</pre></div><h3><a class="anchor" name="setBotHPScaleByAlias_fs_">
setBotHPScaleByAlias_fs_</a></h3>
Same as setHpSacale but only on a specific bot of a groupe from the current group by its bot alias<p>
Arguments: f(alias),f(Coef), -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>alias</em>&nbsp;</td><td>is the alias of the bot </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is the percentage of its current HP each creature will have</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()scaleHpByAlias(2, '(A:1000:10560)');
</pre></div><h3><a class="anchor" name="downScaleHP_f_">
downScaleHP_f_</a></h3>
Scales the bots HP down.<p>
Arguments: f(Coef) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is a value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()downScaleHP(2);
</pre></div><h3><a class="anchor" name="upScaleHP_f_">
upScaleHP_f_</a></h3>
Scales the bots HP up.<p>
Arguments: f(Coef) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Coef</em>&nbsp;</td><td>is a value</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()upScaleHP(2);
</pre></div><h3><a class="anchor" name="addHP_f_">
addHP_f_</a></h3>
Add HP to the bots.<p>
Arguments: f(HP) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>HP</em>&nbsp;</td><td>is the amount of hit points to add to each bot</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addHP(500);
</pre></div><h3><a class="anchor" name="aiAction_s_">
aiAction_s_</a></h3>
Triggers an AI action, defined by its sheet name, on the current target.<p>
Arguments: s(actionSheetId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>actionSheetId</em>&nbsp;</td><td>is a the sheet name of the action</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()aiAction(<span class="stringliteral">"kick_his_ass.aiaction"</span>);
</pre></div><h3><a class="anchor" name="aiActionSelf_s_">
aiActionSelf_s_</a></h3>
Triggers an AI action, defined by its sheet name, on the bot itself.<p>
Arguments: s(actionSheetId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>actionSheetId</em>&nbsp;</td><td>is a the sheet name of the action</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()aiActionSelf(<span class="stringliteral">"defensive_aura.aiaction"</span>);
</pre></div><h3><a class="anchor" name="addProfileParameter_s_">
addProfileParameter_s_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addProfileParameter(<span class="stringliteral">"running"</span>); <span class="comment">// <20>quivalent <20> un parameter "running" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="addProfileParameter_ss_">
addProfileParameter_ss_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName),s(parameterContent) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterContent</em>&nbsp;</td><td>is the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addProfileParameter(<span class="stringliteral">"foo"</span>, <span class="stringliteral">"bar"</span>); <span class="comment">// <20>quivalent <20> un parameter "foo:bar" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="addProfileParameter_sf_">
addProfileParameter_sf_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName),f(parameterContent) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterContent</em>&nbsp;</td><td>is the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addProfileParameter(<span class="stringliteral">"foo"</span>, 0.5); <span class="comment">// <20>quivalent <20> un parameter "foo:0.5" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="removeProfileParameter_s_">
removeProfileParameter_s_</a></h3>
removes a profile parameter from the current group.<p>
Arguments: s(parameterName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to remove</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()removeProfileParameter(<span class="stringliteral">"running"</span>); <span class="comment">// retire le param<61>tre "running" ou "running:&lt;*&gt;" du groupe</span>
</pre></div><h3><a class="anchor" name="addPersistentProfileParameter_s_">
addPersistentProfileParameter_s_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addProfileParameter(<span class="stringliteral">"running"</span>); <span class="comment">// <20>quivalent <20> un parameter "running" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="addPersistentProfileParameter_ss_">
addPersistentProfileParameter_ss_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName),s(parameterContent) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterContent</em>&nbsp;</td><td>is the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addPersistentProfileParameter(<span class="stringliteral">"foo"</span>, <span class="stringliteral">"bar"</span>); <span class="comment">// <20>quivalent <20> un parameter "foo:bar" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="addPersistentProfileParameter_sf_">
addPersistentProfileParameter_sf_</a></h3>
Adds a profile parameter to the current group.<p>
Arguments: s(parameterName),f(parameterContent) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to add </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterContent</em>&nbsp;</td><td>is the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addPersistentProfileParameter(<span class="stringliteral">"foo"</span>, 0.5); <span class="comment">// <20>quivalent <20> un parameter "foo:0.5" dans la primitive du groupe</span>
</pre></div><h3><a class="anchor" name="removePersistentProfileParameter_s_">
removePersistentProfileParameter_s_</a></h3>
removes a profile parameter from the current group.<p>
Arguments: s(parameterName) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>parameterName</em>&nbsp;</td><td>is a the id of the parameter to remove</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()removeProfileParameter(<span class="stringliteral">"running"</span>); <span class="comment">// retire le param<61>tre "running" ou "running:&lt;*&gt;" du groupe</span>
</pre></div><h3><a class="anchor" name="getOutpostState__s">
getOutpostState__s</a></h3>
Returns the name of the current outpost state (group must be in an outpost).<p>
Arguments: -&gt; s(StateName) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>StateName</em>&nbsp;</td><td>is the name of the current outpost state</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($name)getOutpostState();
</pre></div><h3><a class="anchor" name="isOutpostTribeOwner__f">
isOutpostTribeOwner__f</a></h3>
Returns whether the current outpost owner is a tribe (group must be in an outpost).<p>
Arguments: -&gt; f(TribeOwner) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>TribeOwner</em>&nbsp;</td><td>is whether the current outpost owner is a tribe (1) or not (0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(tribeOwner)isOutpostTribeOwner();
</pre></div><h3><a class="anchor" name="isOutpostGuildOwner__f">
isOutpostGuildOwner__f</a></h3>
Returns whether the current outpost owner is a guild (group must be in an outpost).<p>
Arguments: -&gt; f(TribeOwner) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>TribeOwner</em>&nbsp;</td><td>is whether the current outpost owner is a guild (1) or not (0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(guildOwner)isOutpostGuildOwner();
</pre></div><h3><a class="anchor" name="getEventParam_f_f">
getEventParam_f_f</a></h3>
Returns the content of a param<p>
Arguments: f(paramIndex) -&gt; f(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>paramIndex</em>&nbsp;</td><td>is the parameter index passed by EGS ai_event message </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(val)getEventParam(2);
</pre></div><h3><a class="anchor" name="getEventParam_f_s">
getEventParam_f_s</a></h3>
Returns the content of a param<p>
Arguments: f(paramIndex) -&gt; s(value) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>paramIndex</em>&nbsp;</td><td>is the parameter index passed by EGS ai_event message </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($val)getEventParam(2);
</pre></div><h3><a class="anchor" name="getPlayerStat_ss_f">
getPlayerStat_ss_f</a></h3>
Get some player stat.<p>
A player EntityId is used to identify the player. This EntityId is passed as string as argument. The EntityId can be obtains via getCurrentPlayerAggroListTarget or getRandomPlayerAggroListTarget. The player must be in the same AI Instance (same continent). If the player is not in the same Ai Instance or the input string is empty the function return zero and *display* a warning message on the log. You can think of using isPlayerAlived to be sure that the id is still a valid value. If param is not one of "HP", "MaxHp", "RatioHp" zero is return and a warning message is printed on the log.<ul>
<li>The "Hp" stat is the property CURRENT_HIT_POINTS as seen in the mirror.</li><li>The "MaxHp" stat is the property MAX_HIT_POINTS as seen in the mirror.</li><li>The "RatioHp" stat is (Hp * 100) / MaxHp Be careful the argument is case sensitive.</li></ul>
<p>
Arguments: s(playerEidAsString), s(statName) -&gt; s(result) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>statName</em>&nbsp;</td><td>is the name of the property (can be "HP", "MaxHp", "RatioHp") </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerEid)getCurrentPlayerEid();
print($playerEid); <span class="comment">//log (0x00001fbd50:00:00:81)</span>
(maxHp)getPlayerStat($playerEid, <span class="stringliteral">"MaxHp"</span>);
</pre></div><h3><a class="anchor" name="getPlayerDistance_fs_f">
getPlayerDistance_fs_f</a></h3>
Get the distance between a player and a bot in meters.<p>
A player EntityId is used to identify the player. This EntityId is passed as string as argument. The EntityId can be obtains via getCurrentPlayerAggroListTarget or getRandomPlayerAggroListTarget. The player must be in the same AI Instance (same continent). If the player is not in the same Ai Instance or the input string is empty the function return -1 and display a warning message on the log. You can think of using isPlayerAlived to be sure that the player id is still a valid value.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index the function returns -1 and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
Arguments: s(playerEidAsString), f(botIndex) -&gt; s(result) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>is a the distance between the player on the bot (or -1 if error)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerEid)getCurrentPlayerEid();
(index)getBotIndexByName(<span class="stringliteral">"toto"</span>);
(distance)getPlayerDistance(index, $playerEid);
</pre></div><h3><a class="anchor" name="getCurrentPlayerAggroListTarget_f_s">
getCurrentPlayerAggroListTarget_f_s</a></h3>
Get the player entity id (as string) that has the most aggro in the aggro list of a bot.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A player EntityId is used to identify the player. This EntityId is returned as result. If the aggro list is empty an empty string is returned (but *NO* warning messages)<p>
Arguments: f(botIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getCurrentPlayerAggroListTarget(4);
(distance)getPlayerDistance(4, $playerId);
</pre></div><h3><a class="anchor" name="getRandomPlayerAggroListTarget_f_s">
getRandomPlayerAggroListTarget_f_s</a></h3>
Get a player entity id (as string) from the aggro list of a bot.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A player EntityId is used to identify the player. This EntityId is returned as result. If the aggro list is empty an empty string is returned (but *NO* warning messages)<p>
Arguments: f(botIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(4);
()setAggroListTarget(4, $playerId);
</pre></div><h3><a class="anchor" name="getAggroListElement_ff_s">
getAggroListElement_ff_s</a></h3>
Get a player entity id (as string) from the aggro list of a bot by it aggro list index.<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A aggro list index is used to identified the player in the aggro list. The size of the aggro list is given by getAggroListSize_f_s )<p>
Arguments: f(botIndex), f(aggroListIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>aggroListIndex</em>&nbsp;</td><td>is the index of a aggroable player in the aggro list of the bot identified by botIndex </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player we want infos</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(aggroSize)getAggorListSize(0);
<span class="comment">// to much player are attacking the boss</span>
<span class="keywordflow">if</span> (aggoroSize &gt; 10)
{
($player1)getAggroListElement(0);
($player2)getAggroListElement(1);
($player3)getAggroListElement(2);
<span class="comment">// so the boss teleport 3 person from its aggro list at the end of the world</span>
teleportPlayer($player1, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
clearAggroList();
}
</pre></div><h3><a class="anchor" name="getAggroListSize_f_f">
getAggroListSize_f_f</a></h3>
Get a size of the aggro lsit of a bot (list of aggroable PLAYER)<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function returns an empty string and display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A number is used to indicate the size of the aggro lsit<p>
Arguments: f(aggroListIndex) -&gt; f(sizeOfAggroList) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group. </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sizeOfAggroList</em>&nbsp;</td><td>The size of the aggro list index.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(aggroSize)getAggorListSize(0);
<span class="comment">// to much player are attacking the boss</span>
<span class="keywordflow">if</span> (aggoroSize &gt; 10)
{
($player1)getAggroListElement(0);
($player2)getAggroListElement(1);
($player3)getAggroListElement(2);
<span class="comment">// so the boss teleport 3 person from its aggro list at the end of the world</span>
teleportPlayer($player1, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
clearAggroList();
}
</pre></div><h3><a class="anchor" name="setAggroListTarget_fs_">
setAggroListTarget_fs_</a></h3>
Maximize the Aggro of a target from the Aggro list of one bot (this id can be given by getRandomPlayerAggroListTarget)..<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
A player EntityId is used to identify the player. If the entityId is not from the aggro list then a warning message is shown in the log. If the entityId is a empty string nothing no message are displayed.<p>
Arguments: f(botIndex) &gt;s(playerEidAsString) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId of the player that will be attacked</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(4);
()setAggroListTarget(4, $playerId);
</pre></div><h3><a class="anchor" name="setGroupAggroListTarget_s_">
setGroupAggroListTarget_s_</a></h3>
Maximize the Aggro of a target from the Aggro list of one bot to his group (this id can be given by getRandomPlayerAggroListTarget)..<p>
A player EntityId is used to identify the player. If the entityId is not from the aggro list then a warning message is shown in the log. If the entityId is a empty string nothing no message are displayed.<p>
Arguments: s(playerEidAsString) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId of the player that will be attacked by the group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(4);
()setGroupAggroListTarget($playerId);
</pre></div><h3><a class="anchor" name="setManagerAggroListTarget_ss_">
setManagerAggroListTarget_ss_</a></h3>
Maximize the Aggro of a target of one bot to some groups of his manage.<p>
A player EntityId is used to identify the player. If the entityId is not from the aggro list then a warning message is shown in the log. If the entityId is a empty string nothing no message are displayed.<p>
A string is used to select groups of the manager (groups name must contains this string)<p>
Arguments: f(botIndex), s(playerEidAsString) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerId</em>&nbsp;</td><td>is EntityId of the player </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>nameElement</em>&nbsp;</td><td>The element of the name of all group we are interest in.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(0);
()setManagerAggroListTarget($playerId, <span class="stringliteral">"group_bandit_"</span>); <span class="comment">// all group that have name like "group_bandit_*" will attack the player</span>
</pre></div><h3><a class="anchor" name="getBotIndexByName_s_f">
getBotIndexByName_s_f</a></h3>
Get the index of a bot of a group by its name (or return -1). Mainly usefull for scripted boss.<p>
botIndex begins at zero for the first member of the group, -1 if the bot is not found.<p>
Arguments:, s(botName) &gt; f(botIndex)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is the name of the bot </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of an bot member of the current group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(botIndex)getBotIndexByName(<span class="stringliteral">"boss_random_aggro"</span>);
($playerId)getRandomPlayerAggroListTarget(botIndex);
()setAggroListTarget(botIndex, $playerId);
}
</pre></div><h3><a class="anchor" name="isGroupAlived__f">
isGroupAlived__f</a></h3>
Test if a group is alived (at least one member is alived)<p>
A bot index is used to identify the bot. If there is only one spawned bot in a group then the index value is 0. If we want the bot index of a specific bot the getBotIndexByName function can be used. The function getBotCount can be used to know the number of bot in a group. The function isGroupAlived or isBotAlived can be used to verify if the index is valid. If no bot are identified by the bot index (or bot not spawaned) the function display a warning message. You can this of using isBotAlived to be sure that the bot index is still a valid value.<p>
Arguments: s(playerid) &gt; f(success)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sucess</em>&nbsp;</td><td>is 1.0f if there is at least one member of the group alived (0.0f if not alived bot are found)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($alived)isGroupAlived();
<span class="keywordflow">if</span> ($alived == 1.0f) {
}
</pre></div><h3><a class="anchor" name="isBotAlived_f_f">
isBotAlived_f_f</a></h3>
Test if a bot of the current group is alived. The bot is identified by its index.<p>
Arguments: f(botIndex) &gt; f(success)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>int]</em>&nbsp;</td><td>botIndex the index of the bot. </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sucess</em>&nbsp;</td><td>is 1.0f if there is at least one member of the group alived (0.0f if not alived bot are found)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($botIndex)getBotIndexByName(<span class="stringliteral">"boss_3"</span>);
$alived)isBotAlived($botIndex);
<span class="keywordflow">if</span> (alived == 1.0f) {
}
</pre></div><h3><a class="anchor" name="isPlayerAlived_s_f">
isPlayerAlived_s_f</a></h3>
Test if a a player is is alived.<p>
A player EntityId is used to identify the player. If the player is not connected, not in the same continent, or dead 0 is returned.<p>
Arguments: s(playerId) &gt; f(success)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>palyerId</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>success</em>&nbsp;</td><td>is 1.0f if the entity id of a player is alived.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($botIndex)getBotIndexByName(<span class="stringliteral">"boss_3"</span>);
($playerId)getCurrentPlayerAggroListTarget($botIndex):
(alived)isPlayerlived($playerId);
<span class="keywordflow">if</span> (alived == 1.0f) {
}
</pre></div><h3><a class="anchor" name="getServerTimeStr__s">
getServerTimeStr__s</a></h3>
Gets the server time as string "eg 21:17:14 the x" This function is usefull for stat purpose or debug (to know when a boss is down)<p>
Arguments: &gt; s(serverTime)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>The</em>&nbsp;</td><td>server time as debug string</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($serverTime)getServerTimeAsString();
</pre></div><h3><a class="anchor" name="getServerTime__s">
getServerTime__s</a></h3>
Gets the server time as number (it is the number of seconde since 1970). This value is useful for saving the server date on a file<p>
Arguments: &gt; s(serverTime)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>The</em>&nbsp;</td><td>server time as string (a float is not sharp enough</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($serverTime)getServerTime();
</pre></div><h3><a class="anchor" name="getRyzomDateStr__s">
getRyzomDateStr__s</a></h3>
Gets the ryzom date as string Arguments: &gt; s(ryzomDateStr)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ryzomTimeAndDateAsString</em>&nbsp;</td><td>The time and date of the ryzom univers as debug string.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($ryzomDateStr)getRyzomDateStr);
</pre></div><h3><a class="anchor" name="getRyzomDate__s">
getRyzomDate__s</a></h3>
Gets the ryzom tick game cycle. Useful for computing difference of time. The return value is a string and not a float because float is not sharp enought? Arguments: &gt; s(tickGameCycle)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>TickGameCycle</em>&nbsp;</td><td>The time of the ryzom univers (stops when server stops). 10 tick is 1 second.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($tickGameCycle)getRyzomDate();
</pre></div><h3><a class="anchor" name="phraseBegin__">
phraseBegin__</a></h3>
Clear the parameters stack.<p>
Used when creating a customized msg via phraseEndSystemMsg_fss_, phraseEndNpcMsg_fss_, phraseEndSystemMsg_fss_. It Must be called at start of phrase if we are not sure that the parameter stack is clean.<p>
Parameter stack is unclean when someone has called a phrasePush* function but *not* a phraseEnd function before (which is *very* bad).<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()phraseBegin();
()phrasePushValue(<span class="stringliteral">"money"</span>, 15);
()phrasePushValue(<span class="stringliteral">"integer"</span>, 15);
()phrasePushValue(<span class="stringliteral">"time"</span>, 15);
()phraseEndSystemMsg(0, <span class="stringliteral">"say"</span>, <span class="stringliteral">"PHRASE_FROM_PHRASE_WITH_3_PARAMETERS"</span>);
</pre></div><h3><a class="anchor" name="phrasePushValue_sf_">
phrasePushValue_sf_</a></h3>
This function push a value as number on the parameter stack. This stack is used by phraseEndSystemMsg_fss_, phraseEndNpcMsg_fss_, phraseEndSystemMsg_fss_ functions. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="nf__grp_8cpp.html#714328a956ba5e8ad60c870c558265f8">phraseBegin__</a> <p>
<a class="el" href="nf__grp_8cpp.html#58db8555ce782d6ac37c145111841e47">phrasePushString_ss_</a> <p>
<a class="el" href="nf__grp_8cpp.html#ed862d36a818a3dce35e1a09158610d4">phraseEndSystemMsg_fss_</a> <p>
<a class="el" href="nf__grp_8cpp.html#f69ff6c7b0ff4f1b0c924cc9bf0c8f8e">phraseEndNpcMsg_fss_</a> <p>
<a class="el" href="nf__grp_8cpp.html#ed862d36a818a3dce35e1a09158610d4">phraseEndSystemMsg_fss_</a></dd></dl>
The value *Must* be an number and only few type are handled.<ul>
<li>money</li><li>integer</li><li>time</li></ul>
<p>
Some value other can be handled *BUT* the value *MUST* be the C++ code enum value. So LD must ask to coder to do a scripting fonction that have as input a string that contains enum value as string eg "matis" and that return the C++ enum value as int (eg 4).<ul>
<li>skill</li><li>faction</li><li>power_type</li><li>race</li><li>damage_type</li><li>characteristic</li><li>score</li><li>body_part</li></ul>
<p>
Arguments: s(paramType), f(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>paramType</em>&nbsp;</td><td>the type of the parameter </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()phraseBegin();
()phrasePushValue(<span class="stringliteral">"money"</span>, 15);
()phrasePushValue(<span class="stringliteral">"integer"</span>, 15);
()phrasePushValue(<span class="stringliteral">"time"</span>, 15);
()phraseEndSystemMsg(0, <span class="stringliteral">"say"</span>, <span class="stringliteral">"PHRASE_WITH_3_PARAMETERS"</span>);
</pre></div><h3><a class="anchor" name="phrasePushString_ss_">
phrasePushString_ss_</a></h3>
This function push a value as string on the parameter stack. This stack is used by phraseEndSystemMsg_fss_, phraseEndNpcMsg_fss_, phraseEndSystemMsg_fss_ functions. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="nf__grp_8cpp.html#714328a956ba5e8ad60c870c558265f8">phraseBegin__</a> <p>
<a class="el" href="nf__grp_8cpp.html#033d554d949a67c8eeab73d51b62ce38">phrasePushValue_sf_</a> <p>
<a class="el" href="nf__grp_8cpp.html#ed862d36a818a3dce35e1a09158610d4">phraseEndSystemMsg_fss_</a> <p>
<a class="el" href="nf__grp_8cpp.html#f69ff6c7b0ff4f1b0c924cc9bf0c8f8e">phraseEndNpcMsg_fss_</a> <p>
<a class="el" href="nf__grp_8cpp.html#ed862d36a818a3dce35e1a09158610d4">phraseEndSystemMsg_fss_</a></dd></dl>
The value *Must* be a string. The string is internal converted to number, sheetId, entityId when needed.<p>
Input as a number:<ul>
<li>money</li><li>integer</li><li>time</li></ul>
<p>
Input as string literal<ul>
<li>literal</li></ul>
<p>
Input as an entityId (obtains via getCurrentPlayerAggroListTarget_f_s, getRandomPlayerAggroListTarget_f_s, getBotEid_f_s, getCurrentSpeakerEid__s, getAggroListElement_ff_s)<ul>
<li>player</li><li>bot</li><li>entity</li></ul>
<p>
Input as sheetId name (example: "toto.sbrick", "toto.sitem", "toto.creature")<ul>
<li>item</li><li>outpost</li><li>creature_model</li><li>creature</li><li>sphrase</li><li>sbrick</li></ul>
<p>
Input as string identifier<ul>
<li>place</li><li>event_faction</li><li>title</li><li>bot_name</li></ul>
<p>
Input as stringId (number): *WARNING* LD must as coder to do function that return string_id if they want to use that type<ul>
<li>dyn_string_id</li><li>string_id</li></ul>
<p>
Input must be a enum value: Some value other can be handled *BUT* the value *MUST* be the C++ code enum value. So LD must ask to coder to do a scripting fonction that have as input a string that contains enum value as string eg "matis" and that return the C++ enum value as int (eg 4).<ul>
<li>skill</li><li>faction</li><li>power_type</li><li>race</li><li>damage_type</li><li>characteristic</li><li>score</li><li>body_part</li></ul>
<p>
Arguments: s(paramType), f(value) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>paramType</em>&nbsp;</td><td>the type of the parameter </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>value</em>&nbsp;</td><td>the value of the parameter</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerEid)getCurrentPlayerEid();
($botEid)group3.getBotEid(4);
()phraseBegin();
()phrasePushValue(<span class="stringliteral">"integer"</span>, 15);
()phrasePushString(<span class="stringliteral">"integer"</span>, <span class="stringliteral">"15"</span>);
()phrasePushString(<span class="stringliteral">"literal"</span>, <span class="stringliteral">"Test 123"</span>);
()phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
()phrasePushString(<span class="stringliteral">"bot"</span>, $botEid);
()phrasePushString(<span class="stringliteral">"item"</span>, <span class="stringliteral">"abc.sitem"</span>);
()phrasePushString(<span class="stringliteral">"sbrick"</span>, <span class="stringliteral">"toto.sbrick"</span>);
()phrasePushString(<span class="stringliteral">"creature_model"</span>, <span class="stringliteral">"toto.creature"</span>);
()phraseEndSystemMsg(0, <span class="stringliteral">"say"</span>, <span class="stringliteral">"PHRASE_WITH_SOME_PARAMETERS"</span>);
</pre></div><h3><a class="anchor" name="phraseEndNpcMsg_fss_">
phraseEndNpcMsg_fss_</a></h3>
Send a message with parameter through a bot says. Parameters are taken from the parameters stack. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="nf__grp_8cpp.html#033d554d949a67c8eeab73d51b62ce38">phrasePushValue_sf_</a> <p>
<a class="el" href="nf__grp_8cpp.html#58db8555ce782d6ac37c145111841e47">phrasePushString_ss_</a></dd></dl>
Arguments: s(botIndex), s(sayType), s(phraseIdentifier) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group ( see getBotIndexByName_s_f) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>sayType</em>&nbsp;</td><td>Is the type of the say dialog ("say", "shout", "civilization", "territory", "universe", "arround", "system", "region") </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>phraseIdentifier</em>&nbsp;</td><td>Is the identifier phrase as seen in phrase_wk.uxt</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()phrasePushString(<span class="stringliteral">"literal"</span>, <span class="stringliteral">"text non traduit"</span>);
()groupOf5Bot.phraseEndNpcMsg(4, <span class="stringliteral">"say"</span>, <span class="stringliteral">"PHRASE_TOTO"</span>);
</pre></div><p>
WARNING In this case in the phrase_wk.txt PHRASE_TOTO must be defined as <div class="fragment"><pre class="fragment">PHRASE_TOTO(bot b, literal l)
{
[I am $b$, on <span class="keyword">this</span> text is not translated $l$ ]
}
</pre></div><p>
The first parameter is ALWAYS the bot that says the text (value is automaticaly set)<h3><a class="anchor" name="phraseEndSystemMsg_fss_">
phraseEndSystemMsg_fss_</a></h3>
Send a message with parameter through system braodcast msg. Parameters are taken from the parameters stack. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="nf__grp_8cpp.html#033d554d949a67c8eeab73d51b62ce38">phrasePushValue_sf_</a> <p>
<a class="el" href="nf__grp_8cpp.html#58db8555ce782d6ac37c145111841e47">phrasePushString_ss_</a></dd></dl>
Arguments: s(botIndex), s(sayType), s(phraseIdentifier) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group ( see getBotIndexByName_s_f) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>sayType</em>&nbsp;</td><td>Is the type of the say dialog ("say", "shout", "civilization", "territory", "universe", "arround", "system", "region") </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>phraseIdentifier</em>&nbsp;</td><td>Is the identifier phrase as seen in phrase_wk.uxt</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()phrasePushString(<span class="stringliteral">"literal"</span>, <span class="stringliteral">"Test des levels designer"</span>);
()groupOf5Bot.phraseEndSystemMsg(4, <span class="stringliteral">"say"</span>, <span class="stringliteral">"PHRASE_TOTO"</span>);
</pre></div><p>
WARNING* In this case in the phrase_wk.txt PHRASE_TOTO must be defined as <div class="fragment"><pre class="fragment">PHRASE_TOTO(literal l)
{
[$l$]
}
</pre></div> The first parameter is *NOT* automaticaly set to the bot that send the system msg as phraseEndNpcMsg_fss_.<p>
Because the msg can be send as "around". The broadcas msg must be send by a bot (that have a valid position)<h3><a class="anchor" name="phraseEndEmoteMsg_fs_">
phraseEndEmoteMsg_fs_</a></h3>
Send a custom emote message with parameter through system braodcast msg. Parameters are taken from the parameters stack. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="nf__grp_8cpp.html#033d554d949a67c8eeab73d51b62ce38">phrasePushValue_sf_</a> <p>
<a class="el" href="nf__grp_8cpp.html#58db8555ce782d6ac37c145111841e47">phrasePushString_ss_</a></dd></dl>
Arguments: s(botIndex), s(phraseIdentifier) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group ( see getBotIndexByName_s_f) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>phraseIdentifier</em>&nbsp;</td><td>Is the identifier phrase as seen in phrase_wk.uxt</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerEid)getCurrentPlayerEid();
($botEid)getCurrentSpeakerEid();
()phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
()groupOf5Bot.phraseEndEmoteMsg(,<span class="stringliteral">"PHRASE_TOTO1"</span>);
()phrasePushString(<span class="stringliteral">"bot"</span>, $botEid);
()groupOf5Bot.phraseEndEmoteMsg(,<span class="stringliteral">"PHRASE_TOTO2"</span>);
</pre></div><p>
WARNING* In this case in the phrase_wk.txt PHRASE_TOTO must be defined as <div class="fragment"><pre class="fragment">PHRASE_TOTO1(player p)
{
[$p$ is laughing ]
}
PHRASE_TOTO2(bot b)
{
[$b$ is sad ]
}
</pre></div> The first parameter is NOT automaticaly the bot that says the text as phraseEndNpcMsg_fss_ because a bot can make a player doing a emote text.<p>
The emote msg must be send by a bot (that have a valid position).<h3><a class="anchor" name="queryEgs_sscfs_">
queryEgs_sscfs_</a></h3>
Send a query msg to egs to know infos on a player. Answer is asynchronous so we have to indicates a group and a user event that will be triggered when answer will come back to AIS<p>
Possible info to know are<ul>
<li>Name</li><li>Hp</li><li>MaxHp</li><li>RatioHp</li><li>Sap</li><li>MaxSap</li><li>RatioSap</li><li>Focus</li><li>MaxFocus</li><li>RatioFocus</li><li>Stamina</li><li>MaxStamina</li><li>RatioStamina</li></ul>
<p>
Arguments: s(botIndex), s(query), c(groupThatWillBeTriggered), f(idOfTheUserEvent), s(msgId) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group ( see getBotIndexByName_s_f) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>query</em>&nbsp;</td><td>The query we want to send </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>groupThatWillBeTriggered</em>&nbsp;</td><td>The group that will receive a user_event when the answer will come </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idOfTheUserEvent</em>&nbsp;</td><td>The number of the user event that will be triggered </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>msgId</em>&nbsp;</td><td>The id of the msg</td></tr>
</table>
</dl>
Answer will be given by the getParam<p>
<div class="fragment"><pre class="fragment"> <span class="comment">//Sening msg to EGS</span>
(@groupToNotify)boss_group.context();
()queryEgs(<span class="stringliteral">"Name"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"MSG_NAME"</span>);
()queryEgs(<span class="stringliteral">"Hp"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg1"</span>);
()queryEgs(<span class="stringliteral">"MaxHp"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg2"</span>);
()queryEgs(<span class="stringliteral">"RatioHp"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg3"</span>);
()queryEgs(<span class="stringliteral">"Sap"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg4"</span>);
()queryEgs(<span class="stringliteral">"MaxSap"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg5"</span>);
()queryEgs(<span class="stringliteral">"RatioSap"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg6"</span>);
()queryEgs(<span class="stringliteral">"Focus"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg7"</span>);
()queryEgs(<span class="stringliteral">"MaxFocus"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg8"</span>);
()queryEgs(<span class="stringliteral">"RatioFocus"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg9"</span>);
()queryEgs(<span class="stringliteral">"Stamina"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg10"</span>);
()queryEgs(<span class="stringliteral">"MaxStamina"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg11"</span>);
()queryEgs(<span class="stringliteral">"RatioStamina"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg12"</span>);
()queryEgs(<span class="stringliteral">"BestSkillLevel"</span>, $playerEid, @groupToNotify, 4, <span class="stringliteral">"msg13"</span>);
</pre></div> Answer of the EGS <div class="fragment"><pre class="fragment"> <span class="comment">// the user_event 4 of groupToNotify will be trigered </span>
($msgName)getEventParam(0); <span class="comment">// the msg name</span>
($ret)getEventParam(1); <span class="comment">// the return</span>
($funName)getEventParam(2); <span class="comment">// the name of the function</span>
($playerEid)getEventParam(3); <span class="comment">// the id of the player</span>
($param1)getEventParam(4); <span class="comment">// empty ot item, or sbrick or botEid</span>
<span class="keywordflow">if</span> ($msgName == <span class="stringliteral">"MSG_NAME"</span>) {
()phrasePushString(<span class="stringliteral">"literal"</span>, $ret);
()phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
()boss_group.phraseEndNpcMsg(0, <span class="stringliteral">"say"</span>, <span class="stringliteral">"TEST_BOSS_TEST_MSG"</span>);
}
<span class="keywordflow">else</span>
{
()phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
()phrasePushString(<span class="stringliteral">"literal"</span>, $funName);
()phrasePushString(<span class="stringliteral">"literal"</span>, $msgName);
()phrasePushString(<span class="stringliteral">"integer"</span>, $ret);
()boss_group.phraseEndNpcMsg(0, <span class="stringliteral">"say"</span>, <span class="stringliteral">"TEST_BOSS_TEST_EGS_QUERY"</span>);
}
</pre></div><h3><a class="anchor" name="summonPlayer_fs_">
summonPlayer_fs_</a></h3>
Summon a player to a bot.<p>
Can be used by a boss to teleport a player. Or the create a teleporter.<p>
A player EntityId is used to identify the player. A index is used to identified the bot (index for the current group)<p>
Arguments: f(botIndex), s(playerEid) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>is the index of the bot in the current group(static group) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerEid</em>&nbsp;</td><td>The entityId of the player</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(0);
()teleportPlayer(0, $playerEid); <span class="comment">// teleport player to the boss.</span>
</pre></div><h3><a class="anchor" name="teleportPlayer_sffff_">
teleportPlayer_sffff_</a></h3>
Teleport a player to a position<p>
A player EntityId is used to identify the player. The position is identified by the value x,y,z and the heading<p>
Arguments: s(playerId), f(x), f(y), f(z), f(heading) &gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerId</em>&nbsp;</td><td>is EntityId of the player </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x,y,z,heading</em>&nbsp;</td><td>is the new position of the player</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerId)getRandomPlayerAggroListTarget(0);
()teleportPlayer($playerEid, 1000, 1000, 100, 0);
</pre></div><h3><a class="anchor" name="getBotEid_f_s">
getBotEid_f_s</a></h3>
Get the bot EntityId by its Index. Arguments: f(botIndex) -&gt; s(botEid)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>botEid</em>&nbsp;</td><td>The entity Id given by the bot (or empty) if the indexed bot is not from the group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(index)getBotIndexByName(<span class="stringliteral">"bot_toto"</span>);
($botEid)getBotEid(index);
<span class="keywordflow">if</span> (index != -1)
{
()phrasePushValue(<span class="stringliteral">"entity"</span>, $botEid);
()phraseEndEmoteMsg(index, <span class="stringliteral">"PHRASE_YOUR_ARE_CLICKING_ON_ME"</span>);
}
</pre></div><h3><a class="anchor" name="getBotIndex_s_f">
getBotIndex_s_f</a></h3>
Get the bot Index by its entityId. Entity Id of a bot can be given via getCurrentSpeackerEid(). It can be usefull to Known the index of the bot in the group with the EntityId.<p>
Arguments: s(botEid) -&gt; f(botIndex),<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botEid</em>&nbsp;</td><td>The entity Id given by the bot </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>botIndex</em>&nbsp;</td><td>the Position of the bot in the group (or -1 if the entity_id is not from a bot of the group)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($botEid)getCurrentSpeakerEid();
(index)getBotIndex($botEid);
<span class="keywordflow">if</span> (index != -1)
{
()phrasePushValue(<span class="stringliteral">"entity"</span>, $botEid);
()phraseEndNpcg(index, <span class="stringliteral">"PHRASE_YOUR_ARE_CLICKING_ON_ME"</span>);
}
</pre></div><h3><a class="anchor" name="getCurrentPlayerEid__s">
getCurrentPlayerEid__s</a></h3>
Get the entity id of the player that is clicking on a bot.<p>
WARNING the function is only valid when called from an player_target_npc event.<p>
Arguments: -&gt; s(playerEidAsString), <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>playerEidAsString</em>&nbsp;</td><td>is EntityId as string from the player.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($playerEid)getCurrentPlayerEid();
(index)getBotIndexByName(<span class="stringliteral">"toto"</span>);
(distance)getPlayerDistance(index, $playerEid);
phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
phrasePushValue(<span class="stringliteral">"interger"</span>, distance);
phraseEndNpcMsg(index, <span class="stringliteral">"say"</span>, <span class="stringliteral">"MSG_BOT_B_SAYS_THE_PLAYER_P_IS_AT_DISTANCE_D"</span>);
</pre></div><h3><a class="anchor" name="getCurrentSpeakerEid__s">
getCurrentSpeakerEid__s</a></h3>
Get the entity id of the bot at which the player as that is clicking at.<p>
WARNING the function is only valid when called from an player_target_npc event.<p>
Arguments: -&gt; s(botEidAsString), <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>botEidAsString</em>&nbsp;</td><td>is EntityId as string from the bot.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">($botEid)getCurrentSpeakerEid();
($playerEid)getCurrentSpeakerEid();
phrasePushString(<span class="stringliteral">"player"</span>, $playerEid);
phrasePushValue(<span class="stringliteral">"bot"</span>, $botEid);
phraseEndEmotMsg(index, <span class="stringliteral">"EMOT_PLAYER_INSULT_BOT"</span>);
</pre></div><h3><a class="anchor" name="sitDown__">
sitDown__</a></h3>
Make the group sit Down<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()sitDown();
</pre></div><h3><a class="anchor" name="standUp">
standUp</a></h3>
Make the group stand up (if was previously stand down)<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()standUp();
</pre></div><h3><a class="anchor" name="standUp">
standUp</a></h3>
Use to implement setConditionRet<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()setConditionRet(1);
</pre></div><h3><a class="anchor" name="setFactionProp_ss_">
setFactionProp_ss_</a></h3>
Set a property of the faction profile. Valid values for Property are:<ul>
<li>faction</li><li>ennemyFaction</li><li>friendFaction</li></ul>
<p>
There are special faction that are automatically attributed to entities. Special factions are:<ul>
<li>Player</li><li>Predator</li><li>Famous&lt;faction&gt; where faction is the name of a Ryzom faction with uppercase initials and without underscores (ie: tribe_beachcombers -&gt; FamousTribeBeachcombers), it represents players with a positive fame with the specified faction</li><li>outpost:&lt;id&gt;:&lt;side&gt; where id is the outpost alias as an int, and side is either attacker ou defender (these faction may see their format change soon and shouldn't be used without prior discussion with the responsible coder), it represents players and squads fighting in an outpost conflict</li></ul>
<p>
Arguments: s(Property),s(Content) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>Property</em>&nbsp;</td><td>is the property to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Content</em>&nbsp;</td><td>is a '|' seperated list of faction names</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setFactionProp(<span class="stringliteral">"ennemyFaction"</span>, <span class="stringliteral">"Player"</span>);
</pre></div><h3><a class="anchor" name="moveToZone_ss_">
moveToZone_ss_</a></h3>
Moves the current group from one zone to another.<p>
Arguments: s(From), s(To) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>From</em>&nbsp;</td><td>is a zone name </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>To</em>&nbsp;</td><td>is a zone name</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()moveToZone($zone1, $zone2); <span class="comment">// Move the current group from $zone1 to $zone2</span>
</pre></div><h3><a class="anchor" name="setActivity_s_">
setActivity_s_</a></h3>
Changes the activity of the group. Valid activities are:<ul>
<li>"no_change"</li><li>"escorted"</li><li>"guard"</li><li>"guard_escorted"</li><li>"normal"</li><li>"faction"</li><li>"faction_no_assist"</li><li>"bandit"</li></ul>
<p>
Arguments: s(Activity) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Activity</em>&nbsp;</td><td>is an activity name the group will take</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setActivity(<span class="stringliteral">"bandit"</span>); <span class="comment">// Gives a bandit activity to the group</span>
</pre></div><h3><a class="anchor" name="waitInZone_s_">
waitInZone_s_</a></h3>
Makes the group wander in the specified zone. It's useful to prevent the group from looping previous movement profile).<p>
Arguments: s(Zone) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Zone</em>&nbsp;</td><td>is a zone name</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()waitInZone($zone); <span class="comment">// Makes the group wander in $zone</span>
</pre></div><h3><a class="anchor" name="stopMoving__">
stopMoving__</a></h3>
Makes the group stop moving and stand at its current position.<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()stopMoving(); <span class="comment">// Makes the group stop moving</span>
</pre></div><h3><a class="anchor" name="wander__">
wander__</a></h3>
Makes the group wander in the current npc state zone.<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()wander(); <span class="comment">// Makes the group wander</span>
</pre></div><h3><a class="anchor" name="setAttackable_f_">
setAttackable_f_</a></h3>
Sets the group as being attackable (or not) by bots and players. 0 means not attackable, 1 means attackable.<p>
Arguments: f(Attackable) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Attackable</em>&nbsp;</td><td>tells whether the group is attackable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setAttackable(1); <span class="comment">// Make the group attackable by players and bots</span>
</pre></div><h3><a class="anchor" name="setPlayerAttackable_f_">
setPlayerAttackable_f_</a></h3>
Sets the group as being attackable (or not) by players. 0 means not attackable, 1 means attackable.<p>
Arguments: f(Attackable) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Attackable</em>&nbsp;</td><td>tells whether the group is attackable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setPlayerAttackable(1); <span class="comment">// Make the group attackable by players</span>
</pre></div><h3><a class="anchor" name="setBotAttackable_f_">
setBotAttackable_f_</a></h3>
Sets the group as being attackable (or not) by bots. 0 means not attackable, 1 means attackable.<p>
Arguments: f(Attackable) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Attackable</em>&nbsp;</td><td>tells whether the group is attackable</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setBotAttackable(0); <span class="comment">// Make the group not attackable by bots</span>
</pre></div><h3><a class="anchor" name="setFactionAttackableAbove_sff_">
setFactionAttackableAbove_sff_</a></h3>
Sets the group as being attackable (or not) by players having their fame matching the specified condition. If player fame for Faction is above specified Threshold the bot will be attackable by that player or not depending on Attackable parameter, 0 meaning not attackable, 1 meaning attackable.<p>
Note: Bots must not be player attackable for the faction to be taken into account.<p>
Arguments: s(Faction),f(Threshold),f(Attackable) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Faction</em>&nbsp;</td><td>tells the faction against which player fame will be tested </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Threshold</em>&nbsp;</td><td>is the test threshold above which player will be able to attack </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Attackable</em>&nbsp;</td><td>tells whether the group is attackable or not</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setFactionAttackableAbove(<span class="stringliteral">"TribeNightTurners"</span>, 0, 1); <span class="comment">// Make the group attackable by players with positive tribe_night_turners fame</span>
</pre></div><h3><a class="anchor" name="setFactionAttackableBelow_sff_">
setFactionAttackableBelow_sff_</a></h3>
Sets the group as being attackable (or not) by players having their fame matching the specified condition. If player fame for Faction is below specified Threshold the bot will be attackable by that player or not depending on Attackable parameter, 0 meaning not attackable, 1 meaning attackable.<p>
Note: Bots must not be player attackable for the faction to be taken into account.<p>
Arguments: s(Faction),f(Threshold),f(Attackable) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Faction</em>&nbsp;</td><td>tells the faction against which player fame will be tested </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Threshold</em>&nbsp;</td><td>is the test threshold below which player will be able to attack </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>Attackable</em>&nbsp;</td><td>tells whether the group is attackable or not</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setFactionAttackableBelow(<span class="stringliteral">"TribeMatisianBorderGuards"</span>, 0, 1); <span class="comment">// Make the group attackable by players with negative tribe_matisian_border_guards fame</span>
</pre></div><h3><a class="anchor" name="addBotChat_s_">
addBotChat_s_</a></h3>
Add an entry in the botchat menu of every bot of the group. Specified text ID can be created dynamically with setSimplePhrase (<a class="el" href="code.html#setSimplePhrase_ss_">setSimplePhrase_ss_</a>).<p>
Arguments: s(BotChat) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>BotChat</em>&nbsp;</td><td>is a text ID</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addBotChat(<span class="stringliteral">"menu:QUESTION:REPONSE"</span>);
</pre></div><h3><a class="anchor" name="clearBotChat__">
clearBotChat__</a></h3>
Removes all entries from the botchat menu of every bot of the group.<p>
Arguments: -&gt;<p>
<div class="fragment"><pre class="fragment">()clearBotChat();
</pre></div><h3><a class="anchor" name="ignoreOffensiveActions_f_">
ignoreOffensiveActions_f_</a></h3>
Make the bots of the group ignore offensive actions issued on them.<p>
Arguments: f(IgnoreOffensiveActions) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>IgnoreOffensiveActions</em>&nbsp;</td><td>is tells whethere to ignore offensive actions (1) or not (0)</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()ignoreOffensiveActions(1);
</pre></div><h3><a class="anchor" name="setDespawnTime_f_">
setDespawnTime_f_</a></h3>
Sets the time before current group being despawned.<p>
Arguments: f(DespawnTime) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>DespawnTime</em>&nbsp;</td><td>is the despawn time in ticks (-1 will set "pseudo-infinite")</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setDespawnTime(80);
()setDespawnTime(-1);
</pre></div><h3><a class="anchor" name="despawnBotByAlias_s_">
despawnBotByAlias_s_</a></h3>
Despawn a specific Bot by its alias<p>
Arguments: f(alias), -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>alias</em>&nbsp;</td><td>is the alias of the bot</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()despawnBotByAlias('(A:1000:10560)');
</pre></div><h3><a class="anchor" name="setRespawnTime_f_">
setRespawnTime_f_</a></h3>
Sets the time in game cycles before current group being respawned.<p>
Arguments: f(RespawnTime) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>RespawnTime</em>&nbsp;</td><td>is the respawn time in ticks (-1 will set "pseudo-infinite")</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setRespawnTime(80);
()setRespawnTime(-1);
</pre></div><h3><a class="anchor" name="addHpUpTrigger_ff_">
addHpUpTrigger_ff_</a></h3>
Registers a trigger on HP increases. Whenever the HP level of a bot upcross the threshold it triggers the specified user event. Several triggers can be registered on the same group, even with the same threshold and event.<p>
Arguments: f(threshold),f(user_event_n) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>user_event_n</em>&nbsp;</td><td>is the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addHpUpTrigger(0.5, 4);
</pre></div><h3><a class="anchor" name="delHpUpTrigger_ff_">
delHpUpTrigger_ff_</a></h3>
Unregisters a trigger on HP increases. The same values used when registering the trigger must be passed. If several triggers were defined with the same parameters only one is removed.<p>
Arguments: f(threshold),f(user_event_n) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>user_event_n</em>&nbsp;</td><td>is the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delHpUpTrigger(0.5, 4);
</pre></div><h3><a class="anchor" name="addHpDownTrigger_ff_">
addHpDownTrigger_ff_</a></h3>
Registers a trigger on HP decreases. Whenever the HP level of a bot downcross the threshold it triggers the specified user event. Several triggers can be registered on the same group, even with the same threshold and event.<p>
Arguments: f(threshold),f(user_event_n) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>user_event_n</em>&nbsp;</td><td>is the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addHpDownTrigger(0.5, 5);
</pre></div><h3><a class="anchor" name="delHpDownTrigger_ff_">
delHpDownTrigger_ff_</a></h3>
Unregisters a trigger on HP decreases. The same values used when registering the trigger must be passed. If several triggers were defined with the same parameters only one is removed.<p>
Arguments: f(threshold),f(user_event_n) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>user_event_n</em>&nbsp;</td><td>is the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delHpDownTrigger(0.5, 5);
</pre></div><h3><a class="anchor" name="addHpUpTrigger_fs_">
addHpUpTrigger_fs_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#addHpUpTrigger_ff_">addHpUpTrigger_ff_</a></dd></dl>
These triggers call a script function instead of trigger a user event.<p>
Arguments: f(threshold),s(callback) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>is the script callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addHpUpTrigger(0.5, <span class="stringliteral">"onHPIncrease"</span>);
</pre></div><h3><a class="anchor" name="delHpUpTrigger_fs_">
delHpUpTrigger_fs_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#delHpUpTrigger_ff_">delHpUpTrigger_ff_</a></dd></dl>
This function is used to remove script function triggers.<p>
Arguments: f(threshold),s(callback) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>is the script callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delHpUpTrigger(0.5, <span class="stringliteral">"onHPIncrease"</span>);
</pre></div><h3><a class="anchor" name="addHpDownTrigger_fs_">
addHpDownTrigger_fs_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#addHpDownTrigger_ff_">addHpDownTrigger_ff_</a></dd></dl>
These triggers call a script function instead of trigger a user event.<p>
Arguments: f(threshold),s(callback) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>is the script callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addHpDownTrigger(0.5, <span class="stringliteral">"onHPDecrease"</span>);
</pre></div><h3><a class="anchor" name="delHpDownTrigger_fs_">
delHpDownTrigger_fs_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#delHpDownTrigger_ff_">delHpDownTrigger_ff_</a></dd></dl>
This function is used to remove script function triggers.<p>
Arguments: f(threshold),s(callback) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>threshold</em>&nbsp;</td><td>is a HP threshold </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>callback</em>&nbsp;</td><td>is the script callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delHpDownTrigger(0.5, <span class="stringliteral">"onHPDecrease"</span>);
</pre></div><h3><a class="anchor" name="addNamedEntityListener_ssf_">
addNamedEntityListener_ssf_</a></h3>
Associates a listeners with a named entity property. Whenever that field changes the specified user event is triggered. Valid property names are:<ul>
<li>state</li><li>param1</li><li>param2 Name of the entity cannot be listened, because it cannot change. Several listeners (even with the same parameters) can be associated to each property.</li></ul>
<p>
Arguments: s(name),s(prop),f(event) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>event</em>&nbsp;</td><td>is a the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addNamedEntityListener(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, 6);
</pre></div><h3><a class="anchor" name="delNamedEntityListener_ssf_">
delNamedEntityListener_ssf_</a></h3>
Removes a listener from a named entity property. If several listeners with the same parameters are registered, only one is removed.<p>
Arguments: s(name),s(prop),f(event) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>event</em>&nbsp;</td><td>is a the user event to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delNamedEntityListener(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, 6);
</pre></div><h3><a class="anchor" name="addNamedEntityListener_sss_">
addNamedEntityListener_sss_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#addNamedEntityListener_ssf_">addNamedEntityListener_ssf_</a></dd></dl>
These listeners call a script function instead of triggering a user event.<p>
Arguments: s(name),s(prop),s(cbFunc) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cbFunc</em>&nbsp;</td><td>is a the callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()addNamedEntityListener(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, <span class="stringliteral">"onStateChange"</span>);
</pre></div><h3><a class="anchor" name="delNamedEntityListener_sss_">
delNamedEntityListener_sss_</a></h3>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="code.html#delNamedEntityListener_ssf_">delNamedEntityListener_ssf_</a></dd></dl>
This function removes script function listeners.<p>
Arguments: s(name),s(prop),s(cbFunc) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>is a the name of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prop</em>&nbsp;</td><td>is a the property of the named entity to listen </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>cbFunc</em>&nbsp;</td><td>is a the callback to trigger</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()delNamedEntityListener(<span class="stringliteral">"Invasion"</span>, <span class="stringliteral">"state"</span>, <span class="stringliteral">"onStateChange"</span>);
</pre></div><h3><a class="anchor" name="setPlayerController_ss_">
setPlayerController_ss_</a></h3>
Make a player control a npc.<p>
Arguments: s(botId),s(playerId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botId</em>&nbsp;</td><td>is the entity id of the bot the player will control </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>playerId</em>&nbsp;</td><td>is the entity id of the player that will control the bot</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()setPlayerController(<span class="stringliteral">"(0x0002015bb4:01:88:88)"</span>, <span class="stringliteral">"(0x0000004880:00:00:00)"</span>);
</pre></div><h3><a class="anchor" name="clearPlayerController_s_">
clearPlayerController_s_</a></h3>
Stop the control of a npc by a player.<p>
Arguments: s(botId) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botId</em>&nbsp;</td><td>is the entity id of the bot</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()clearPlayerController(<span class="stringliteral">"(0x0002015bb4:01:88:88)"</span>);
</pre></div><h3><a class="anchor" name="activateEasterEgg_fffsffffsss_">
activateEasterEgg_fffsffffsss_</a></h3>
Call the EGS function CCharacterControl::activateEasterEgg<p>
Arguments: f(easterEggId), f(scenarioId), f(actId), s(items), f(x), f(y), f(z),f(heading), f(groupname), f(name), f(clientSheet)-&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>items</em>&nbsp;</td><td>is the sheet/quantity vector (a string of format "item1:qty1;item2:qty2;...")</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()activateEasterEgg(2, 1601, 4, <span class="stringliteral">"toto.sitem:2;tata.sitem:1;titi.sitem:3"</span>, 1247, 4627, 0, 0);
</pre></div><h3><a class="anchor" name="deactivateEasterEgg_fff_">
deactivateEasterEgg_fff_</a></h3>
Call the EGS function CCharacterControl::deactivateEasterEgg<p>
Arguments: f(easterEggId), f(scenarioId), f(actId) -&gt;<p>
<div class="fragment"><pre class="fragment">()deactivateEasterEgg(0, 4);
</pre></div><h3><a class="anchor" name="receiveMissionItems_ssc_">
receiveMissionItems_ssc_</a></h3>
The npc will ask mission items to the targeter player.<p>
A new entry of the npc contextual menu will propose to the targeter player to give mission items to the npc if he has the requested items.<p>
Then user events are triggered on the group to inform it about what happens:<ul>
<li>user_event_1: triggered if the player has the requested mission items.</li><li>user_event_2: triggered if the player hasn't the requested mission items.</li><li>user_event_3: triggered after the player has given the mission items to the npc.</li></ul>
<p>
Warning: this function can only be called after the event "player_target_npc".<p>
Arguments: s(missionItems), s(missionText), c(groupToNotify) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>missionItems</em>&nbsp;</td><td>is the list of mission items, the string format is "item1:qty1;item2:qty2;...". </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>missionText</em>&nbsp;</td><td>is the text which will appear in the npc contextual menu. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>groupToNotify</em>&nbsp;</td><td>is the npc group which will receive the user events.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@groupToNotify)group_name.context();
()receiveMissionItems(<span class="stringliteral">"toto.sitem:2;tata.sitem:1;titi.sitem:3"</span>, <span class="stringliteral">"Mission text"</span>, @groupToNotify);
</pre></div><h3><a class="anchor" name="giveMissionItems_ssc_">
giveMissionItems_ssc_</a></h3>
The npc will give mission items to the targeter player.<p>
A new entry of the npc contextual menu will propose to the targeter player to receive mission items from the npc.<p>
Then user events are triggered on the group to inform it about what happens:<ul>
<li>user_event_1: triggered after the player has received the mission items from the npc.</li></ul>
<p>
Warning: this function can only be called after the event "player_target_npc".<p>
Arguments: s(missionItems), s(missionText), c(groupToNotify) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>missionItems</em>&nbsp;</td><td>is the list of mission items, the string format is "item1:qty1;item2:qty2;...". </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>missionText</em>&nbsp;</td><td>is the text which will appear in the npc contextual menu. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>groupToNotify</em>&nbsp;</td><td>is the npc group which will receive the user events.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@groupToNotify)group_name.context();
()giveMissionItems(<span class="stringliteral">"toto.sitem:2;tata.sitem:1;titi.sitem:3"</span>, <span class="stringliteral">"Mission text"</span>, @groupToNotify);
</pre></div><h3><a class="anchor" name="talkTo_sc_">
talkTo_sc_</a></h3>
A new entry of the npc contextual menu will propose to the targeter player to talk to the npc.<p>
Then user events are triggered on the group to inform it about what happens:<ul>
<li>user_event_1: triggered each time (because of the TRICK).</li><li>user_event_3: triggered after the player has talked to the npc.</li></ul>
<p>
Warning: this function can only be called after the event "player_target_npc".<p>
Arguments: s(missionText), c(groupToNotify) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>missionText</em>&nbsp;</td><td>is the text which will appear in the npc contextual menu. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>groupToNotify</em>&nbsp;</td><td>is the npc group which will receive the user events.</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@groupToNotify)group_name.context();
()talkTo(<span class="stringliteral">"Mission text"</span>, @groupToNotify);
</pre></div><h3><a class="anchor" name="facing_cscs_">
facing_cscs_</a></h3>
The npc1 will turn to npc2<p>
Arguments: c(group1), s(botname1), c(group2), s(botname2), -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>group1</em>&nbsp;</td><td>is the npc group of the boot that turn to the other bot </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botname1</em>&nbsp;</td><td>is the name of the bot </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>group2</em>&nbsp;</td><td>is the npc group of the boot that is the target </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botname2</em>&nbsp;</td><td>is the name of the bot that is targeted</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@group1)group_name1.context();
(@group1)group_name2.context();
()facing(@group1, <span class="stringliteral">"bob"</span>, @group2, <span class="stringliteral">"bobette"</span>);
</pre></div><h3><a class="anchor" name="npcSay_css_">
npcSay_css_</a></h3>
A new entry of the npc contextual menu will propose to the targeter player to talk to the npc.<p>
Make a npc say a text<p>
There are 3 type of text<ul>
<li>Classic StringId (IOS does traduction)</li><li>RING "complete text (no traduction)</li><li>RING StringId (DSS does traduction)</li></ul>
<p>
Arguments: c(group), s(botname), s(text), -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>group</em>&nbsp;</td><td>is the npc group of the boot that does the emote </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botname</em>&nbsp;</td><td>is the name of the bot </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>text</em>&nbsp;</td><td>is the name of the emote</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@group)group_name.context();
()emote(@group, <span class="stringliteral">"bob"</span>, <span class="stringliteral">"DSS_1601 RtEntryText_6"</span>) ;<span class="comment">// Send To dss</span>
()emote(@group, <span class="stringliteral">"bob"</span>, <span class="stringliteral">"RAW Ca farte?"</span>); <span class="comment">// phrase direcly send to IOS as raw (for debug)</span>
()emote(@group, <span class="stringliteral">"bob"</span>, <span class="stringliteral">"answer_group_no_m"</span>); <span class="comment">//phrase id</span>
</pre></div><h3><a class="anchor" name="deactivateEasterEgg_fff_">
deactivateEasterEgg_fff_</a></h3>
Call the DSS function CAnimationModule::dssMessage<p>
Arguments: f(easterEggId), f(scenarioId), f(actId) -&gt;<p>
<div class="fragment"><pre class="fragment">()dssMessage(114, <span class="stringliteral">"BC"</span>, <span class="stringliteral">"Bob"</span>, <span class="stringliteral">"Life is harde"</span>);
</pre></div><h3><a class="anchor" name="setScenarioPoints">
setScenarioPoints</a></h3>
Call the DSS function CAnimationModule::setScenarioPoints<p>
Arguments: f(scenarioInstance), f(scenarioPoints) -&gt;<p>
<div class="fragment"><pre class="fragment">()setScenarioPoints(114, 42);
</pre></div><h3><a class="anchor" name="startScenarioTiming">
startScenarioTiming</a></h3>
Call the DSS function CAnimationModule::startScenarioTiming<p>
Arguments: f(scenarioInstance),<p>
<div class="fragment"><pre class="fragment">()startScenarioTiming(114, 42);
</pre></div><h3><a class="anchor" name="endScenarioTiming">
endScenarioTiming</a></h3>
Call the DSS function CAnimationModule::endScenarioTiming<p>
Arguments: f(scenarioInstance),<p>
<div class="fragment"><pre class="fragment">()endScenarioTiming(114, 42);
</pre></div><h3><a class="anchor" name="emote_css_">
emote_css_</a></h3>
Make a npc launch a emote<p>
Arguments: c(group1), s(botname1), c(group2), s(botname2), -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>group1</em>&nbsp;</td><td>is the npc group of the boot that does the emote </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>botname1</em>&nbsp;</td><td>is the name of the bot </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>emote</em>&nbsp;</td><td>is the name of the emote</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">(@group1)group_name.context();
()emote(@group1, <span class="stringliteral">"bob"</span>, <span class="stringliteral">"sad"</span>)
</pre></div><h3><a class="anchor" name="maxHitRange_f_">
maxHitRange_f_</a></h3>
Sets the max hit range possible for player, in meters<p>
Arguments: f(MaxHitRange) -&gt; <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>MaxHitRange</em>&nbsp;</td><td>set the max range for player can hit this npc group</td></tr>
</table>
</dl>
<div class="fragment"><pre class="fragment">()maxHitRange(50); <span class="comment">// Set the max hit range in 50 meters all npc in group</span>
</pre></div> </div>
<div class="footer">
Ryzom AI service documentation generated by <a href="http://www.doxygen.org">doxygen</a>
at Thu Apr 12 20:15:06 2007
</div>
</body>
</html>