From da8702479fd275f85d8f3d85a54c8c05d5a7e7b1 Mon Sep 17 00:00:00 2001 From: Inky Date: Thu, 14 Feb 2019 01:56:47 +0100 Subject: [PATCH] Fixed: LevelDesign AI script documentation and few incode typos --HG-- branch : compatibility-develop --- .../npc/action_type/code.html | 67 +++++++++---------- .../entities_game_service/client_messages.cpp | 4 +- .../entity_manager/entity_callbacks.cpp | 4 +- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type/code.html b/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type/code.html index 0d7bf7941..3cf3a486a 100644 --- a/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type/code.html +++ b/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/npc/action_type/code.html @@ -1,6 +1,6 @@ -Ryzom AI service: Le script d'AI +Ryzom AI service: AI Scripting
@@ -19,7 +19,7 @@
-

Le script d'AI

+

AI Scripting

General information

Its a C like code.

Comments are defined after two slashes like this:

// my comment
@@ -1464,9 +1464,9 @@ Arguments: f(botIndex) -> s(playerEidAsString) 
Parameters: ()setAggroListTarget(4, $playerId);

getAggroListElement_ff_s

-Get a player entity id (as string) from the aggro list of a bot by it aggro list index.

-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.

-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 )

+Get a player entity id (as string) from the aggro list of a bot by its aggro list index.

+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.

+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

Arguments: f(botIndex), f(aggroListIndex) -> s(playerEidAsString)

Parameters:
@@ -1474,47 +1474,47 @@ Arguments: f(botIndex), f(aggroListIndex) -> s(playerEidAsString)
[in] botIndex is the index of an bot member of the current group
[out] playerEidAsString is EntityId as string from the player we want infos
-
(aggroSize)getAggorListSize(0);
-// to much player are attacking the boss
-if (aggoroSize > 10)
+
(aggroSize)getAggroListSize(0);
+// to much players are attacking the boss
+if (aggroSize > 10)
 {
-($player1)getAggroListElement(0);
-($player2)getAggroListElement(1);
-($player3)getAggroListElement(2);
-// so the boss teleport 3 person from its aggro list at the end of the world
-teleportPlayer($player1, 14233, 123123, 0, 0);
-teleportPlayer($player2, 14233, 123123, 0, 0);
-teleportPlayer($player2, 14233, 123123, 0, 0);
-clearAggroList();
+	($player1)getAggroListElement(0,0);
+	($player2)getAggroListElement(1,0);
+	($player3)getAggroListElement(2,0);
+	// so the boss teleport 3 players from its aggro list at the end of the world
+	teleportPlayer($player1, 14233, 123123, 0, 0);
+	teleportPlayer($player2, 14233, 123123, 0, 0);
+	teleportPlayer($player2, 14233, 123123, 0, 0);
+	clearAggroList();
 }
 

getAggroListSize_f_f

-Get a size of the aggro lsit of a bot (list of aggroable PLAYER)

-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.

-A number is used to indicate the size of the aggro lsit

+Get a size of the aggro list of a bot (list of aggroable PLAYER)

+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.

+A number is used to indicate the size of the aggro list

Arguments: f(aggroListIndex) -> f(sizeOfAggroList)

Parameters:
[in] botIndex is the index of an bot member of the current group.
[out] sizeOfAggroList The size of the aggro list index.
-
(aggroSize)getAggorListSize(0);
-// to much player are attacking the boss
-if (aggoroSize > 10)
+
(aggroSize)getAggroListSize(0);
+// to much players are attacking the boss
+if (aggroSize > 10)
 {
-($player1)getAggroListElement(0);
-($player2)getAggroListElement(1);
-($player3)getAggroListElement(2);
-// so the boss teleport 3 person from its aggro list at the end of the world
-teleportPlayer($player1, 14233, 123123, 0, 0);
-teleportPlayer($player2, 14233, 123123, 0, 0);
-teleportPlayer($player2, 14233, 123123, 0, 0);
-clearAggroList();
+	($player1)getAggroListElement(0,0);
+	($player2)getAggroListElement(1,0);
+	($player3)getAggroListElement(2,0);
+	// so the boss teleport 3 players from its aggro list at the end of the world
+	teleportPlayer($player1, 14233, 123123, 0, 0);
+	teleportPlayer($player2, 14233, 123123, 0, 0);
+	teleportPlayer($player2, 14233, 123123, 0, 0);
+	clearAggroList();
 }
 

setAggroListTarget_fs_

Maximize the Aggro of a target from the Aggro list of one bot (this id can be given by getRandomPlayerAggroListTarget)..

-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.

+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.

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.

Arguments: f(botIndex) >s(playerEidAsString) >

Parameters:
@@ -1561,8 +1561,7 @@ Arguments:, s(botName) > f(botIndex)

(botIndex)getBotIndexByName("boss_random_aggro");
 ($playerId)getRandomPlayerAggroListTarget(botIndex); 
-()setAggroListTarget(botIndex, $playerId); 
-}
+()setAggroListTarget(botIndex, $playerId);
 

isGroupAlived__f

Test if a group is alived (at least one member is alived)

@@ -1808,7 +1807,7 @@ Arguments: s(botIndex), s(query), c(groupThatWillBeTriggered), f(idOfTheUserEven

Answer will be given by the getParam

-

    //Sening msg to EGS
+
    //Sending msg to EGS
     (@groupToNotify)boss_group.context();
     ()queryEgs("Name", $playerEid, @groupToNotify, 4, "MSG_NAME");
     ()queryEgs("Hp", $playerEid, @groupToNotify, 4, "msg1");
diff --git a/code/ryzom/server/src/entities_game_service/client_messages.cpp b/code/ryzom/server/src/entities_game_service/client_messages.cpp
index 434b7eefe..82e0d5a2e 100644
--- a/code/ryzom/server/src/entities_game_service/client_messages.cpp
+++ b/code/ryzom/server/src/entities_game_service/client_messages.cpp
@@ -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() )
 				{
diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp
index 762db5af1..9b1f6aa19 100644
--- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp
+++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp
@@ -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(" %d Target %s %s is not moutable !! sheeter or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
+							nlwarning(" %d Target %s %s is not moutable !! sheet or client bug ?", CTickEventHandler::getGameCycle(), target.toString().c_str(), mount->getType().toString().c_str() );
 						}
 					}
 					else