Desrat 0 Posted August 24, 2011 Hi all, having some strange issues with the moveInCargo command in Arrowhead (standalone), I've posted my init.sqf below where the offending code is placed. Basically all I wanna do is spawn a blackhawk - and move the crew and all players aboard (mix of players and AI) Now the code I posted just does not seem to work - all AI gets moved as do I as the server/host but not all other MP players get moved (some do some don't and there's no specific pattern I can discern) and I dont understand why. Anyone have any ideas what I'm doing wrong here? init.sqf ///////////////////////////////////////////////////// // GLOBAL SECTION //disable saving enableSaving [false, false]; //disable conversations player setVariable ["BIS_noCoreConversations", true]; //exec briefing execVM "briefing.sqf"; //wait till functions module has init waitUntil{!(isNil "BIS_MPF_InitDone")}; //create crossroad for side chat PAPABEAR=[West,"HQ"]; //compile UPSMON functions call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf"; ///////////////////////////////////////////////////// // Server only if(isServer) then { //compile shk_pos call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; //create a new Blackhawk named BH1 _veh = "UH60M_EP1" createVehicle (getMarkerPos "1"); _veh setVehicleInit "BH1 = this;"; processInitCommands; //move flight crew into new blackhawk p1 moveInDriver BH1; // pilot p2 moveInTurret [bH1,[1]]; // co-pilot p3 moveInTurret [bH1,[0]]; // Crew Chief //get array of playable units _PlayrUnits = playableUnits; //move all playable into BH1 {_x moveInCargo BH1} forEach _PlayrUnits; }; ///////////////////////////////////////////////////// // Local Player Only if (local player) then { // public Vars createtask2 = false; createtask3 = false; "createtask2" addPublicVariableEventHandler { (code not relavant) }; "createtask3" addPublicVariableEventHandler { (code not relevant) }; waitUntil{!isNull player}; playMusic "intro"; 15 fadeSound 1; }; Share this post Link to post Share on other sites
st_dux 26 Posted August 24, 2011 Put all of the moveInDriver, etc. stuff in the global section of your init. Share this post Link to post Share on other sites
Desrat 0 Posted August 24, 2011 Put all of the moveInDriver, etc. stuff in the global section of your init. made no difference at all unfortunately init.sqf //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Server or local host only /////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(isServer) then { call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _veh = createVehicle ["UH60M_EP1", (getMarkerPos "1"), [], 0, "FLY"]; _veh setVehicleInit "BH1 = this;"; processInitCommands; p1 moveInDriver BH1; // pilot p2 moveInTurret [bH1,[1]]; // co-pilot p3 moveInTurret [bH1,[0]]; // Crew Chief }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // GLOBAL SECTION ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //disable saving enableSaving [false, false]; //disable conversations player setVariable ["BIS_noCoreConversations", true]; execVM "briefing.sqf"; //initialise scripts - wait till functions module has init waitUntil{!(isNil "BIS_MPF_InitDone")}; PAPABEAR=[West,"HQ"]; call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf"; _PlayrUnits = playableUnits; {_x assignAsCargo BH1;_x moveInCargo BH1} forEach _PlayrUnits; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Local Player Only /////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (local player) then { player moveInCargo BH1; waitUntil{!isNull player}; //disable conversations player setVariable ["BIS_noCoreConversations", true]; playMusic "intro"; cutText ["BlackHawk Down by [VOWS]_Desrat\n\nVersion 1.0 - 20/08/2011\n\nWe are recruiting @ www.vowsclan.net", "BLACK FADED"]; 15 fadeSound 1; sleep 10; titleCut ["", "BLACK IN", 5]; }; Share this post Link to post Share on other sites
cobra4v320 27 Posted August 25, 2011 (edited) This works on hosted and dedicated. Dont forget your marker 1. This will not place playableunits into the helicopter if you are in the editor!!! // Server or local host only if (isServer) then { _veh = createVehicle ["UH60M_EP1", (getMarkerPos "1"), [], 0, "FLY"]; _veh setVehicleInit "BH1 = this;"; processInitCommands; p1 moveInDriver BH1; // pilot p2 moveInTurret [bH1,[1]]; // co-pilot p3 moveInTurret [bH1,[0]]; // Crew Chief }; {_x assignAsCargo BH1; _x moveInCargo BH1} forEach playableUnits; // Local Player Only if (local player) then { waitUntil {!isNull player}; player moveInCargo BH1; player setVariable ["BIS_noCoreConversations", true]; cutText ["BlackHawk Down by [VOWS]_Desrat\n\nVersion 1.0 - 20/08/2011\n\nWe are recruiting @ www.vowsclan.net", "BLACK FADED"]; sleep 10; titleCut ["", "BLACK IN", 5]; }; Edited August 25, 2011 by cobra4v320 Share this post Link to post Share on other sites
Desrat 0 Posted August 25, 2011 still didn't work until I moved the foreach loop after the titles section...seems to work now though although Ive only tested once.. // server or local host only if (isServer) then { call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; }; // Local Player Only if (local player) then { waitUntil {!isNull player}; player moveInCargo BH1; player setVariable ["BIS_noCoreConversations", true]; playMusic "intro"; cutText ["BlackHawk Down by [VOWS]_Desrat\n\nVersion 1.0 - 20/08/2011\n\nWe are recruiting @ www.vowsclan.net", "BLACK FADED"]; sleep 10; titleCut ["", "BLACK IN", 5]; {[_x,10,time,false,false] spawn BIS_Effects_Burn} forEach [t1,t2,t3,t4,t5,t6,t7]; execVM "public_vars.sqf"; }; {_x assignAsCargo BH1; _x moveInCargo BH1} forEach playableUnits; //initialise scripts - wait till functions module has init waitUntil{!(isNil "BIS_MPF_InitDone")}; //disable saving enableSaving [false, false]; //disable conversations player setVariable ["BIS_noCoreConversations", true]; execVM "briefing.sqf"; PAPABEAR=[West,"HQ"]; call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf"; Share this post Link to post Share on other sites