Signalman 11 Posted July 21, 2011 Hi, I have made a Death Match mission, player VS. Player VS. AI, in which by default, all players and AI are targets, and both are worth 1 point per kill. I would like to change the players value to 10 points per kill. That is to say, kill another online player, you get 10 points, kill a AI target, you get 1 point. My idea is to give an incentive for players to go and hunt other players, rather than just sit and pick off AI targets for 1 point each. So my questions are; How is this done? Triggers or EH? Any good scripts or links out there? p.s. The mission has a 20 player max. Each playable named S1, S2, S3, and so on. Thanks for any help. Share this post Link to post Share on other sites
.kju 3244 Posted July 22, 2011 http://community.bistudio.com/wiki/addScore Share this post Link to post Share on other sites
Signalman 11 Posted July 22, 2011 (edited) Thanks, but I think that will only work if you only have two players. ( Sorry, I should have written "Players VS. Players VS. AI") trigger activation:- not (alive s1) s2 addscore 9 not (alive s2) s1 addscore 9 That does work, (1 point for the kill, + addscore 9 = 10 points) but if you make the same triggers for the other players, s3, s4, s5, and so on, not (alive s1) s3 addscore 9 not (alive s1) s4 addscore 9 not (alive s1) s5 addscore 9 everyone will get 10 points for the kill or respawn kill of s1. (I tried that, and with 20 players, thats a lot of triggers!) What I'm looking for is a script, a trigger syntax, or a event handler that would give 10 points only to the player that actually killed s1. That is to say, if s3 kills s12, only s3 gets 10 points for the kill of s12. ( it's a 20 player DM game with AI included. ) In this link, http://forums.bistudio.com/showthread.php?t=65109&highlight=scoring+values "Loyalguard" started to touch on that but stopped short. He had written an event handler:- this addEventHandler ["killed", {nul = [1] execVM "scoreWest.sqf"}];- in my case, would the correct way to write that for each player might be, this addEventHandler ["killed", {nul = [10] execVM "scoreS1.sqf"}]; this addEventHandler ["killed", {nul = [10] execVM "scoreS2.sqf"}]; this addEventHandler ["killed", {nul = [10] execVM "scoreS3.sqf"}]; and a separate .sqf file for each player? if so, how should the .sqf files be written? Or can everything be written in one file with the same event handler for all players? Or...is there a trigger syntax that might work? ( I don't know! lol) Once again, thanks for all the help! p.s. i now know more about this game than i ever wanted to. but it's a fun puzzle! Edited July 22, 2011 by Signalman Share this post Link to post Share on other sites
.kju 3244 Posted July 22, 2011 http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#Killed the killed EH provides you the killer and killed Share this post Link to post Share on other sites
Signalman 11 Posted July 22, 2011 (edited) Ok, thanks. I think I'm going to try this; For all players, this addEventHandler ["killed", {nul = [10] execVM "score.sqf"}]; And in the "score.sqf" file, one file. Written like this; if (!local Server) exitWith {}; _this select 0; _this select 1 So, "_this select 0" is the killed, and "_this select 1" is the killer and will get 10 points. Am I on the right track here? ( That's too simple. lol.) Well, I'll give that a shot. Thanks again. Edited July 22, 2011 by Signalman Share this post Link to post Share on other sites
Signalman 11 Posted July 22, 2011 Well, that doesn't work. The event handler fires off, but the syntax of my "score.sqf file is incorrect. Or missing something. (I knew that was too easy.) I'm working on it, but, does anybody know how to write this file? What I'm missing or a link that might help? I'll keep looking. lol Share this post Link to post Share on other sites