Dewgle 0 Posted April 7, 2020 Hello o7 I have a JS_JC_FA18F and E variant that I've placed down in the 3den editor and I have set up a custom pylon loadout and livery texture. But I noticed that every time the jet respawns, it reverts back to a default livery and pylon loadout. I tried using this script, however when the jet respawns using this script, it respawns with the default livery and with empty pylons. And I don't know enough about scripting to figure out what's wrong or how to adapt this script to the John Spartan FA-18s. Any and all help would be greatly appreciated and thank you for your time. Share this post Link to post Share on other sites
TeTeT 1523 Posted April 7, 2020 Can you share your mission? Looking at your code in the init box might help to debug your problem. Share this post Link to post Share on other sites
Dewgle 0 Posted April 7, 2020 55 minutes ago, TeTeT said: Can you share your mission? Looking at your code in the init box might help to debug your problem. Thank you for the response! How would I share the mission? (this is my first time using the forums) Share this post Link to post Share on other sites
TeTeT 1523 Posted April 7, 2020 You could upload it to dropbox, google drive or alike. If these are not options, paste your open mission.sqm (make sure it's not binarized) on a pastebin site. Good luck. Share this post Link to post Share on other sites
Dewgle 0 Posted April 8, 2020 Mission.sqm Spoiler version=53; class EditorData { moveGridStep=1; angleGridStep=0.2617994; scaleGridStep=1; autoGroupingDist=10; toggles=1; class ItemIDProvider { nextID=6; }; class Camera { pos[]={1614.2931,21.887133,6851.8726}; dir[]={0.83556879,-0.54598558,-0.061301306}; up[]={0.5445292,0.83778536,-0.039949387}; aside[]={-0.073170036,-7.689232e-008,-0.99733555}; }; }; binarizationWanted=0; addons[]= { "A3_Characters_F", "JS_JC_FA18", "orbis_gpws", "A3_Modules_F_Multiplayer" }; class AddonsMetaData { class List { items=4; class Item0 { className="A3_Characters_F"; name="Arma 3 Alpha - Characters and Clothing"; author="Bohemia Interactive"; url="https://www.arma3.com"; }; class Item1 { className="JS_JC_FA18"; name="JS_JC_FA18"; author="F/A-18E/F Super Hornet Team"; }; class Item2 { className="orbis_gpws"; name="AWESome - GPWS"; author="Orbis2358"; }; class Item3 { className="A3_Modules_F"; name="Arma 3 Alpha - Scripted Modules"; author="Bohemia Interactive"; url="https://www.arma3.com"; }; }; }; randomSeed=15265955; class ScenarioData { author="McDewgle"; }; class Mission { class Intel { timeOfChanges=1800.0002; startWeather=0; startWind=0.1; startWaves=0.1; forecastWeather=0; forecastWind=0.1; forecastWaves=0.1; forecastLightnings=0.1; wavesForced=1; windForced=1; year=2035; day=28; hour=13; minute=37; startFogDecay=0.014; forecastFogDecay=0.014; }; class Entities { items=3; class Item0 { dataType="Group"; side="West"; class Entities { items=1; class Item0 { dataType="Object"; class PositionInfo { position[]={1637.109,5.0014391,6851.1509}; angles[]={0,1.6152498,0}; }; side="West"; flags=6; class Attributes { init="call{this addaction [""Detonate"", {jet setDamage 1}];}"; isPlayer=1; }; id=5; type="B_Soldier_A_F"; class CustomAttributes { class Attribute0 { property="ENH_HoldAction"; expression=" _value params ['_name','_iconIdle','_iconProgress','_conditionShow','_conditionProgress','_codeStart','_codeProgress','_codeCompletion','_codeInterrupt','_duration','_priority','_showUnconscious','_showWindow']; if (!is3DEN && {!(_name isEqualTo '')}) then { [ _this, _name, _iconIdle, _iconProgress, _conditionShow, _conditionProgress, compile _codeStart, compile _codeProgress, compile format ['%1 %2','[_this select 0,_this select 2] remoteExecCall [''removeAction'',0]; remoteExecCall ['''',_this select 0];',_codeCompletion], compile _codeInterrupt, nil, _duration, _priority, true, _showUnconscious, _showWindow ] remoteExecCall ['BIS_fnc_holdActionAdd',0,_this]; };"; class Value { class data { class type { type[]= { "ARRAY" }; }; class value { items=13; class Item0 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item1 { class data { class type { type[]= { "STRING" }; }; value="\a3\ui_f\data\igui\cfg\holdactions\holdaction_revive_ca.paa"; }; }; class Item2 { class data { class type { type[]= { "STRING" }; }; value="\a3\ui_f\data\igui\cfg\holdactions\holdaction_revive_ca.paa"; }; }; class Item3 { class data { class type { type[]= { "STRING" }; }; value="true"; }; }; class Item4 { class data { class type { type[]= { "STRING" }; }; value="true"; }; }; class Item5 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item6 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item7 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item8 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item9 { class data { class type { type[]= { "SCALAR" }; }; value=10; }; }; class Item10 { class data { class type { type[]= { "SCALAR" }; }; value=991; }; }; class Item11 { class data { class type { type[]= { "BOOL" }; }; value=0; }; }; class Item12 { class data { class type { type[]= { "BOOL" }; }; value=1; }; }; }; }; }; }; class Attribute1 { property="speaker"; expression="_this setspeaker _value;"; class Value { class data { class type { type[]= { "STRING" }; }; value="Male12ENG"; }; }; }; class Attribute2 { property="pitch"; expression="_this setpitch _value;"; class Value { class data { class type { type[]= { "SCALAR" }; }; value=1.04; }; }; }; nAttributes=3; }; }; }; class Attributes { }; id=0; }; class Item1 { dataType="Object"; class PositionInfo { position[]={1684.3635,7.3150058,6845.8467}; }; side="Empty"; flags=4; class Attributes { name="jet"; reportRemoteTargets=1; receiveRemoteTargets=1; reportOwnPosition=1; pylons="FIR_AIM9M_LAU115_P_2rnd_M;FIR_AIM9M_LAU115_P_2rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;FIR_GBU24A_P_1rnd_M;PylonMissile_1Rnd_GAA_missiles;js_m_fa18_wing_tank_x1;"; }; id=1; type="JS_JC_FA18F"; class CustomAttributes { class Attribute0 { property="ENH_HoldAction"; expression=" _value params ['_name','_iconIdle','_iconProgress','_conditionShow','_conditionProgress','_codeStart','_codeProgress','_codeCompletion','_codeInterrupt','_duration','_priority','_showUnconscious','_showWindow']; if (!is3DEN && {!(_name isEqualTo '')}) then { [ _this, _name, _iconIdle, _iconProgress, _conditionShow, _conditionProgress, compile _codeStart, compile _codeProgress, compile format ['%1 %2','[_this select 0,_this select 2] remoteExecCall [''removeAction'',0]; remoteExecCall ['''',_this select 0];',_codeCompletion], compile _codeInterrupt, nil, _duration, _priority, true, _showUnconscious, _showWindow ] remoteExecCall ['BIS_fnc_holdActionAdd',0,_this]; };"; class Value { class data { class type { type[]= { "ARRAY" }; }; class value { items=13; class Item0 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item1 { class data { class type { type[]= { "STRING" }; }; value="\a3\ui_f\data\igui\cfg\holdactions\holdaction_revive_ca.paa"; }; }; class Item2 { class data { class type { type[]= { "STRING" }; }; value="\a3\ui_f\data\igui\cfg\holdactions\holdaction_revive_ca.paa"; }; }; class Item3 { class data { class type { type[]= { "STRING" }; }; value="true"; }; }; class Item4 { class data { class type { type[]= { "STRING" }; }; value="true"; }; }; class Item5 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item6 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item7 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item8 { class data { class type { type[]= { "STRING" }; }; value=""; }; }; class Item9 { class data { class type { type[]= { "SCALAR" }; }; value=10; }; }; class Item10 { class data { class type { type[]= { "SCALAR" }; }; value=991; }; }; class Item11 { class data { class type { type[]= { "BOOL" }; }; value=0; }; }; class Item12 { class data { class type { type[]= { "BOOL" }; }; value=1; }; }; }; }; }; }; class Attribute1 { property="js_jc_fa18_complexStartup"; expression="_this setVariable ['js_jc_fa18_complexStartup', _value];"; class Value { class data { class type { type[]= { "BOOL" }; }; value=0; }; }; }; class Attribute2 { property="ttt_servicemenu"; expression="_this setVariable ['ServiceMenu', _value]; if (!_value) then { _this animate ['service_menu_switch', 1, true]; };"; class Value { class data { class type { type[]= { "BOOL" }; }; value=1; }; }; }; nAttributes=3; }; }; class Item2 { dataType="Logic"; class PositionInfo { position[]={1722.714,5,6844.0352}; }; init="call{[_this, 2] call RESPAWN_VEHICLE;}"; id=4; type="ModuleRespawnVehicle_F"; class CustomAttributes { class Attribute0 { property="ModuleRespawnVehicle_F_ForcedRespawn"; expression="_this setVariable ['ForcedRespawn',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value="0"; }; }; }; class Attribute1 { property="ModuleRespawnVehicle_F_Init"; expression="_this setVariable ['Init',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value=""; }; }; }; class Attribute2 { property="ModuleRespawnVehicle_F_RespawnWhenDisabled"; expression="_this setVariable ['RespawnWhenDisabled',_value,true];"; class Value { class data { class type { type[]= { "BOOL" }; }; value=0; }; }; }; class Attribute3 { property="ModuleRespawnVehicle_F_DesertedDistance"; expression="_this setVariable ['DesertedDistance',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value=""; }; }; }; class Attribute4 { property="ModuleRespawnVehicle_F_PositionType"; expression="_this setVariable ['PositionType',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value="0"; }; }; }; class Attribute5 { property="ModuleRespawnVehicle_F_RespawnCount"; expression="_this setVariable ['RespawnCount',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value=""; }; }; }; class Attribute6 { property="ModuleRespawnVehicle_F_Position"; expression="_this setVariable ['Position',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value="0"; }; }; }; class Attribute7 { property="ModuleRespawnVehicle_F_Wreck"; expression="_this setVariable ['Wreck',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value="2"; }; }; }; class Attribute8 { property="ModuleRespawnVehicle_F_Delay"; expression="_this setVariable ['Delay',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value=""; }; }; }; class Attribute9 { property="ModuleRespawnVehicle_F_ShowNotification"; expression="_this setVariable ['ShowNotification',_value,true];"; class Value { class data { class type { type[]= { "STRING" }; }; value="1"; }; }; }; nAttributes=10; }; }; }; class Connections { class LinkIDProvider { nextID=1; }; class Links { items=1; class Item0 { linkID=0; item0=4; item1=1; class CustomData { type="Sync"; }; }; }; }; }; init.sqf Spoiler RESPAWN_VEHICLE = { /* Function by OzDeaDMeaT Date: 22/11/2017 Usage: [_this, <Keep Vehicle Cargo>] call RESPAWN_VEHICLE; //This is to be placed in a Vehicle Respawn Module <Keep Vehicle Cargo> Options: 0 = Do Nothing with Cargo 1 = ClearCargo 2 = Load Dead Vehicles Cargo Back into New Vehicle Example1: [_this, 2] call RESPAWN_VEHICLE; //This Example will retain the old vehicles cargo and place it in the newly respawned vehicle */ private ["_veh", "_OLDveh", "_KeepCargo", "_txtr", "_LoadStuff", "_CargoMAGS", "_CargoWEAP", "_CargoITEM", "_CargoBKP", "_syncedObjects", "_lockedArray", "_lockVeh", "_CurrentpylonMAGs", "_pylonPaths", "_i", "_j", "_k", "_nonPylonWeapons" ]; _veh = (_this select 0) select 0; _OLDveh = (_this select 0) select 1; _KeepCargo = _this select 1; _CurrentpylonMAGs = getPylonMagazines _OLDveh; //Get old vehicle pylon mags _syncedObjects = synchronizedObjects _OLDveh; //Get the old vehicles synced objects _txtr = getObjectTextures _OLDveh; //Get old vehicle textures _OLDveh setpos [0,0,-9999]; ///START SYNCED OBJECTS //ZEUS_EDITABLE synchronizeObjectsAdd [_veh]; //{_x synchronizeObjectsAdd [_veh]} foreach _syncedObjects; //_veh synchronizeObjectsAdd _syncedObjects; //This syncs the old objects to the new vehicle ///END SYNCED OBJECTS ///START VEHICLE LOCK _lockedArray = ["UNLOCKED","DEFAULT","LOCKED","LOCKEDPLAYER"]; //This is needed to reset the vehicle lock _lockVeh = locked _OLDveh; _veh setVehicleLock (_lockedArray select _lockVeh); ///END VEHICLE LOCK ///START BLACK MAGIC FOR VEHICLE PYLONS _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _veh >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")}; //Gets pylon paths from Config _nonPylonWeapons = []; {_nonPylonWeapons append getArray (_x >> "weapons")} forEach ([_veh, configNull] call BIS_fnc_getTurrets); {_veh removeWeaponGlobal _x } forEach ((weapons _veh) - _nonPylonWeapons); if (count _pylonPaths != 0) then { for "_j" from 0 to ((count _pylonPaths) -1) do { _veh setPylonLoadOut [_j + 1, _CurrentpylonMAGs select _j, false, _pylonPaths select _j]; }; }; ///END BLACK MAGIC FOR VEHICLE PYLONS ///START VEHICLE TYPE SPECIFIC TWEAKS if(typeOf _veh == "B_Plane_Fighter_01_F") then {[_veh,"",["wing_fold_l",1]] call BIS_fnc_initVehicle}; //THIS WILL START THE JETS OFF WITH FOLDED WINGS if(typeOf _veh == "B_Plane_Fighter_01_Stealth_F") then {[_veh,"",["wing_fold_l",1]] call BIS_fnc_initVehicle}; //THIS WILL START THE JETS OFF WITH FOLDED WINGS ///END VEHICLE TYPE SPECIFIC TWEAKS ///START SET VEHICLE TEXTURE if !(isNil "_txtr") then { for "_k" from 0 to (count _txtr - 1) do { _veh setObjectTextureGlobal [_k, _txtr select _k]; }; }; ///END SET VEHICLE TEXTURE ///START VEHICLE CARGO _LoadStuff = { private["_crate","_array","_count","_i","_Job", "_arr1", "_arr2"]; //Usage [<object>, <Job>, <array>] call _LoadStuff _crate = _this select 0; //Object ClassNames are being loaded into _Job = _this select 1; //Options are "AMMO" , "WEAP" , "ITEM" , "BKP" _arr1 = (_this select 2) select 0; //ClassName _arr2 = (_this select 2) select 1; //Amount _count = count _arr1; if(_Job == "AMMO") then { for "_i" from 0 to (_count - 1) do { _crate addMagazineCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};}; if(_Job == "WEAP") then { for "_i" from 0 to (_count - 1) do { _crate addWeaponCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};}; if(_Job == "ITEM") then { for "_i" from 0 to (_count - 1) do { _crate addItemCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};}; if(_Job == "BKP") then { for "_i" from 0 to (_count - 1) do { _crate addBackpackCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};}; }; If (_KeepCargo != 0) then { clearMagazineCargoGlobal _veh; clearWeaponCargoGlobal _veh; clearItemCargoGlobal _veh; If (_KeepCargo == 2) then { _CargoMAGS = getMagazineCargo _OLDveh; [_veh,"AMMO",_CargoMAGS] call _LoadStuff; _CargoWEAP = getWeaponCargo _OLDveh; [_veh,"WEAP",_CargoWEAP] call _LoadStuff; _CargoITEM = getItemCargo _OLDveh; [_veh,"ITEM",_CargoITEM] call _LoadStuff; _CargoBKP = getBackpackCargo _OLDveh; [_veh,"BKP",_CargoBKP] call _LoadStuff; }; }; ///END VEHICLE CARGO deleteVehicle _OLDveh; }; Share this post Link to post Share on other sites
Dewgle 0 Posted April 9, 2020 My end goal is to disable the carrier service menu so that pilots will have to their aircraft manually serviced on the carrier deck. I set up ACE refuel, rearm and repair stations on the flight deck. But if the jet keeps reverting back to it's default loadout, I'll have to keep using the carrier service menu to reset my custom pylon loadout every time it respawns. Share this post Link to post Share on other sites
TeTeT 1523 Posted April 9, 2020 Only had a brief look at mission.sqm and init.sqf, I would think it looks ok. Maybe someone with experience with the respawn code can assist? Share this post Link to post Share on other sites