Axek/Axyl 2 Posted February 28, 2013 (edited) Hey Everyone, In our squad, we wanted to have a way to have our assets persist from mission to mission as part of a campaign. So I wrote the following and thought it right to share with all... This extension and accompanying SQF code lets you save the position, attributes and contents of specifically named objects and vehicles to a text file. When the mission next runs, that saved data will update the objects so they are as they were when the mission last shutdown. It requires ACE as that's what we use in our group. It saves the weapons, ammunition and ACE contents of the vehicles and objects...and will save R3F Logistics objects soon too. As it stands at the moment, it only saves objects that start with the designated prefix. (By default, that's poe_) So other vehicles and objects in the mission aren't affected. i.e. If you're using MCC or VTS for the OPFOR, then they won't be included. API Documentation is here. The download of version one, including the extension, SQF API Code and two sample missions is here. The one sample is made for running in the editor. The other is made for running on a dedicated server (and uses DACs to run the enemy). You normally only need the extension installed on your server, not on each client, as none of the SQF should run on the client. The extension is a native dll, rather than a managed version. So it doesn't require any frameworks, runtimes etc. (Written in Delphi - happy to share source.) Sample content from the dedicated server sample mission is below. You could copy this data to your local saved file and the next time you run the mission, the objects and vehicles will have these attributes. ["ammoBox","poe_tyre","ACE_Spare_Tyre_HD",[1.86265e-009,-3.72529e-009,-0.0933496],244.737,1,0,[[],[]],[[],[]]] ["ammoBox","poe_ammo_launchers","ACE_MagazineBox_Launchers_USMC",[3167.75,4056.94,0],345.874,1,0,[["M136","ACE_M136_CSRS","ACE_M72A2","Javelin"],[14,16,16,16]],[["Stinger","ACE_SMAW_NE","SMAW_HEAA","SMAW_HEDP","ACE_SMAW_Spotting"],[16,16,16,16,16]]] ["ammoBox","poe_ammo","ACE_MagazineBox_USMC",[3171.54,4057.85,0],345.874,1,0,[[],[]],[["15Rnd_9x19_M9","15Rnd_9x19_M9SD","100Rnd_556x45_BetaCMag","20Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_StanagSD","ACE_30Rnd_556x45_SB_Stanag","ACE_30Rnd_556x45_T_Stanag","1Rnd_HE_M203","FlareWhite_M203","FlareGreen_M203","FlareRed_M203","FlareYellow_M203","1Rnd_Smoke_M203","1Rnd_SmokeRed_M203","1Rnd_SmokeGreen_M203","1Rnd_SmokeYellow_M203","ACE_1Rnd_HE_M203","ACE_1Rnd_PR_M203","ACE_FlareIR_M203","ACE_SSWhite_M203","ACE_SSGreen_M203","ACE_SSRed_M203","ACE_SSYellow_M203","ACE_1Rnd_CS_M203","ACE_HuntIR_M203","5Rnd_762x51_M24","ACE_5Rnd_762x51_T_M24","100Rnd_762x51_M240","100Rnd_556x45_M249","200Rnd_556x45_L110A1","200Rnd_556x45_M249","ACE_100Rnd_556x45_T_M249","ACE_200Rnd_556x45_T_M249","30Rnd_9x19_MP5","30Rnd_9x19_MP5SD","30Rnd_556x45_G36","30Rnd_556x45_G36SD","ACE_30Rnd_556x45_T_G36","7Rnd_45ACP_1911","ACE_20Rnd_762x51_B_M14","20Rnd_762x51_DMR","ACE_20Rnd_762x51_T_DMR","8Rnd_B_Beneli_74Slug","8Rnd_B_Beneli_Pellets","10Rnd_127x99_m107","ACE_10Rnd_127x99_Raufoss_m107","ACE_10Rnd_127x99_T_m107","ACE_25Rnd_1143x23_B_UMP45","ACE_30Rnd_6x35_B_PDW","30Rnd_9x19_UZI","30Rnd_9x19_UZI_SD","6Rnd_45ACP","17Rnd_9x19_glock17","ACE_33Rnd_9x19_G18","30Rnd_762x39_SA58","ACE_30Rnd_762x39_T_SA58","6Rnd_HE_M203","6Rnd_FlareWhite_M203","6Rnd_FlareGreen_M203","6Rnd_FlareRed_M203","6Rnd_FlareYellow_M203","6Rnd_Smoke_M203","6Rnd_SmokeRed_M203","6Rnd_SmokeGreen_M203","6Rnd_SmokeYellow_M203","20Rnd_762x51_B_SCAR","ACE_20Rnd_762x51_S_SCAR","ACE_20Rnd_762x51_SB_M110","ACE_20Rnd_762x51_T_M110","20Rnd_762x51_SB_SCAR","ACE_20Rnd_762x51_T_SCAR","ACE_12Rnd_45ACP_USP","ACE_15Rnd_9x19_P8","ACE_15Rnd_9x19_P226","ACE_20Rnd_762x51_B_HK417","ACE_20Rnd_762x51_SB_HK417","ACE_20Rnd_762x51_T_HK417","ACE_20Rnd_762x51_B_G3","ACE_20Rnd_762x51_T_G3","ACE_5Rnd_25x59_HEDP_Barrett","ACE_5Rnd_127x99_B_TAC50","ACE_5Rnd_127x99_T_TAC50","Laserbatteries","ACE_Bandage","ACE_LargeBandage","ACE_Bodybag","ACE_Epinephrine","ACE_Medkit","ACE_Morphine","ACE_BBETTY_M","AC ["ammoBox","poe_tyre_3","ACE_Spare_Tyre_HD",[3171.21,4060.59,0.00527573],0,1,0,[[],[]],[[],[]]] ["ammoBox","poe_tyre_1","ACE_Spare_Tyre_HD",[3167.68,4059.54,0],0,1,0,[[],[]],[[],[]]] ["ammoBox","poe_tyre_2","ACE_Spare_Tyre_HD",[3169.63,4060.23,0.00146484],0,1,0,[[],[]],[[],[]]] ["ammoBox","poe_ammo_medic","ACE_BandageBoxWest",[3236.14,4075.2,0.0195885],164.69,1,0,[[],[]],[["ACE_Bandage","ACE_LargeBandage","ACE_Tourniquet","ACE_Morphine","ACE_Epinephrine","ACE_Medkit"],[30,15,30,30,30,15]]] ["vehicle","poe_hmmwv","HMMWV_M2",[3159.64,4056.86,-0.000377655],166.237,1,0,[["M249","M136"],[1,1]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen","200Rnd_556x45_M249"],[1,2,2,4]],["poe_tyre"],[]] ["vehicle","poe_hmmwv_1","HMMWV_M2",[3151.55,4055.12,-0.000377655],166.237,1,0,[[],[]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen"],[1,2,2]],[],[]] ["vehicle","poe_lav","LAV25",[3237.56,4078.01,0.0375977],24.3562,0.995974,0,[[],[]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen"],[1,2,2]],[],[]] ["vehicle","poe_fueltruck","MtvrRefuel",[3201.77,4059.46,0.159618],88.5554,0.999166,0,[[],[]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen"],[1,2,2]],[],[]] ["vehicle","poe_ammotruck","MtvrReammo",[3165.01,4024.24,0],333.681,1,0,[[],[]],[["30Rnd_556x45_Stanag","200Rnd_556x45_M249","HandGrenade_East","5Rnd_762x51_M24","15Rnd_9x19_M9","10Rnd_127x99_m107","M136","1Rnd_HE_M203","FlareWhite_M203","FlareGreen_M203","FlareRed_M203","FlareYellow_M203","SmokeShell","SmokeShellRed","SmokeShellGreen"],[30,5,10,10,15,10,3,3,3,3,3,3,3,3,3]],[],[]] ["vehicle","poe_repairtruck","MtvrRepair",[3168.5,4025.92,0],333.681,1,0,[[],[]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen"],[1,2,2]],[],[]] ["vehicle","poe_hmmwv_1_1","HMMWV_M2",[3148.75,4033.07,-0.000366211],249.327,0.999105,0,[[],[]],[["ACE_Rope_TOW_M_5","SmokeShell","SmokeShellGreen"],[1,2,2]],[],[]] ["vehicle","poe_helo","UH60M_EP1",[3229.67,4412.98,-2.36289],346.032,0.9896,1,[[],[]],[[],[]],[],[]] Feedback Appreciated! Thanks to JMan of PDB for the initial inspiration. Edited February 28, 2013 by Axek Linking JMan's PDB Scripts. 1 Share this post Link to post Share on other sites
Rhodesy77 11 Posted February 28, 2013 Again mate good work, looking forward to see this grow. Share this post Link to post Share on other sites