Jump to content
Bagback

S.O.G. Prairie Fire advanced logistics help

Recommended Posts

What I have is a heli on the ground with a hold wp and a trigger. Need  to load body bags on the heli with SOG Prairie Fire advanced logistics module but I can't figure out how to check the heli for the bags before it adds the addAction

this is what i have.

 

[Bbag_1,Bbag_2,Bbag_3,Bbag_4,Bbag_5,Bbag_6,] call VN_fnc_log_isLoaded;    
if (true) then
{
Minuteman2 addAction ["<t color=""#33CCFF"">Air-Lift Bodies</t>",{hint "Bodies Recovered!", AirLiftBox=true;publicvariable "AirLiftBox";},nil,1.5,true,true,"","true",5, false,""];
}

Thanks in advance for any help 🙂

Share this post


Link to post
Share on other sites

I don't know that function, but the first problem is that its return is not being used - there is no handle to retrieve it and the condition for your code always returns true, as it is literally just "true." There is also a syntax error in the function's param array (the last comma is not needed) as well as in code block called by the addAction (comma instead of semi-colon).

[Bbag_1,Bbag_2,Bbag_3,Bbag_4,Bbag_5,Bbag_6,] call VN_fnc_log_isLoaded;				// no handle, so return is unavailable / last comma not needed

if (true) then											//  ignores above and always runs code
{
	Minuteman2 addAction 
	[
		"<t color=""#33CCFF"">Air-Lift Bodies</t>",
		{hint "Bodies Recovered!", AirLiftBox=true; publicvariable "AirLiftBox";},	//  comma should be semi-colon
		nil,
		1.5
		,true,
		true,
		"",
		"true"
		,5
		,
		false,
		""
	];
}

So, we'll add a handle and, assuming it returns a Boolean value, check that:

_bagsLoaded = [Bbag_1,Bbag_2,Bbag_3,Bbag_4,Bbag_5,Bbag_6] call VN_fnc_log_isLoaded;

if (_bagsLoaded) then
{
	Minuteman2 addAction 
	[
		"<t color=""#33CCFF"">Air-Lift Bodies</t>",
		{hint "Bodies Recovered!"; AirLiftBox=true; publicvariable "AirLiftBox";},
		nil,
		1.5
		,true,
		true,
		"",
		"true"
		,5
		,
		false,
		""
	];
}

 

Share this post


Link to post
Share on other sites

Thank you Harzach, the function is from the Savage Game Wiki and is supposed to check if the item is loaded in an inventory system that is used in the Prairie Fire CDLC https://wiki.sogpf.com/index.php/VN_fnc_log_isLoaded. I could be wrong about what the function is supposed to do as it still doesn't work but thank you for taking the time to explain what was wrong instead of just a fix. 

Share this post


Link to post
Share on other sites

OK, thanks for the link.  

 

The function takes two parameters in an array:

s = [object, vehicle] call VN_fnc_log_isLoaded;  //  vehicle is optional, will simply check if loaded into any vehicle

so we can't feed it multiple objects. We can, however, iterate through an array of objects with it:

_count = 0;						//  initialize counter
_bags = [Bbag_1,Bbag_2,Bbag_3,Bbag_4,Bbag_5,Bbag_6];	//  create array of objects to be loaded

{
	_loaded = [_x] call VN_fnc_log_isLoaded;
	if (_loaded) then {_count = _count + 1};
} forEach _bags;					//  count number of bags loaded

if (_count == 6) then					//  if all bags loaded, add action
{
	Minuteman2 addAction 
	[
		"<t color=""#33CCFF"">Air-Lift Bodies</t>",
		{hint "Bodies Recovered!"; AirLiftBox=true; publicvariable "AirLiftBox";},
		nil,
		1.5
		,true,
		true,
		"",
		"true"
		,5
		,
		false,
		""
	];
}

This code block must be run periodically to check status.

 

I am absolutely certain that there is a more elegant way to accomplish this, but I'm exhausted.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you so much. That worked beautifully and helped me finish a mission in my campaign. I did remove the addAction and just used the publicvariable as it was just activating a trigger and add this to init.sqf 

 

while {true} do {
  [] execVM "AirliftBodies.sqf"; sleep 1;
};

 

I'm sure you know a better way to loop it but it is working so again much thanks.

 

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

×