obrez 11 Posted November 15, 2021 HI all, been away from editing for a while but I'm trying to get back into it. What I want to do is change the number of missiles the player gets with the backpack Metis launcher in CUP. I know how to add and remove ammo for pre-placed turrets but I want to change amount of ammo for the launcher that a player can carry as a backpack. How can I go about this? I tested for ammo capacity or even any items in the backpack and it returns nothing. I'm assuming the backpack just adds the action to assemble/disassemble weapon which then spawns/despawns a turret. Knowing this, how can I get the turret itself to change the number of missiles? I tried getting it with the assemble weapon event handler, but that only seems to return the model name, not the in-game object itself. What am I missing here? Thanks for any help. Share this post Link to post Share on other sites
Harzach 2507 Posted November 18, 2021 The weaponAssembled EH returns two things. From the Biki entry: this addEventHandler ["WeaponAssembled", { params ["_unit", "_staticWeapon"]; }]; "_unit" is the object to which the EH is assigned (generally, a player) and "_staticWeapon" is the assembled weapon object. So, to do what you want: Get the current magazine loaded in the turret (sort of) using magazinesTurret (a static weapon is classed as a turret). Remove all magazines using removeMagazinesTurret. Add the desired number of magazines/ammo using addMagazineTurret. Remove the EH using removeEventHandler We do it this way to avoid the possibility of infinite ammo (extra magazines added every time the weapon is assembled). this addEventHandler ["WeaponAssembled", { params ["_unit", "_staticWeapon"]; _mags = _staticWeapon magazinesTurret [0]; _staticWeapon removeMagazinesTurret [_mags select 0, [0]]; for "_i" from 1 to 3 do {_staticWeapon addMagazineTurret [_mags select 0, [0]]}; _unit removeEventHandler ["WeaponAssembled", _thisEventHandler]; }]; Line five defines how many magazines the turret will have: for "_i" from 1 to N where "N" is the number of desired magazines. 1 Share this post Link to post Share on other sites