Jump to content
Cockheaven

MP mission Player respawns and JIP Broken

Recommended Posts

I've been building a mission for the better part of a week now and I have everything working the way I want it, triggers are firing spawning AI, scripts are executing blowing players up its quite lovely. However with everything kicking off and running well (or at least running) I cannot get my spawn system to work properly, mission specifics in spoilers.

 

Spoiler

In the editor under "Attributes" > "Multiplayer" I have Gametype: Undefined game mode  Min players: 0 Max players: 0 EnableAI: 1 Respawn: Respawn on custom position

Show respawn counter: 1 Show scoreboard: 1 Allow manual respawn: 1 

Spoiler

I have a respawn module down with a variable name "respawn_west" name "Barracks" type "infantry" side "BLUFOR" Show to "Only the side" Notification "enabled"

My description.ext

Spoiler

respawn = 3;
respawndelay = 5;
disabledAI = true;
respawnOnStart=-1;

enableDebugConsole = 1;
allowFunctionsLog = 0;


briefingName =  "[56RD] Training Facility";
overviewText = "[56RD] Training Facility";
overviewPicture = "56RDFlag.paa";
author = "Cockheaven";
onLoadName = "[56RD] Training Facility";
onLoadMission = "[56RD] Training Facility";
loadScreen = "56RDFlag.paa";

My init

Spoiler

// JIP Check (This code should be placed first line of init.sqf file)
if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};


