Well I want to thank you all very much, as I may be able to program php, but the syntax in arma sure takes some getting used to (must be my old brain). I have used a simple form of the script that DaChevs listed just to try to get familiar with the syntax, and created a small script that would let me "see" how I was making out. (tried the one as you listed it, but couldnt make it work for me, so i thought going back to square one might help me understand). It is very basic, and simply shows "who killed who" in the form of a hint. I set it up so the hint shows the "players name[for real people] and AI[a name the game must assign]. Here is what I have;
---------ALL units (AI and human) have the follwoing call in the INIT spot for the unit - this addEventHandler ["killed", {_this exec "killed.sqs"}]
------ Placed in a file called killed.sqs.
Killed_Array = [];
publicVariable "Killed_Array";
_killed_player = _this select 0;
_killer = _this select 1;
_killer_name = name _killer;
_killed_name = name _killed_player;
_killer_side = side _killer;
_killed_side = side _killed_player;
killed_now = [str _killed_name + " was killed by " + str _killer_name];
Killed_Array = Killed_Array + killed_now;
publicVariable "Killed_Array";
hint format ["%1",Killed_Array];
-----
Now, while this works in the editor, and when I host a MP game, it only shows on my machine, not any other human players machine.
Here is what I am actually trying to do, which is esentially to create a "debrief.txt" type log file, detailing the game events. For my purposes, the follwoing can be stipulated;
- Our missions will NEVER have a JIP, only those at start will play.
- The human side (Bluefor) will consist of ONLY humans, and while some AI may be present [doing something on the side], NO AI will ever be controled by humans.
So, to make this debrief file, each time something is killed, the following needs to be saved somehow done;
Create a string --- Time of the game - Player-x (or object) was killed by Player-y - (flag Civilian kill or friendly kill)
Once I have that, I need to do one of the follwoing two things (if either is even possible)
1 - place this string as an entry in an array (must be size vaiable). The array will be appended [new entry] for every occurance. At the end of the game, this array would contain as many lines as kills, and detail ALL that happened in the game. This array would then need to somehow be written to a file (debrief.txt or similar file) on EACH real players machine (game like Black Shark, Falcon 4, Dangerous water all do this as part of the game, Ghost Recon does not).
OR
2 - Append the string to a text file like above)
Now, this file needs to be created on ALL human player machines, and the file should be IDENTICAL on all machines. I hope that helps explain a bit on what I am trying to do, and if anyone can help me with any part of this I would be very greatfull.
Thank you all very much