Jump to content
BradApex

ExecVM and [] call Issues

Recommended Posts

Hey everyone, I seem to be having issue with [] ExecVM and [] call In sp and MP, I am making some scripts that spawn on a timer and them execute when that timer is done, I cant get them to spawn the only way is to paste the code from the files into debug console and that works, What am I doing wrong?

 

I have my functions called in CFGFunctions.h and every other function works. when called rather it be on timer or me calling it.

 

init.sqf

/*
    Author - Apex
	© All Memes Reserved
	Website - https://sora3milsim.com

	Calls all Functions for the dynamic missions, and some other files too.

*/

// start missions

[] execVM "Functions\Missions\Pilot\fn_Pilotinit.sqf";
[] execVM "Functions\Missions\Hostage\fn_Hostageinit.sqf";

// 

 

 

fn_Hostageinit.sqf // this called the file below, I have tried call and everything

/*
    Author - Apex
	© All Memes Reserved
	Website - https://sora3milsim.com

*/

sleep (5 * 60);
[] execVM "Functions\Missions\Hostage\fn_hostageSpawn.sqf";
systemchat "SPAWNING HOSTAGE MISSION... STAND BY!"

 

 

fn_hostageSpawn.sqf

/*
    Author - Apex
	© All Memes Reserved
	Website - https://sora3milsim.com

*/

private ["_captive","_radius","_hostageArea","_hostageAreaEllipse","_positions","_groupAlpha","_temp","_unit","_animations"]; 
_positions = (getMarkerPos (selectRandom["hostage_1","hostage_2","hostage_3"])); 
_animations = selectRandom ["Acts_AidlPsitMstpSsurWnonDnon01","Acts_AidlPsitMstpSsurWnonDnon02","Acts_AidlPsitMstpSsurWnonDnon03","Acts_AidlPsitMstpSsurWnonDnon04","Acts_AidlPsitMstpSsurWnonDnon05","Acts_ExecutionVictim_Loop"]; 
_captive = _this select 0; 
_radius = 250; 
 
["Hostage Rescue", "We have reports that some Journalists have gone missing, we have thier location you must rescue them before we can never see them again!"] call SOR_fnc_showNotification; 
 
_hostageArea = createMarker ["hostageArea",_positions]; 
_hostageArea setMarkerColor "ColorCiv"; 
_hostageArea setMarkerType "mil_dot"; 
_hostageArea setMarkerText "Rescue Hostages"; 
_hostageArea setMarkerAlpha 0.95; 
 
_hostageAreaEllipse = createMarker ["hostageAreaEllipse",_positions]; 
_hostageAreaEllipse setMarkerColor "ColorRed"; 
_hostageAreaEllipse setMarkerType "Empty"; 
_hostageAreaEllipse setMarkerShape "ELLIPSE"; 
_hostageAreaEllipse setMarkerBrush "DIAGGRID"; 
_hostageAreaEllipse setMarkerSize [_radius,_radius]; 
 
_groupAlpha = createGroup [east,true]; 
_temp = []; 
 
for "_i" from 0 to 10 do 
{ 
    _unit = _groupAlpha createUnit ["LOP_BH_Infantry_Rifleman", (getMarkerPos "hostageArea"), [], 0, "FORM"]; 
    _temp pushBack _unit; 
}; 
 
_groupJournalist = createGroup [civilian,true]; 
 
for "_i" from 0 to 1 do 
{ 
    _captive = _groupJournalist createUnit ["C_Journalist_01_War_F", (getMarkerPos "hostageArea"), [], 0, "FORM"]; 
    _temp pushBack _unit;  
    _captive switchMove _animations;
};  
 
removeAllWeapons _captive; 
removeBackpack _captive; 

_captive disableAI "MOVE";
_captive disableAI "AUTOTARGET";
_captive disableAI "ANIM"; 
_captive allowFleeing 0; 
_captive setBehaviour "Careless"; 
 
[ 
  _captive, 
  "Free Hostage", 
  "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_unbind_ca.paa", 
  "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_unbind_ca.paa", 
  "true", 
  "true", 
  {}, 
  {}, 
  {if (_this select 3 select 0 == "Acts_ExecutionVictim_Loop") then  
  { 
   _this select 0 playMove "Acts_ExecutionVictim_Unbow"; 
  } else { 
   _this select 0 switchMove "Acts_AidlPsitMstpSsurWnonDnon_out"; 
  }; 
   _complMessage = selectRandom ["I thought I was gonna die in here!","Thank you so much man.","I think I shit my pants...","Can I hug you?","I'M ALIVE.","Where the hell am I?"]; 
   ["Hostage", _complMessage] remoteExec ["BIS_fnc_showSubtitle"]; 
   sleep 5; 
   (_this select 0) enableAI "MOVE"; 
   (_this select 0) enableAI "AUTOTARGET"; 
   (_this select 0) enableAI "ANIM"; 
   (_this select 0) setBehaviour "SAFE"; 
   	[(_this select 0),(_this select 2)] remoteExec ["bis_fnc_holdActionRemove",[0,-2] select isDedicated,true]; 
  }, 
  { 
   _intrMessage = selectRandom ["Hey! I don't wanna die here!","Don't leave me here man! Please!","THEY'RE EATING PEOPLE. GET ME OUT OF HERE.","*Mumbles* Shit shit shit..."]; 
   ["Hostage", _intrMessage] remoteExec ["BIS_fnc_showSubtitle"]; 
  }, 
  [_animations], 
  3, 
  0, 
  true, 
  false 
] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true]; 
 
sleep (25 * 60); 
 
["Hostage Rescue", "The mission has now ended.", [1,0,0,1]] call SOR_fnc_showNotification; 
 
deleteMarker "hostageArea"; 
deleteMarker "hostageAreaEllipse"; 

sleep 2;
[] execVM "Functions\Missions\Hostage\fn_Hostageinit.sqf";

 

  • Like 1

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

×