Jump to content

Mahagar

Member
  • Content Count

    7
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Mahagar

  • Rank
    Rookie
  1. seems like I have finally got it all working with your help. Thank you gentlemen! Now I can finally wrap the whole mission up! I really appreciate your support. I will credit you with help when I release it if you dont mind 🙂 Cheers
  2. thats super weird, but thanks for checking it. Now I copied your codes again (deleted the old ones to start fresh) and checked it for any hidden characters in Notepad++ and apart from CR and LF there doesnt seem to be anything malicious but still the code wont run 😕 Now it returns error right upon the start of the game and one upon the end when all enemies are eliminated do you think there are still some hidden characters ? How do you check for those ? I went to View -> Show Symbol -> Show All Symbols
  3. Right, handling it within the same MEH makes sense. However it returns error: 10:58:45 Error in expression < = createHashMap; MAH_assassinsName = ""; addMissionEventHandler ["Entit> 10:58:45 Error position: <; addMissionEventHandler ["Entit> 10:58:45 Error Missing ; 10:58:45 File C:\Users\adria\Documents\Arma 3\mpmissions\killCounterTest_v01.Altis\initServer.sqf..., line 3 if I understand correctly, there is something wrong with declaring the MAH_assassinsName? I tried replacing "" with [], or inserting some placeholder value but nothing 😕 Im not sure how to read these error logs really - almost every time it says "missing ;" but in reality it is rarely the case
  4. I see your point. The reason I am asking is because, in this specific MP scenario, you will most likely play for multiple characters throughout the game (unless you are so good you dont get killed even once, which is highly unlikely given the circumstances), so if it returns your player name, say "johnny", you wont know which johnny it is referring to - johnny when he played as infantry machinegunner, or johnny when he was a tank gunner etc. Thats why I was intending to keep the characters original name instead. The way I understand it, the moment you take over an AI unit, its name (John Doe) gets overriden with your player name (Johnny). Is that correct? yeah thats kinda what I thought but wasnt sure. Moreover, if you dont mind helping me with one last thing? (sorry if Im being pain in the ass) Im trying to repurpose your scripts to also include the name of the character (just like in previous case) who killed specific enemy unit, unit named "elPresidente". The way I go about this, is in initServer, I added this (note I changed _name for _nameAssassin to avoid any clashing): addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; if (isNull _instigator) then { _instigator = _killer }; if (_this select 0 == elPresidente) then { if(side group _instigator isEqualTo BLUFOR) then { private _nameAssassin = name _instigator; }; }; }]; and in debriefing.sqf I added this: // Make into a string private _stringAssassin = format ( ["%1 receives the Pineapple Pizza Annihilator's Disctinction Medal for eliminating El Presidente.", _nameAssassin] ); // Send the and text hint to all clients using remoteExec _stringAssassin remoteExec ["hint", 0]; What happens is that ingame I get a hint saying "any receives the Pineapple Pizza Annihilator's Disctinction Medal for eliminating El Presidente." But the error Im getting upon executing this last part (your part still works just fine) is _stringAssassin remo> 15:24:29 Error position: <_nameAssassin] ); _stringAssassin remo> 15:24:29 Error Undefined variable in expression: _nameassassin 15:24:29 File C:\Users\adria\Documents\Arma 3\mpmissions\killCounterTest_v01.Altis\missionDebriefing.sqf..., line 37 not sure if I understand it correctly, but it seems like it considers _nameAssassin as undefined variable, but I thought I defined it in initServer? Am I missing something?
  5. damn it worked like a charm, thanks!!! hats off to you for being able to code it from top of your head without access to the game haha! Is there a way how to keep characters name even if it is a player ? I noticed that if AI becomes the one with most kills, his name is displayed properly, but if its me (player), it will override the characters name to mine. Is there a way to keep the original name ? btw just a side question, what's the difference between _killer and _instigator?
  6. hey, thanks for your reply! not gonna lie, that seems little bit too overwhelming for my capabilities. I was hoping it could be done in bit of easier fashion. Not only I would have to read up on each and every single step, but attempting to do so Im lost right away at hashmap...
  7. 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
×