theocrowley24 10 Posted July 6, 2016 I'm a complete noob when it comes to Arma 3 scripting and am in the process of attempting to learn it. I want to make a basic multiplayer PvP mission, one of the basic features is a Leveling system where you earn a certain amount of XP when you kill an enemy player. I'd guess that I need to have a variable holding the players xp and have some code on each player slot with an event handler which adds 100xp to the xp variable when they are killed. However I have no clue whatsoever on how this would look like in the Arma 3 programming language. Any help is very much appreciated! Share this post Link to post Share on other sites
kylania 568 Posted July 6, 2016 First Bookmark this: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 Heck, make it your home page. Second, ignore MP for now and learn things in the editor first. Third, look into getVariable and setVariable and addEventHandler commands. Get those working with AI in the editor first, then delve into the bubbling acid pit that is multiplayer scripting. 3 Share this post Link to post Share on other sites
theocrowley24 10 Posted July 6, 2016 Thanks for the advice! Share this post Link to post Share on other sites
Larrow 2823 Posted July 6, 2016 There is a little example mission in this post that could help. 1 Share this post Link to post Share on other sites
kylania 568 Posted July 6, 2016 There is a little example mission in this post that could help. At first I was tempted to complain that a 10MB demo mission is a bit extreme.. then I listed to actionTheme and realized how wrong I was. That's not extreme.. it's eXtreme!! (lots of good stuff in that mission, thanks for sharing!) Share this post Link to post Share on other sites
Mr.jizz 9 Posted July 6, 2016 im using this, youll have to change it bit to be used for pvp, ie killing people on th same team..... init.sqf killcounter = 0 and the main script... killcounter.sqf if (isDedicated) exitWith {}; while {true} do { { if (!(_x getVariable ["isTreated", false])) then { _x setVariable ["side", side _x]; _x addEventHandler ["Killed", { params ["_killed", "_killer"]; _sideKilled = _killed getVariable "side"; _sideKiller = playerSide; if (_sideKilled == _sidekiller) then { player globalChat "Friendly Fire!"; killcount = 0; } else { killcount = killcount + 1; }; }]; _x setVariable ["isTreated", true]; }; } forEach allUnits; }; Share this post Link to post Share on other sites
theocrowley24 10 Posted July 6, 2016 im using this, youll have to change it bit to be used for pvp, ie killing people on th same team..... init.sqf killcounter = 0 and the main script... killcounter.sqf if (isDedicated) exitWith {}; while {true} do { { if (!(_x getVariable ["isTreated", false])) then { _x setVariable ["side", side _x]; _x addEventHandler ["Killed", { params ["_killed", "_killer"]; _sideKilled = _killed getVariable "side"; _sideKiller = playerSide; if (_sideKilled == _sidekiller) then { player globalChat "Friendly Fire!"; killcount = 0; } else { killcount = killcount + 1; }; }]; _x setVariable ["isTreated", true]; }; } forEach allUnits; }; Oh this will helps loads cheers! Share this post Link to post Share on other sites
Mr.jizz 9 Posted July 7, 2016 Oh this will helps loads cheers! updated it a bit more, should work better. if (isDedicated) exitWith {}; while {true} do { { if (!(_x getVariable ["isTreated", false])) then { _x setVariable ["side", side _x]; _x addEventHandler ["Killed", { params ["_killed", "_killer"]; _sideKilled = _killed getVariable "side"; _sideKiller = playerSide; if ((_sideKilled == _sidekiller) && (alive player)) then { player globalChat "Friendly Fire!"; killcount = 0 }; if ((_sideKilled == _sidekiller) && (!alive player)) then { player globalChat "R.I.P"; killcount = 0; }else{ killcount = killcount + 1; }; }]; _x setVariable ["isTreated", true]; }; } forEach allUnits; }; Share this post Link to post Share on other sites