The Black Fox 4 Posted February 28, 2019 I'm using onPlayerRespawn.sqf to add custom loadouts to two different squads. It was working earlier, but I had to edit some things to enable spawning on currently alive units. I must have deleted something, because now I can spawn at first with my custom loadout, but when a unit dies and respawns, they have the inventory of the base unit placed with the editor. Like I said, I had it working before, but now neither onPlayerRespawn nor onPlayerKilled are being parsed. I checked both scripts for errors and I am getting an error in the editor: https://i.imgur.com/h97vPFw.png I believe I am missing one or two lines somewhere, I just don't remember where. Here's what I have (it's an edited version of Escape Malden) Here's Description.ext: respawn = 3; respawnDelay = 30; respawnOnStart = -1; respawnTemplates[] = {"MenuPosition", "MenuInventory", "Tickets", "Spectator"}; class Header { gameType = Escape; minPlayers = 1; maxPlayers = 13; }; dev = "ryardvalcon"; briefingName = $STR_A3_EscapeFromMalden_missionName; author = $STR_A3_Bohemia_Interactive; overviewPicture = "a3\Missions_F_Patrol\data\img\MP_EscapeFromMalden_overview_CA.paa"; overviewText = $STR_A3_EscapeFromMalden_overview; onLoadName = $STR_A3_EscapeFromMalden_onLoadName; onLoadMission = $STR_A3_EscapeFromMalden_overview; loadScreen = "a3\Missions_F_Patrol\data\img\MP_EscapeFromMalden_overview_CA.paa"; disabledAI = 0; // Custom, non-sandbox groups #include "CustomGroups.inc" class Params { class EnemyEquipment { title = $STR_A3_Escape_param_enemyEquipment; values[] = {0, 1}; texts[] = {$STR_A3_Escape_param_enemyEquipment01, $STR_A3_Escape_param_enemyEquipment02}; default = 1; file = "params\enemyEquipment.sqf"; }; class noOfRespawns { title = $STR_A3_rscdisplaydebriefing_loadstext_mp; values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; texts[] = {"0", $STR_A3_Escape_param_respawnGroup10, $STR_A3_Escape_param_respawnGroup20, $STR_A3_Escape_param_respawnGroup30, $STR_A3_Escape_param_respawnGroup40, $STR_A3_Escape_param_respawnGroup50, $STR_A3_Escape_param_respawnGroup100, $STR_A3_Escape_param_respawnIndividual01, $STR_A3_Escape_param_respawnIndividual02, $STR_A3_Escape_param_respawnIndividual03, $STR_A3_Escape_param_respawnIndividual04, $STR_A3_Escape_param_respawnIndividual05, $STR_A3_Escape_param_respawnIndividual10}; default = 3; file = "params\setRespawn.sqf"; }; class SpecialEvents { title = $STR_A3_Escape_param_enemySupports; values[] = {0, 1}; texts[] = {$STR_disabled, $STR_A3_Escape_param_enemySupportsOn}; default = 1; file = "params\setSpecialEvents.sqf"; }; class AllowCrewInImmobile { title = $STR_A3_Escape_param_fubar; values[] = {0, 1}; texts[] = {$STR_A3_Escape_param_fubarLeave, $STR_A3_Escape_param_fubarStay}; default = 1; file = "params\setCrewInImmobile.sqf"; }; class Fog { title = $STR_A3_Param_Fog_Title; values[] = {0,1,2}; texts[] = {$STR_A3_Param_Fog_0, $STR_A3_Param_Fog_1, $STR_A3_Param_Fog_2}; default = 0; file = "params\setFog.sqf"; }; #define DAYTIMEHOUR_DEFAULT 04 #define WEATHER_DEFAULT 50 #define DEBUGCONSOLE_DEFAULT 0 #define TIMEACCELERATION_DEFAULT 1 #define VIEW_DISTANCE_MIN 1000 #define VIEW_DISTANCE_MAX 12000 #define VIEW_DISTANCE_DEFAULT 2000 #include "\a3\functions_f\Params\paramDaytimeHour.inc" #include "\a3\functions_f\Params\paramWeather.inc" #include "\a3\functions_f\Params\paramDebugConsole.inc" #include "\a3\Functions_F_MP_Mark\Params\paramTimeAcceleration.inc" #include "\a3\Functions_F_Heli\Params\paramViewDistance.inc" #include "\a3\functions_f\params\paramRevive.inc" }; class CfgDebriefing { class End1 { title = $STR_A3_mission_completed_title; subtitle = ""; description = $STR_A3_EscapeFromMalden_end01Desc; }; class Loser: End1 { title = $STR_A3_mission_failed_title; description = $STR_A3_EscapeFromTanoa_end03Desc; subtitle = $STR_A3_EscapeFromTanoa_end03Sub; }; class End2: End1 { title = $STR_A3_mission_failed_title; description = $STR_A3_EscapeFromTanoa_end02Desc; subtitle = $STR_A3_EscapeFromTanoa_end02Sub; }; }; corpseManagerMode = 1; // Type of removed bodies: 0 - none, 1 - all, 2 - only respawnable, 3 - only non-respawnable corpseLimit = 24; // Max number of bodies which can be available at the same time. When exceeded, start deleting immediately. corpseRemovalMinTime = 300; // Minimal time in seconds a body stays in the scene (can't be removed sooner). corpseRemovalMaxTime = 360; // Maximal time in seconds after which a dead body is removed (can't stay longer). wreckManagerMode = 1; // Type of removed wrecks: 0 - none, 1 - all, 2 - only respawnable, 3 - only non-respawnable wreckLimit = 8; // Max number of wrecks which can be available at the same time. When exceeded, start deleting immediately. wreckRemovalMinTime = 300; // Minimal time in seconds a wreck stays in the scene (can't be removed sooner). wreckRemovalMaxTime = 360; // Maximal time in seconds after which a wreck is removed (can't stay longer). minPlayerDistance = 50; // Bodies and wrecks in this vicinity of players will not be deleted even if the timer/limit condition is met. class CfgSounds { sounds[] = {}; class DistantMortar { name = "Distant mortar fire"; sound[] = {"@A3\Sounds_F\arsenal\weapons_static\Mortar\Mortar82mm_distShot_01", 1, 1}; titles[] = {0,""}; }; class DistantHowitzer { name = "Distant howitzer fire"; sound[] = {"@A3\Sounds_F\arsenal\weapons_vehicles\cannon_155mm\CannonHeavy_distShot", 0.5, 1}; titles[] = {0,""}; }; }; class CfgFunctions { class BIS { class EscapeFromMalden { file = "Functions"; class EfM_ReconTeam {}; class EfM_SniperTeam {}; class EfM_HouseFind {}; class EfM_HousePopulate {}; class EfM_AmmoboxNATO {}; class EfM_AmmoboxCSAT {}; class EfM_AmmoboxSpecial {}; class EfM_LimitFAKs {}; class EfM_PopulateCheckpoint {}; class EfM_PopulatePost {}; class EfM_PopulateTower {}; class EfM_SpecialEvents {}; class EfM_SupplyboxCSAT {}; class EfM_SupplyboxNATO {}; class EfM_SniperBox {}; }; }; }; Here's OnPlayerRespawn: // Squad leader if (player isKindOf "O_Soldier_SL_F") then { [player] execVM "scripts\loadouts\SquadLeader.sqf"; }; // Marksman if (player isKindOf "O_Soldier_M_F") then { [player] execVM "scripts\loadouts\Marksman.sqf"; }; // Autorifleman if (player isKindOf "O_Soldier_AR_F") then { [player] execVM "scripts\loadouts\Autorifleman.sqf"; }; // Close quarters specialist if (player isKindOf "O_Recon_F") then { [player] execVM "scripts\loadouts\CloseQuarters.sqf"; }; // Anti-tank if (player isKindOf "O_Soldier_LAT_F") then { [player] execVM "scripts\loadouts\AntiTtank.sqf"; }; // Basic rifleman class if (player isKindOf "O_Soldier_F") then { [player] execVM "scripts\loadouts\BasicRifleman.sqf"; }; // Missile specialist if (player isKindOf "O_Soldier_AA_F") then { [player] execVM "scripts\loadouts\AntiAir.sqf"; }; // Engie if (player isKindOf "O_Engineer_F") then { [player] execVM "scripts\loadouts\Engineer.sqf"; }; // Medic if (player isKindOf "O_Medic_F") then { [player] execVM "scripts\loadouts\Medic.sqf"; }; // Heli Pilot if (player isKindOf BO_HeliPilot_F") then { [player] execVM "scripts\loadouts\HeliPilot.sqf"; }; // Heli Crew if (player isKindOf "O_HeliCrew_F") then { [player] execVM "scripts\loadouts\HeliCrew.sqf"; }; // Heli PT if (player isKindOf "O_Soldier_PG_F") then { [player] execVM "scripts\loadouts\ParaTrooper.sqf"; } Share this post Link to post Share on other sites
Maff 251 Posted February 28, 2019 It is very early in the morning here so I may have skipped your post a bit. The only thing that is jumping out at me is The missing semicolon at the bottom of your onPlayerRespawn.sqf. I have added it for you. // Heli PT if (player isKindOf "O_Soldier_PG_F") then { [player] execVM "scripts\loadouts\ParaTrooper.sqf"; }; Hope that sorts it for you. 1 Share this post Link to post Share on other sites
pierremgi 4935 Posted February 28, 2019 Perhaps, just missing some workable respawn positions. Check your respawn parameters/options. Share this post Link to post Share on other sites
The Black Fox 4 Posted February 28, 2019 On 2/28/2019 at 6:50 AM, Maff said: Hope that sorts it for you. Omg. That might be it. On 2/28/2019 at 2:36 PM, pierremgi said: Perhaps, just missing some workable respawn positions. No, I fixed respawn. That works as intended. Share this post Link to post Share on other sites
The Black Fox 4 Posted March 1, 2019 On 2/28/2019 at 6:50 AM, Maff said: It is very early in the morning here so I may have skipped your post a bit. The only thing that is jumping out at me is The missing semicolon at the bottom of your onPlayerRespawn.sqf. I have added it for you. // Heli PT if (player isKindOf "O_Soldier_PG_F") then { [player] execVM "scripts\loadouts\ParaTrooper.sqf"; }; Hope that sorts it for you. No, that didn't fix it, the files still aren't being parsed. Is there a way to set custom men as OPFOR? Cause I can save the current unit as a new entity but I'd like custom classes as well, is there a way to specify that they are OPFOR? Share this post Link to post Share on other sites
Maff 251 Posted March 1, 2019 (edited) On 3/1/2019 at 12:01 AM, The Black Fox said: No, that didn't fix it, the files still aren't being parsed. Is there a way to set custom men as OPFOR? Cause I can save the current unit as a new entity but I'd like custom classes as well, is there a way to specify that they are OPFOR? I'm not sure what you mean. You are using a custom script to add kit to only OPFOR players based on their classname. I can tell this from the classnames you have used. So if you wanted a player to get assigned the kit from "scripts\loadouts\\medic.sqf" that player would need to be "O_Medic_F" class. There are so many ways to assign kit to units... It is unreal. I've noticed another error in onPlayerRespawn.sqf: // Heli Pilot if (player isKindOf BO_HeliPilot_F") then { [player] execVM "scripts\loadouts\HeliPilot.sqf"; }; Change it to... // Heli Pilot if (player isKindOf "O_HeliPilot_F") then { [player] execVM "scripts\loadouts\HeliPilot.sqf"; }; If that doesn't solve it for you, feel free to send a link to your mission and I can look it over for you. Added question: Are you only using this script in onPlayerRespawn.sqf? I only ask because I see in your description.ext that you have: respawnOnStart = -1; This means "Dont respawn on start. Don't run respawn script on start." which would mean your kit won't be assigned to any player until they have died and respawned. Edited March 1, 2019 by Maff Added Question/Information Share this post Link to post Share on other sites
The Black Fox 4 Posted March 1, 2019 On 3/1/2019 at 1:53 AM, Maff said: I've noticed another error in onPlayerRespawn.sqf: That's already been fixed. Not sure how that B got in there. On 3/1/2019 at 1:53 AM, Maff said: This means "Dont respawn on start. Don't run respawn script on start." which would mean your kit won't be assigned to any player until they have died and respawned. Well, I've already edited the starting loadout so they start with that equipment. Is the respawn equipment overridden if respawn is enabled at start? Share this post Link to post Share on other sites
Maff 251 Posted March 1, 2019 On 3/1/2019 at 4:46 AM, The Black Fox said: Is the respawn equipment overridden if respawn is enabled at start? No. Always worth a quick check though... Just in case. Share this post Link to post Share on other sites
The Black Fox 4 Posted March 1, 2019 On 3/1/2019 at 4:59 AM, Maff said: No. Always worth a quick check though... Just in case. Right, so it still doesn't work, but I found out why OnPlayerRespawn wasn't working. It is. However, my sqf for setting inventory seem to have some stupid error, even though I haven't actually edited them since the last time they worked. Share this post Link to post Share on other sites