Search the Community
Showing results for tags '3304'.
-
Hi, I've made a patch for 0003304: "add scripting events to get mission statistics". http://bugs.thedarkm...iew.php?id=3304 The kind of events needed is something that maybe needs discussing, so consider this patch a proposal. Some things to consider: I've added those events to the "sys" entity. But maybe they should be on player or other entity? I've added events for all statistics used in UpdateStatisticsGUI(). But maybe there should be more flexible events, like getMissionStatistic(COMP_ALERT, BY_TEAM, 1, EAgitatedSearching)? Are the names of the events ok? getStatGamePlayTime() returns time in seconds, while getStatTotalTimePlayerSeen() in milliseconds. Normalize? Here is the list of script events I've added (getDifficultyLevel() should be there already): // Scripting events to get mission statistics, #3304 scriptEvent float getDifficultyLevel(); scriptEvent string getDifficultyName(float difficultyLevel); scriptEvent float getStatGamePlayTime(); scriptEvent float getStatDamageDealt(); scriptEvent float getStatDamageReceived(); scriptEvent float getStatHealthReceived(); scriptEvent float getStatPocketsPicked(); scriptEvent float getStatFoundLoot(); scriptEvent float getStatMissionLoot(); scriptEvent float getStatTotalTimePlayerSeen(); scriptEvent float getStatNumberTimesPlayerSeen(); scriptEvent float getStatNumberTimesAISuspicious(); scriptEvent float getStatNumberTimesAISearched(); scriptEvent float getStatSightingScore(); scriptEvent float getStatStealthScore(); scriptEvent float getStatKilledByPlayer(); scriptEvent float getStatKnockedOutByPlayer(); scriptEvent float getStatBodiesFound(); (Those lines are not included in the patch as I don't have access to current data files.) Changes: Fixed bug in checking bounds for AIAlerts in CMissionData::GetStat*() methods. Sorted methods in MissionData.h to group stat functions together. Added accessor functions to all values that are used in UpdateStatisticsGUI() - so that this function and script events use consistent interface. Added mission stats events to "sys" entity. Added event descriptions to tdm_events.script (not included in patch). Changed MAX_AICOMP in MissionStatistics.h to be equal to COMP_COUNT. Added include "../AI/Memory.h" in MissionStatistics.h to use EAlertState enum in MAX_ALERTLEVELS and CMissionData. Changed hard coded values to EAlertState enum values in MissionData.cpp. While testing those events I've found some issues: 1. A bug that causes pickpocketting to be counted twice. InventoryCallback() is called twice: Code in CInventory::PutItem(idEntity * ent, idEntity * owner) PutItem(item, category); // <-- InventoryCallback() is already called here! // We added a new inventory item gameLocal.m_MissionData->InventoryCallback(...); // <-- second call - double COMP_PICKPOCKET counting! 2. A bug that causes enemies killed by player to not be counted as player's kills. In idPhysics_AF::Rest() there's a line: // grayman #3075 - set m_MovedByActor to NULL here self->m_MovedByActor = NULL; This causes bodies killed by the player to not count as player's kills as soon as their bodies come to rest! I understand this code is needed for props, but should be disabled for dead bodies. I couldn't find those in the bugtracker. If they are not known I can create issues for them. MissionStats.patch.txt
- 8 replies
-
- 2
-
- mission statistics
- patch
-
(and 1 more)
Tagged with: