Fixed: LevelDesign AI script documentation and few incode typos

--HG--
branch : compatibility-develop
hg/compatibility-develop
Inky 6 years ago
parent 21f2c0ea59
commit da8702479f

@ -1,6 +1,6 @@
<!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>
<title>Ryzom AI service: AI Scripting</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<div class="header">
@ -19,7 +19,7 @@
</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">
<h1><a class="anchor" name="code">AI Scripting</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>
@ -1464,9 +1464,9 @@ Arguments: f(botIndex) -&gt; s(playerEidAsString) <dl compact><dt><b>Parameters:
()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>
Get a player entity id (as string) from the aggro list of a bot by its 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 spawned) the function returns an empty string and display a warning message. You can use this with isBotAlived to be sure that the bot index is still a valid value.<p>
A aggro list index is used to identify 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>
@ -1474,47 +1474,47 @@ Arguments: f(botIndex), f(aggroListIndex) -&gt; s(playerEidAsString) <dl compact
<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)
<div class="fragment"><pre class="fragment">(aggroSize)getAggroListSize(0);
<span class="comment">// to much players are attacking the boss</span>
<span class="keywordflow">if</span> (aggroSize &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();
&#9;($player1)getAggroListElement(0,0);
&#9;($player2)getAggroListElement(1,0);
&#9;($player3)getAggroListElement(2,0);
<span class="comment">&#9;// so the boss teleport 3 players from its aggro list at the end of the world</span>
&#9;teleportPlayer($player1, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;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>
Get a size of the aggro list 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 spawned) the function returns an empty string and display a warning message. You can use this with 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 list<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)
<div class="fragment"><pre class="fragment">(aggroSize)getAggroListSize(0);
<span class="comment">// to much players are attacking the boss</span>
<span class="keywordflow">if</span> (aggroSize &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();
&#9;($player1)getAggroListElement(0,0);
&#9;($player2)getAggroListElement(1,0);
&#9;($player3)getAggroListElement(2,0);
<span class="comment">&#9;// so the boss teleport 3 players from its aggro list at the end of the world</span>
&#9;teleportPlayer($player1, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;teleportPlayer($player2, 14233, 123123, 0, 0);
&#9;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 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 spawned) the function returns an empty string and display a warning message. You can use this with 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">
@ -1561,8 +1561,7 @@ Arguments:, s(botName) &gt; f(botIndex)<p>
</dl>
<div class="fragment"><pre class="fragment">(botIndex)getBotIndexByName(<span class="stringliteral">"boss_random_aggro"</span>);
($playerId)getRandomPlayerAggroListTarget(botIndex);
()setAggroListTarget(botIndex, $playerId);
}
()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>
@ -1808,7 +1807,7 @@ Arguments: s(botIndex), s(query), c(groupThatWillBeTriggered), f(idOfTheUserEven
</table>
</dl>
Answer will be given by the getParam<p>
<div class="fragment"><pre class="fragment"> <span class="comment">//Sening msg to EGS</span>
<div class="fragment"><pre class="fragment"> <span class="comment">//Sending 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>);

@ -1984,7 +1984,7 @@ void cbClientSendWhere( NLNET::CMessage& msgin, const std::string &serviceName,
CZoneManager::getInstance().answerWhere(id);
}
// client send a command where for known where is it
// client send a command afk to set the player as 'away from keyboard'
void cbClientSendAfk( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
{
H_AUTO(cbClientSendAfk);
@ -2057,7 +2057,7 @@ void cbClientSit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
if( !c->isInWater() && c->getMode()!=MBEHAV::MOUNT_NORMAL && c->getMode()!=MBEHAV::DEATH )
{
c->setMode( MBEHAV::SIT );
// only if player is'nt equipping an item
// only if player isn't equipping an item
//( to prevent exploit "sit to reduce equip latency time")
if( !c->getGearLatency().isLatent() )
{

@ -252,7 +252,7 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
// load character of player
PlayerManager.loadPlayer( player );
// set status connexion of player to connected
// set status connection of player to connected
player->setPlayerConnection( true );
// set player cookie, for later web activation
@ -2935,7 +2935,7 @@ void cbAnimalMount( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
}
else
{
nlwarning("<cbAnimalMount> %d Target %s %s is not moutable !! sheeter or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
nlwarning("<cbAnimalMount> %d Target %s %s is not moutable !! sheet or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
}
}
else

Loading…
Cancel
Save