Search the Community
Showing results for tags 'debrief'.
Found 2 results
-
Help needed with creating kill counter for each BLUFOR character
Mahagar posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, this is my first post here so I apologize in advance if I placed this under the wrong thread. I am currently developing a coop MP scenario where you have to take over the city from enemy and kill the main enemy commander. I have the basics up and running, but what I would like to achieve next is that at the end of the mission, ideally on debrief screen, it will display the name of the BLUFOR character with most kills (whether it was a player or AI). There are other stats I would like to show, too, such as name of the one who killed the enemy commander, the one who died first etc, but I think that as long as I get the first stat working I could figure out the rest. I am admittedly not very strong at scripting so I asked chatGPT (dont hate me lol) for help on this and I think it gave me some good pointers, however there are some errors I cant get through. Here is my "setup": init.sqf: // Function to check if a unit is BLUFOR _isBLUFOR = { side _this == west; // Check if the unit's side is BLUFOR }; // Get a list of all units in the mission _allUnits = allUnits; // Execute the kill tracking script for each BLUFOR unit { if (_isBLUFOR _x) then { [_x] execVM "killTracking.sqf"; } } forEach _allUnits; killTracking.sqf: _characterKills = []; _unit addEventHandler ["killed", { private ["_killer"]; _killer = _this select 1; if (side _killer == west && side _this == east) then { _killerName = name _killer; if (!isNil {_characterKills select _killerName}) then { _characterKills select _killerName = _characterKills select _killerName + 1; } else { _characterKills set [_killerName, 1]; } } }]; missionDebriefing.sqf (called directly from editor when trigger's condition of all opfor units being dead is met): // Find the character with the most kills _mostKills = 0; _mostKillsCharacter = ""; { private ["_characterName", "_killCount"]; _characterName = _x; _killCount = _characterKills select _x; if (_killCount > _mostKills) then { _mostKills = _killCount; _mostKillsCharacter = _characterName; } } forEach keys _characterKills; // Display the information in the debriefing screen ["Most kills were achieved by %1", _mostKillsCharacter] call BIS_fnc_dynamictext; by looking at the code I think I understand roughly what are most of the lines supposed to do. However, when I try to run the game with these scripts, it points to an error within init.sqf - something about missing ). Checking the code in Notepad++ I cant see any missing brackets or anything. What am I missing here? Is this a smart way of going about the kill counter or it can be done in easier way ? Any help would be appreciated ^^ Thanks- 14 replies
-
- kill counter
- debrief
-
(and 1 more)
Tagged with:
-
In the editor, when the player dies, is it possible to show the debriefing screen instead of the usual death screen?