XSOF - Toxx 10 Posted March 18, 2013 (edited) Hello there, with help of some community members I have finally accomplished something worth showing: Kill Streaks for TDM games! For now I have the following: 1. Kill Streak: RPG 2. Kill Streak: Scope Sight (as you start with a holo sight in my setup) 3. Kill Streak: AI subordinate 4. Kill Streak: One round of mortar support (5. Kill Streak: Close Air Support - Currently canceled because the Little Bird often doesn't attack at all and then lands next to me :j:) Proof of concept: It's still work in progress and I will have to put a lot more work into it, so I'm hoping for your feedback and ideas (maybe add death streak bonuses? other kill streak bonuses?). As I am a fan of open source products, I plan to release the code, so everybody can adjust and enhance it as he pleases. Best regards Toxx Edit: hints in the upper right corner show unlock state. Edited March 19, 2013 by Toxx Share this post Link to post Share on other sites
XSOF - Toxx 10 Posted March 19, 2013 Would somebody want to help me to develop it further? ---------- Post added at 10:16 AM ---------- Previous post was at 08:29 AM ---------- Well I already exepected a COD-kind-of mode wouldn't get much love here^^ But you know, DayZ brought em here and they need to be entertained to keep supporting BIS :D Share this post Link to post Share on other sites
XSOF - Toxx 10 Posted March 19, 2013 Please, does anybody have an idea how to add ammo to a rpg? I've tried several approaches like adding it before adding the rpg itself, adding a sleep/waitUntil between it and so on. Share this post Link to post Share on other sites
Beerkan 71 Posted March 19, 2013 (edited) Surely you don't add ammo to the RPG. In ArmA2 you add it to the players inventory (addMagazine _x) first, then add the weapon i.e (player addWeapon _wep), then tell the unit to select the weapon. (player selectWeapon _wep)., This will reload the weapon with the ammo. --- UPDATE --- Just realised. Has the unit got the space for the ammo? Edited March 19, 2013 by Beerkan Share this post Link to post Share on other sites
XSOF - Toxx 10 Posted March 19, 2013 So, after lots and lots of testing I found out the basic loadout of my soldier really didn't have enough space. Thank you Beerkan, now it finally works! ---------- Post added at 12:56 AM ---------- Previous post was at 12:41 AM ---------- For now I have managed to implement it for single player. How would I have to change my code to make it accessible in MP? This is my current code: waituntil {!isnil "bis_fnc_init"}; removeAllWeapons player; // set custom loadout switch (side player) do { case EAST : { nul = [player] execVM "loadoutOPFOR.sqf"; }; case WEST : { nul = [player] execVM "loadoutBLUFOR.sqf"; }; }; // set amout of kills needed per killstreak killstreakRPG = 3; killstreakScope = 5; killstreakAI = 7; killstreakMortar = 10; // before it's unlocked, the mortar has no ammo mortarBlufor1 setVehicleAmmo 0.0; hint format ["Kill Streaks:\n%1 - RPG,\n%2 - Scope,\n%3 - AI,\n%4 - Mortar", killstreakRPG, killstreakScope, killstreakAI, killstreakMortar]; TargetSoldier1 addEventHandler ["killed", { // increase killstreak counter player setVariable["killstreak", (player getVariable["killstreak", 0]) + 1]; hint format ["Kill Streak %1: %2", player, player getVariable["killstreak", 0]]; // check if a killstreak has been reached switch (player getVariable["killstreak", 0]) do { case (killstreakRPG) : { hint format ["%1-Kill-Streak: RPG Unlocked!", killstreakRPG]; player addMagazine "RPG32_F"; player addWeapon "launch_RPG32_F"; }; case (killstreakScope) : { hint format ["%1-Kill-Streak: Scope Unlocked!", killstreakScope]; player removeItemFromPrimaryWeapon "optic_holosight"; player addprimaryweaponitem "optic_Hamr"; }; case (killstreakAI) : { hint format ["%1-Kill-Streak: AI Unlocked!", killstreakAI]; group player createUnit [typeOf player, getPos player, [], 0, "FORM"]; }; case (killstreakMortar) : { hint format ["%1-Kill-Streak: Mortar Unlocked!", killstreakMortar]; mortarBlufor1 addMagazine "8Rnd_82mm_Mo_shells"; mortarBlufor1 setVehicleAmmo 0.1; }; default { }; }; }]; I guess I'd have to use the "MPKilled"-EventHandler. What else would I have to change (besides respawning and so on, just about this part)? Instead of TargetSoldier1 I'd put "player" but how do I replace the key word "player" that I am using within the EventHandler to get access to the killer? "this select 1" doesn't seem to work?! Share this post Link to post Share on other sites
Tuliq 2 Posted March 20, 2013 A little bit too late for me to get into the specific details of making this MP-friendly, but I can tell you that to refer to the variable passed in the eventhandler you use _this instead of this. Share this post Link to post Share on other sites