Jump to content
Kupla

Fix no tasks on respawn

Recommended Posts

Fixed: After respawn in MP, player's tasks, diary content and skills are transferred to the new entity

It should work but it doesn't. Group respawn kills it. It works perfectly well alone, but as soon as someone joins the server, BAM no tasks on respawn. I've tried nearly everything between the heaven and earth but nothing seems to work, only found a solution which creates double tasks on respawn.

I consider the editor and playing your own missions the most appealing part of the game and this is simply preventing me from doing that. I no longer want to create 'taskless' missions as I wish to progress in the editor and tasks are really a 'must have' for every mission. After a month's break from Arma 2, I've come back to look for a solution as I feel like creating missions again. Any ideas are welcome.

And btw, don't tell me to try another respawn type, because I don't want people to miraculously respawn to another location, nor playing singleplayer, because there is no point in it. (Who would want to play this game alone?)

So please, BIS, fix this in the next patch!

Thankyou

rant over

Share this post


Link to post
Share on other sites

Please make a ticket at the A2 CIT.

Repro steps and missions. That will give you a high(er) chance

to get it fixed.

Share this post


Link to post
Share on other sites

It works perfectly fine. The reason your TeamSwitch respawn doesn't work is because you're initilizing the tasks via the init.sqf which is run by every player connecting to the game. You already connected as a different unit, the AI you're jumping into didn't, so therefore never had it's briefings added.

You can probably get around this issue by keeping track of what unit the player is and seeing if when they are alive again if they are in a different unit. If so, rerun briefing.

But how you can view taking over someone's consciousness that was previously standing next to you as more "realistic" than rejoining the fight from base is beyond me. :) Reinforcements strikes me as more realistic than mind transfer. heh

Share this post


Link to post
Share on other sites

Team switching is not "mind transfer", but rather having a human take over an AI. Full realism would be to have no AI in the firstplace, but since this is not possible, team switching is the next closest thing.

Here's an initJIP I wrote for tasks and notes for a mission that allows team switching:

waitUntil {!isNull player};

{
_x createDiaryRecord ["Diary", ["Credits", "Mission by GalZohar"]];
_x createDiaryRecord ["Diary", ["Execution", "Your team is to reach Utes by boat, and use laser designation to guide hellfire missiles to their targets."]];
_x createDiaryRecord ["Diary", ["Friendly forces", "Friendly forces consist of 10 marines on a RIHB and an <b>AH-1Z on standby, which must be returned unharmed</b>."]];
_x createDiaryRecord ["Diary", ["Enemy forces", "The island is fully controlled by insurgents. On top of the patrols surrounding the islands and holding the towns, there are also 2 mounted patrols and 3 mounted squads and an Mi-8 on standby, expect them to react once you are detected."]];
_x createDiaryRecord ["Diary", ["Mission", "Destroy insurgent objectives in Utes"]];
} forEach blueforUnits;

_countBlueforUnits = count blueforUnits;

_taskHelo = [];
{_taskHelo = _taskHelo + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskHelo select _i)
	setSimpleTaskDescription
	["Return the cobra to <marker name='mrkBase'>base</marker> unharmed.", "Return cobra unharmed", "base"];
};

_taskMi8 = [];
{_taskMi8 = _taskMi8 + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskMi8 select _i)
	setSimpleTaskDescription
	["Destroy the standby Mi-8, it should be somewhere around the <marker name='mrkAirfield'>airfield</marker>.", "destroy Mi-8", "airfield"];
};

_taskSU25 = [];
{_taskSU25 = _taskSU25 + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskSU25 select _i)
	setSimpleTaskDescription
	["Destroy the SU25 in the <marker name='mrkHanger'>hanger</marker>.", "Destroy SU25", "hanger"];
};

_taskC130J = [];
{_taskC130J = _taskC130J + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskC130J select _i)
	setSimpleTaskDescription
	["Destroy the <marker name='mrkC130J'>C-130J</marker> on the runway.", "Destroy C-130J", "C-130J"];
};

_taskTower = [];
{_taskTower = _taskTower + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskTower select _i)
	setSimpleTaskDescription
	["Destroy the airfield's <marker name='mrkTower'>control tower</marker>.", "Destroy control tower", "control tower"];
};

_taskAmmo = [];
{_taskAmmo = _taskAmmo + [_x createSimpleTask [""]];} forEach blueforUnits;
for "_i" from 0 to ((_countBlueforUnits)-1) do
{
(_taskAmmo select _i)
	setSimpleTaskDescription
	["Destroy the 3 ammo caches at the <marker name='mrkAirfield'>airfield</marker>.", "Destroy ammo caches", "airfield"];
};


_taskMi8 spawn
{
waitUntil {helodestroyed};
hint "Mi-8 destroyed.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

_taskSU25 spawn
{
waitUntil {aircraft1destroyed};
hint "SU25 destroyed.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

_taskC130J spawn
{
waitUntil {aircraft2destroyed};
hint "C-130J destroyed.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

_taskTower spawn
{
waitUntil {towerdestroyed};
hint "Control tower destroyed.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

_taskAmmo spawn
{
waitUntil {ammodestroyed};
hint "Ammo caches destroyed.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

_taskHelo spawn
{
waitUntil {cobraFailed};
hint "Helo took critical damage.";
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Failed";
};
};

_taskHelo spawn
{
waitUntil {boolComplete};
for "_i" from 0 to ((count _this)-1) do
{
	(_this select _i) setTaskState "Succeeded";
};
};

Of course there are some variables (blueFor units, boolComplete, cobraFailed etc) that need to be initialized and updated by other scripts.

  • Like 1

Share this post


Link to post
Share on other sites

Hey guys,

Thanks for the info....

I am trying to understand what Galzohar has done. In arma2 you had an option to set "Hidden" objectives with the 'objstatus' command. Is there are a way to do this in ARMA2 or do you have to create a new objective when required?

As a learning exercise I was trying to use the spawn command on Galzohars script above to inhibit the objective from being created until a condition (in the "waituntil" line) had been fullfilled. ie

_tskobj5 = [];
_tskobj5 spawn
        {	
	waitUntil {(obj5 == 1)};
	{_tskobj5 = _tskobj5 + [_x createSimpleTask ["Secondary: Destroy the chemical truck"]];} forEach blueforUnits;
	for "_i" from 0 to ((_countBlueforUnits)-1) do
			{
				(_tskobj5 select _i)
					setSimpleTaskDescription ["blah blah.", "Destroy the chemical truck", "Destroy the chemical truck"];
			};

	};

This does not work however. The task gets created for all you groups men that you can teamswitch into, but doesnt update when the objective is completed..and also the setsimpletaskdescription does not show up although the task appears. So it seems the spawn script is stalling or something after the fifth line where the task is created.

I played around with subsituting _tskobj5 (after the spawn command) with _this....but same result.

So near but so far...could anyone be so kind as to shed some light for me?

Thanks again

Frosty

Edited by Rough Knight

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

×