Cold Evil 13 Posted September 22, 2013 Hi! I what to do a “resupply†script. I want the MainBase to have restricted amount of ammo. By adding boxes with custom ammo, weapons and equipment inside. But I also want to make it possible to resupply them by using a scripted resupply only affect a certain unit. I want it to work like this: 1: When class name I_Heli_Transport_02_F or name ReSupplyHelo enters Trigger: Supply it turns true. (In theory the helo is supplied with ammo weapons and equipment.) 2: When class name I_Heli_Transport_02_F or name ReSupplyHelo enters Trigger: ReSupply it turns true. This makes both Trigger Supply and ReSupply true. (This means that: BOX1, Init:â€nul =[this] execVM "BaseAmmo.sqf";†(Runs it resupply script.) And both triggers turn false and waiting for another delivery.) I know how I do this one way when a random blufor unit enters the trigger. The trigger resupplies the boxes, BUT I want it to be in two stages and only effect ONE unit. In addition I also want a similar FOB resupplying system was you can grab ammo form the MainBase and move it to the FOB. In a similar system, but I might do that myself when I get the main supply system to work. And In later stage I also want it to effect the respawn on the Vehicles. Any thought how I can do this? ---------- Post added at 17:51 ---------- Previous post was at 17:27 ---------- So far i only use this, BUT it means that you may resupply it as any blufor and how many times you whant. And that is not what i want. ^^ ReSupply trigger OnAcc use: null =[bOX1] execVM "BaseAmmo.sqf"; And the BOX1 init uses: null =[this] execVM "BaseAmmo.sqf"; Share this post Link to post Share on other sites
mikie boy 18 Posted September 22, 2013 Chopper transport and touchdown getpos SupplyPad; // h pad _distances = [1500,2500] call BIS_fnc_selectRandom; _ang = random 360; _dis = _distances; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _loc = [((getpos SupplyPad) select 0) + _dx, ((getpos SupplyPad) select 1) + _dy, 0]; SupplyChopperGrp = createGroup west; SupplyChopper = createVehicle ["I_Heli_Transport_02_F ", _loc, [],75, "FLY"]; //update to new A3 models //create pilot and move in CHopper _SupPilot = SupplyChopperGrp createUnit ["US_Soldier_Pilot_EP1", [0,0,1], [], 0, "CAN_COLLIDE"]; //update to new A3 models //add gunner _SupGun1 = SupplyChopperGrp createUnit ["US_Soldier_Crew_EP1", [0,0,1], [], 0, "CAN_COLLIDE"]; //update to new A3 models _SupPilot moveInDriver SupplyChopper; _SupPilot = driver SupplyChopper; _SupGun1 moveInGunner SupplyChopper; _SupGun1 = gunner SupplyChopper; _SupPilot setskill 1; _SupPilot allowDamage False; SupGun1 allowDamage False; SupplyChopper allowDamage False; clearWeaponCargo SupplyChopper; //empties ammo and weapons from chopper clearMagazineCargo SupplyChopper; SupplyChopper lock true; // Create waypoints _reswp = SupplyChopperGrp addwaypoint [(getPos SupplyPad), 0]; _reswp setwaypointspeed "FULL"; _reswp setwaypointtype "MOVE"; _reswp setWaypointCombatMode "BLUE"; _reswp setWaypointStatements ["true", "SupplyChopper land ""LAND"";"]; sleep 5; waituntil {((speed SupplyChopper) == 0)}; Hint "Supply Chopper has landed and is unloading"; sleep 2; execVM "SupplyUnloadCtrl.sqf"; //execute here unload and load of boxes SupplyChopper addEventHandler ["Killed", { (_this select 0) spawn SupplyChopperdeath; }]; //should never really die but just in case the code for the SupplyUnloadCtrl.sqf - should be to either count the type/class of ammoboxes on the ground you wish to increase - or an automatic update of the ammobox load script in which you will wipe the whole crate inventory and then resupply it - various ways to do it i suppose. Best google ranked/custom ammo boxes (best create ammo boxes locally to have custom kit if its for individual players etc). Once all has been loaded or unloaded from chopper - add something like the following... SupChopperComplete = { deleteVehicle SupplyChopper; deleteVehicle SupPilot; deletegroup SupplyChopperGrp; Sleep 2; HINT "Supply Chopper complete"; }; HINT,"Supply complete - Chopper returning to HQ"; SupplyChopper land "NONE"; SupplyChopper flyinheight 85; SupplyChopper domove getpos gamelogicHQ; //can change this for a H pad at the FOB for reupply there. waituntil {(position SupplyChopper distance gamelogicHQ <500)}; //need to have game logic on the map called gamelogicHQ [] spawn SupChopperComplete; }; Share this post Link to post Share on other sites
Cold Evil 13 Posted September 22, 2013 I was thinking of making this manually. So when you need more ammo at the main base you fly to the edge turn around and fly back to base simulating a cargo transport. The trigger only need to be trigger by a specific class name or unit name and the other trigger should only be allowed to trigger IF the first trigger have been set true by the same vehicle. Simulating the supply transport. Share this post Link to post Share on other sites