derfritz 11 Posted April 6, 2015 Hi Guys! I want to save the loadout of my Pawnees (I added flare launchers) when they respawn: This is my Init.sqf: null = [Pawnee1] execVM "loadout_pawnee.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee.sqf'"]; null = [Pawnee2] execVM "loadout_pawnee.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee.sqf'"]; null = [Pawnee3] execVM "loadout_pawnee.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee.sqf'"]; This is the loadout_pawnee.sqf: waitUntil {!isNull player}; _unit = _this select 0; _unit addweapon "CMFlareLauncher"; _unit addmagazine "120Rnd_CMFlareMagazine"; if(true) exitWith{}; Description.ext: respawn = 3; respawnDelay = 10; respawnVehicleDelay = 10; respawnDialog = 0; respawnOnStart = 0; aikills = 1; #include "VAS\menu.hpp" class CfgFunctions { #include "VAS\cfgfunctions.hpp" }; #include "taw_vd\dialog.hpp" And last but not least the Init of the pawnee: null = [this] execVM "loadout_pawnee.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee.sqf'"]; Pawnees are called Pawnee1, Pawnee2 and Pawnee3 Right now when I start the mission in MP the pawnees have flare launchers with 120 rounds, but when they respawn the launchers are gone. Also the Flares are somehow invisible. There is dust when the helicopter is on the ground but you can´t see the flares. Thanks in advance for your reply, Fritz Share this post Link to post Share on other sites
Idomass 11 Posted April 6, 2015 try to use this: vehicle _unit addmagazine "120Rnd_CMFlareMagazine"; vehicle _unit addweapon "CMFlareLauncher"; Share this post Link to post Share on other sites
derfritz 11 Posted April 6, 2015 I now put loadout_pawnee.sqf to: waitUntil {!isNull player}; _unit = _this select 0; _unit addmagazine "120Rnd_CMFlareMagazine"; _unit addweapon "CMFlareLauncher"; if(true) exitWith{}; Didn´t change anything sadly... Share this post Link to post Share on other sites
Idomass 11 Posted April 6, 2015 Are u sure that u changed it? u wrote exactly the same thing that u wrote before: waitUntil {!isNull player}; _unit = _this select 0; _unit addmagazine "120Rnd_CMFlareMagazine"; _unit addweapon "CMFlareLauncher"; if(true) exitWith{}; Change it to: waitUntil {!isNull player}; _unit = _this select 0; Vehicle _unit addmagazine "120Rnd_CMFlareMagazine"; Vehicle _unit addweapon "CMFlareLauncher"; if(true) exitWith{}; Share this post Link to post Share on other sites
derfritz 11 Posted April 6, 2015 Ok, changed it, sadly, still no flares after respawn :( Share this post Link to post Share on other sites
Idomass 11 Posted April 6, 2015 wait, are u spawing with inside the vehicle? it should work if the unit spawing inside it ---------- Post added at 08:05 PM ---------- Previous post was at 07:50 PM ---------- this might help u waituntil {!alive pawnee1}; waituntil {alive pawnee1}; pawnee1 addmagazine "120Rnd_CMFlareMagazine"; pawnee1 addweapon "CMFlareLauncher"; if it doesnt works do this thing this addeventhandler ["respawn","_this execVM 'loadout_pawnee1.sqf'"]; loadout_pawnee1.sqf: pawnee1 addmagazine "120Rnd_CMFlareMagazine"; pawnee1 addweapon "CMFlareLauncher"; Share this post Link to post Share on other sites
R3vo 2654 Posted April 6, 2015 this addEventHandler ["respawn", { _this addMagazine "120Rnd_CMFlareMagazine"; _this addWeapon "CMFlareLauncher"; }]; This should also work with the advantage that you don't need a seperate script. Share this post Link to post Share on other sites
derfritz 11 Posted April 7, 2015 Thanks so far, maybe I´m just too stupid, but it still doesn´t work... It´s an empty pawnee btw. Init.sqf: null = [Pawnee1] execVM "loadout_pawnee1.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee1.sqf'"]; null = [Pawnee2] execVM "loadout_pawnee1.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee2.sqf'"]; null = [Pawnee3] execVM "loadout_pawnee1.sqf"; this addeventhandler ["respawn","_this execVM 'loadout_pawnee3.sqf'"]; Loadout Pawnee1.sqf waituntil {!alive pawnee1}; waituntil {alive pawnee1}; pawnee1 addmagazine "120Rnd_CMFlareMagazine"; pawnee1 addweapon "CMFlareLauncher"; Pawnee1 editor init: this addeventhandler ["respawn","_this execVM 'loadout_pawnee1.sqf'"]; Nothing happens. Pawnee has no flares. Hope you can help me once again ;) This is the whole mission: https://drive.google.com/folderview?id=0B7zwbp0SrErbYUlsaTZtVTVycE0&usp=sharing Share this post Link to post Share on other sites
champ-1 40 Posted April 7, 2015 Flares for pawnee are not configured properly. There is an addon in this pack that fixes it: http://forums.bistudio.com/showthread.php?188247-CH-Rebalance-Pack Also it adds flares too, so you don't need scripts. Share this post Link to post Share on other sites
R3vo 2654 Posted April 7, 2015 The loadout_pawneeX.sqf can't workin my opinion. The eventHandler fires when the pawnee has been respawned, then it's starts the script, which then waitsUntil the helicopter is not alive..... Share this post Link to post Share on other sites
derfritz 11 Posted April 7, 2015 (edited) Ok, now it´s this way: Init.sqf: Pawnee1 addEventHandler ["respawn",{Pawnee1 addMagazine "120Rnd_CMFlareMagazine"; Pawnee1 addWeapon "CMFlareLauncher";}]; Pawnee2 addEventHandler ["respawn",{Pawnee2 addMagazine "120Rnd_CMFlareMagazine"; Pawnee2 addWeapon "CMFlareLauncher";}]; Pawnee3 addEventHandler ["respawn",{Pawnee3 addMagazine "120Rnd_CMFlareMagazine"; Pawnee3 addWeapon "CMFlareLauncher";}]; Loadout scripts deleted Pawnee Init: this addEventHandler ["respawn",{_this addMagazine "120Rnd_CMFlareMagazine"; _this addWeapon "CMFlareLauncher";}]; Still don´t work sadly... Edited April 7, 2015 by DerFritz Share this post Link to post Share on other sites
Beerkan 71 Posted April 7, 2015 Ok, now it´s this way: Init.sqf: Pawnee1 addEventHandler ["respawn",{Pawnee1 addMagazine "120Rnd_CMFlareMagazine"; Pawnee1 addWeapon "CMFlareLauncher";}]; Pawnee2 addEventHandler ["respawn",{Pawnee2 addMagazine "120Rnd_CMFlareMagazine"; Pawnee2 addWeapon "CMFlareLauncher";}]; Pawnee3 addEventHandler ["respawn",{Pawnee3 addMagazine "120Rnd_CMFlareMagazine"; Pawnee3 addWeapon "CMFlareLauncher";}]; Loadout scripts deleted Pawnee Init: this addEventHandler ["respawn",{_this addMagazine "120Rnd_CMFlareMagazine"; _this addWeapon "CMFlareLauncher";}]; Still don´t work sadly... This won't work, because when you respawn them, they won't be known as Pawnee1, Pawnee2 anymore etc. You need to use their reassigned variable names.I have used both a respawn script and the editor based Multiplayer Vehicle Respawn module to re-texture vehicle, and it's this code you need. You're not however,telling us enough. How are you re-spawning these? Are you doing this from a script, (then post the respawn script) or from a trigger (then post the trigger settings), or from the editor based Multiplayer Vehicle Respawn module? (then post your settings) Share this post Link to post Share on other sites
derfritz 11 Posted April 8, 2015 I use the Multiplayer Vehicle respawn module. These are my settings: This is the dowload link of my mission folder: https://drive.google.com/open?id=0B7zwbp0SrErbYUlsaTZtVTVycE0&authuser=0 Share this post Link to post Share on other sites
jshock 513 Posted April 8, 2015 In the expression field put: (_this select 0) addMagazine "120Rnd_CMFlareMagazine"; (_this select 0) addWeapon "CMFlareLauncher"; Share this post Link to post Share on other sites
R3vo 2654 Posted April 8, 2015 In the expression field put: (_this select 0) addMagazine "120Rnd_CMFlareMagazine"; (_this select 0) addWeapon "CMFlareLauncher"; That would work yes, but isn't it strange that the respawn eventHandler doesn't work with the module? Share this post Link to post Share on other sites
jshock 513 Posted April 8, 2015 That would work yes, but isn't it strange that the respawn eventHandler doesn't work with the module? Agreed. Would it work with MPRespawn EH? Share this post Link to post Share on other sites
derfritz 11 Posted April 9, 2015 THANKS GUYS!! Finally works!! Share this post Link to post Share on other sites