enableSaving [ false, false ];
if (isServer) then {

_clearBodies = [] spawn {

while {true} do {

{
deleteVehicle _x;
sleep 0.01;
} forEach allDeadMen;

sleep 10;

};
};

Some example scripts

Spoiler

if(!isServer)exitWith{
_myunitarray = ["O_MORTAR_01_F"];
_veh = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_1";
_veh setDir 180;
createVehicleCrew _veh;
_veh3 = selectrandom _myunitarray createVehicle getMarkerPos "MORTAR1_3";
createVehicleCrew _veh3;
_veh3 setDir 270;
_veh4 = selectrandom _myunitarray createVehicle getMarkerPos "MORTAR1_4";
createVehicleCrew _veh4;
_veh4 setDir 90;
_veh5 = selectrandom _myunitarray createVehicle getMarkerPos "MORTAR1_5";
createVehicleCrew _veh5;
_veh5 setDir 0;
_veh6 = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_6";
createVehicleCrew _veh6;
_veh6 setDir 120;
_veh2 = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_2";
createVehicleCrew _veh2;
_veh2 setDir 80;
_veh7 = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_7";
createVehicleCrew _veh7;
_veh7 setDir 330;
_veh8 = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_8";
createVehicleCrew _veh8;
_veh8 setDir 45;
_veh9 = selectRandom _myunitarray createVehicle getMarkerPos "MORTAR1_9";
createVehicleCrew _veh9;
_veh9 setDir 135;

 {_veh addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh;
 {_veh2 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh2;
 {_veh3 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh3;
 {_veh4 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh4;
 {_veh5 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh5;
 {_veh6 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh6;
 {_veh7 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh7;
 {_veh8 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh8;
 {_veh9 addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]} forEach units _veh9;

    _veh commandArtilleryFire [
    markerpos "MORTARTARGET1_1",
    getArtilleryAmmo [_veh] select 0,999
    ];
    _veh2 commandArtilleryFire [
    markerpos "MORTARTARGET1_2",
    getArtilleryAmmo [_veh2] select 0,999
    ];
    _veh3 commandArtilleryFire [
    markerpos "MORTARTARGET1_3",
    getArtilleryAmmo [_veh3] select 0,999
    ];
    _veh4 commandArtilleryFire [
    markerpos "MORTARTARGET1_4",
    getArtilleryAmmo [_veh4] select 0,999
    ];
    _veh5 commandArtilleryFire [
    markerpos "MORTARTARGET1_5",
    getArtilleryAmmo [_veh5] select 0,999
    ];
    _veh6 commandArtilleryFire [
    markerpos "MORTARTARGET1_6",
    getArtilleryAmmo [_veh6] select 0,999
    ];
    _veh7 commandArtilleryFire [
    markerpos "MORTARTARGET1_7",
    getArtilleryAmmo [_veh7] select 0,999
    ];
    _veh8 commandArtilleryFire [
    markerpos "MORTARTARGET1_8",
    getArtilleryAmmo [_veh8] select 0,999
    ];
    _veh9 commandArtilleryFire [
    markerpos "MORTARTARGET1_9",
    getArtilleryAmmo [_veh9] select 0,999
    ];
};

    /*[_veh, getMarkerPos "MORTARTARGET1_1"] call bis_fnc_taskAttack;
    [_veh2, getMarkerPos "MORTARTARGET1_2"] call bis_fnc_taskAttack;
    [_veh3, getMarkerPos "MORTARTARGET1_3"] call bis_fnc_taskAttack;
    [_veh4, getMarkerPos "MORTARTARGET1_4"] call bis_fnc_taskAttack;
    [_veh5, getMarkerPos "MORTARTARGET1_5"] call bis_fnc_taskAttack;
    [_veh6, getMarkerPos "MORTARTARGET1_6"] call bis_fnc_taskAttack;
    [_veh7, getMarkerPos "MORTARTARGET1_7"] call bis_fnc_taskAttack;
    [_veh8, getMarkerPos "MORTARTARGET1_8"] call bis_fnc_taskAttack;

Spoiler

if ((vehicle player isKindOf "LandVehicle")) then //determine player is driving a vehicle
 {
  bomb = "APERSTripMine_Wire_Ammo" createVehicle ((driver (vehicle player)) modelToWorld [0,0,-.5]); // create mine relative to SQUISHY HUMON Driver
  bomb setdamage 1;          // DETONATE THE MINE!
  vehicle player setHit ["wheel_2_1_steering", 1];  // Disable vehicle wheel (front right)
  vehicle player setHit ["motor", 1];     // Disable vehicle motor (engine)
  execVM "IEDAmbush.sqf"; // run iedambush script
 };
 

Spoiler

if(!isServer)exitWith{
_markers = allMapMarkers select {toUpper _x find "SHAI" >= 0};
_side = east;
_myunitarray = ["C_Scientist_F","C_man_utilityworker_01_F","C_Journalist_01_war_F","C_Man_p_beggar_F","C_Scientist_F","C_man_utilityworker_01_F","C_Journalist_01_war_F","C_Man_p_beggar_F","C_Man_Polo_1_F","C_Man_Casual_1_F","C_Man_Shorts_1_F","CFP_O_ANSARALLAH_Rifleman_01","CFP_O_ANSARALLAH_Rifleman_01","CFP_O_ANSARALLAH_Rifleman_01","CFP_O_ANSARALLAH_Grenadier_01","CFP_O_ANSARALLAH_Grenadier_01","CFP_O_ANSARALLAH_Grenadier_01","CFP_O_ALQAEDA_Rifleman_01","CFP_O_ALQAEDA_Rifleman_01","CFP_O_ALQAEDA_Rifleman_01","CFP_O_ALQAEDA_Grenadier_01","CFP_O_ALQAEDA_Grenadier_01","CFP_O_ALQAEDA_Grenadier_01","CFP_O_BH_Rifleman_AK74_01","CFP_O_BH_Rifleman_AK74_01","CFP_O_BH_Rifleman_AK74_01","CFP_O_BH_Grenadier_AK74_01","CFP_O_BH_Grenadier_AK74_01","CFP_O_BH_Grenadier_AK74_01","O_G_Soldier_F","O_G_Soldier_F","O_G_Soldier_F","O_G_Soldier_GL_F","O_G_Soldier_GL_F","O_G_Soldier_GL_F","O_G_Soldier_F"];
_spawnedGroups = [];

{
 _grp = [getmarkerpos _x, _side, [selectRandom _myunitarray],[],[],[],[],[],180] call BIS_Fnc_spawnGroup;
 _spawnedGroups pushBack _grp;//in case you want to access all spawned groups
 {_x disableAI "PATH"} forEach units _grp;
} forEach _markers;
_spawnedGroups
};

Any help is greatly appreciated, I'm kind of swimming in it right now and I haven't a clue what to try next...

This mission is running on a dedicated server.

Edited by Cockheaven
More specifics

Share this post


Link to post
Share on other sites

Okay, so I fixed the respawning its working fine now with a selectable respawn location. JIP is still not working though =(

Edited by Cockheaven

Share this post


Link to post
Share on other sites

Update
I copied the mission folder and renamed it, deleted all scripts in the folder and ran the mission on the server. JIP still not working so I believe I have narrowed it down to an asset on the map. Is there something specific I should look for?

Thanks!

Share this post


Link to post
Share on other sites

Perhaps, you could obtain more help if you upload a mission folder and explain in which way "JIP is not working". Right now, I opened/closed your spoiler and pass to something else.

"if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};" What for? You don't use it.

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

Perhaps, you could obtain more help if you upload a mission folder and explain in which way "JIP is not working". Right now, I opened/closed your spoiler and pass to something else.

"if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};" What for? You don't use it.

Thanks for the reply, as for this If statement I just saw it in another forum and it fixed what looked like a similar issue so I threw it in.
I'll upload the mission folder. Re: "JIP is not working", When I launch the mission on my server every player who starts in the lobby in a playable slot when the mission is launched is able to load in and play, however when the mission is in progress players get stuck at a loading screen, they can hear in game sounds but do not pass this load screen.

 

Here is the mission folder
https://drive.google.com/file/d/1aM1Akijw4xTDRQMqRg8CIfb4Mybkp6Y1/view?usp=sharing

Share this post


Link to post
Share on other sites

Will have a look later. As far as I can see quickly, there are some useless lines of code but nothing hurt.

Share this post


Link to post
Share on other sites

Hmm. I hope someone can help. I dislike the idea to load all these mods to check if the mission runs.

 

  • Like 1

Share this post


Link to post
Share on other sites

Did you try something in vanilla mod? (just for the start of your mission and JIP check).

Share this post


Link to post
Share on other sites

Uhm...

if(!isServer)exitWith{ // if NOT server then do stuff...
// This will result in everything being created on every connected machine

You have all your spawn code in there? Remove everything out of the if statement and at top of file put:

if (!isServer) exitWith {};

No need for that JIP part either. Use initPlayerLocal.sqf file instead.

https://community.bistudio.com/wiki/Event_Scripts

_didJIP

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the reply @HazJ.

I applied the things you said and still no luck.

I also made a vanilla version of the map and the issue still exists, you can download it here https://drive.google.com/file/d/16XGy6VvlzxnWlVwrDX3PZ3706Zf2Urea/view?usp=sharing

I've gone through deleting every script so that only the mission.sqm exists and the issue still persisted, then I went through each area of the map deleting assets and got to the point where all I had was the players and a respawn module and the issue still existed.

This is running on a dedicated host.

Edited by Cockheaven

Share this post


Link to post
Share on other sites

What is the issue? In more detail... Spawning of?

Share this post


Link to post
Share on other sites

Okay so I load the mission on the server and take a slot from the lobby and launch the map.

I load into the map and select a spawn location and spawn in.

I throw a smoke grenade to allow stuff to load and give some idle time.

I hit "esc" and respawn, selecting the same original spawn location and see my smoke grenade going off.

I hit "esc" > "Abort" and I am back in the lobby.

I select another role (Or the same role) and I begin to load the mission.

I get stuck hearing waves and a seagull while staring at a full load bar and some interesting facts about Malden.

Share this post


Link to post
Share on other sites

BIS respawn? Does this happen with just .sqm and .ext files?

Share this post


Link to post
Share on other sites

Yah its the Eden BIS respawn module.

It happens with just mission.sqm being in the folder, nothing else not even textures.

Share this post


Link to post
Share on other sites

Not sure. Use -showScriptErrors to reveal errors, etc... I don't use modules. I use plain SQF for mostly everything, except units and 4 respawn markers.

Share this post


Link to post
Share on other sites

What code? I added you on Steam for more direct help. Easier.

Share this post


Link to post
Share on other sites

So, I have a lot of objects that have some stuff in their init like

Spoiler

BarracksTele1 addaction ["Teleport to Armor pool", {_this select 1 setpos getpos ARMOR;}];
BarracksTele1 addaction ["Teleport to Artilery pool", {_this select 1 setpos getpos Artillery;}];
BarracksTele1 addaction ["Teleport to Attack Helicopter", {_this select 1 setpos getpos AttackHelo;}];
BarracksTele1 addaction ["Teleport to CAS Jet Hangar", {_this select 1 setpos getpos CASJet;}];
BarracksTele1 addaction ["Teleport to Fighter Jet Hangar", {_this select 1 setpos getpos FighterJet;}];
BarracksTele1 addaction ["Teleport to Shoot House", {_this select 1 setpos getpos ShootHouse;}];
BarracksTele1 addaction ["Teleport to Fixed Wing Transport", {_this select 1 setpos getpos TransportFixedWing;}];
BarracksTele1 addaction ["Teleport to Ground Transport", {_this select 1 setpos getpos TransportGround;}];
BarracksTele1 addaction ["Teleport to Helicopter Transport", {_this select 1 setpos getpos TransportHelo;}];
BarracksTele1 addaction ["Teleport to VTOL Transport", {_this select 1 setpos getpos TransportVTOL;}];
BarracksTele1 addaction ["Teleport to Infantry Assault", {_this select 1 setpos getpos InfantryAssault;}];
BarracksTele1 addaction ["Teleport to Beach", {_this select 1 setpos getpos MAN_Beach;}];
 

Is this my problem?

Share this post


Link to post
Share on other sites

No. Did you try everything I mentioned on Steam? You have a shit ton of mods running so it is probably one of them. I made you a basic example mission with 4 units and 4 markers (one of each per side). It worked fine for me and for you in your server (vanilla). What mods are you running? Did you take away the init codes and just use respawn with mods? Etc... Try taking mods off, start with 1then so on, so fourth...

https://hazjohnson.com/ArmA/respawnExample.VR.zip

  • Like 1

Share this post


Link to post
Share on other sites

I'll give that a shot. Here I was thinking that I had already done that, I had "vaniallaized" the mission but I never striped the server launch parameters of mods. Your mission did work however, mods loaded and vanilla.

Share this post


Link to post
Share on other sites

Then it is something in your mission. Somewhere. Though, my example had vanilla stuff only and nothing else but 4 units and 4 markers. It was also on VR, not Malden.

Share this post


Link to post
Share on other sites

You have a bunch of modules. You can proceed step by step. That means rewrite your mission. You can let the objects (base, vehicles, units), but procced step by step with your modules. Start with respawn stuff. This should work. You ddn't answer me if it's mandatory to respawn on start. I always disable that (see PM answer). Then your teleportation system. (It seems to me there is a little problem with the texture of your stands. Use setObjectTextureGlobal from server only). Then, your enemy spawning code. Finish by the civ ambient and all your modules.

You should find some problem in a step or another.

  • Like 1

Share this post


Link to post
Share on other sites

Okay, @HazJ I setup the server to run a vanilla mission, and uploaded the vanilla version of my mission, then I started the mission spawned in checked a few scripts and teleporters (they worked) then I aborted and rejoined and this happened


@pierremgiI will disable respawn on start, aswell as rebuild the scenario as that is the last thing I have not done. 

 

Thank you both for the help!

Edited by Cockheaven
imgur

Share this post


Link to post
Share on other sites

What is your respawn type set to?

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

×