Jump to content
Sign in to follow this  
derfritz

Need help with vehicle loadouts!

Recommended Posts

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

try to use this:

vehicle _unit addmagazine "120Rnd_CMFlareMagazine";

vehicle _unit addweapon "CMFlareLauncher";

Share this post


Link to post
Share on other sites

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

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

Ok, changed it, sadly, still no flares after respawn :(

Share this post


Link to post
Share on other sites

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

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

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

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

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 by DerFritz

Share this post


Link to post
Share on other sites
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

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
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
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×