Jump to content

Recommended Posts

Group and Team respawn still do not keep your Briefing info. (SNIP)

I have this issue so I've been meddling with this for a while now and found that the state of the task variables are stored on death/teamswitch and only the briefing texts are not shown... Thus the following code will create the briefings AND states on both death and teamswitch but with some issues...

known issues:

- TeamSwitching between the same soldiers will duplicate the tasks. This is pretty hideous. Doesn't happen when group respawn.

- The CurrentTask setting is a bit dodgy, it doesn't retain the waypoint unless you manually Set as Current Task again. It's as if you can't store a CurrentTask in a variable, at least not properly. Possibly a bug? Kind of useless if you can't store it isn't it? It won't even return nil or null when no tasks are set.

disclaimer: I'm no guru so this is probably completely crap...

Also, there are lots of Task commands that there is either little or no information about, might be worth looking into.

// wait for players?
waitUntil { !isNull player };
waitUntil { player == player };

switch (side player) do
{
// BLUFOR briefing:
case WEST:
{
	player createDiaryRecord["Diary", ["title", "text"]];
	//>---------------------------------------------------------<

_CurrentTask_old = CurrentTask player;
_tskObj1_old     = nil;
_tskObj2_old     = nil;

	// Primary Objective
	if (!isNil "tskObj1") then {_tskObj1_old = taskstate tskObj1;};
	tskObj1 = player createSimpleTask["title"]; 
	tskObj1 setSimpleTaskDescription["text", "title", "title"];
	tskObj1 setSimpleTaskDestination (getMarkerPos "mrk_obj1");
	if (!isNil "_tskObj1_old") then {tskObj1 setTaskState _tskObj1_old;};

	// Secondary Objective
	if (!isNil "tskObj2") then {_tskObj2_old = taskstate tskObj2;};
	tskObj2 = player createSimpleTask["title"];
	tskObj2 setSimpleTaskDescription["text", "title", "title"];
	tskObj2 setSimpleTaskDestination (getMarkerPos "mrk_obj2");
	if (!isNil "_tskObj2_old") then {tskObj2 setTaskState _tskObj2_old;};

	player setcurrenttask _CurrentTask_old;

}

};


if ( isNil {player getVariable "mk_briefingEH"} ) then 
{
player addEventHandler ["killed", 
{ 
	[] spawn {
		waitUntil { alive player };
		execVM "briefing.sqf"; 
	};
}];
player setVariable ["mk_briefingEH", true];
};

for teamswitch put in init.sqf:

onTeamSwitch {execVM "briefing.sqf";};

Please post any improvements, thanks.

Share this post


Link to post
Share on other sites

@Wamingo, Thanks for your reply I was starting to think it was just me with this problem.

I will have a look at your script and see if that helps thanks.

If no briefing after Group or Team Respawn is a problem for everyone maybe BIS might be able to fix it as they did fix it for Base Respawn.

---------- Post added at 05:21 PM ---------- Previous post was at 03:53 PM ----------

@Wamingo, I have had time to play around with your Script alittle now and I still end up with 2 copys of the Briefing after death or no briefing if I remove the EventHandler (patch 1.03+). thanks for trying tho.

Share this post


Link to post
Share on other sites

It also duplicates when using GROUP respawn? Group works ok for me - except the setcurrenttask is a bit buggy.

By "Team" do you mean SIDE? Side respawn is like teamswitch and it duplicates, not sure what to do about it.

Really this only works with group... that is... I think it works...

Share this post


Link to post
Share on other sites

@warmingo, Hi By "Team" I did mean "Side" respawn sorry.

But I tested your script on Arma2 Patch 1.03 using Group respawn and I am still getting 2 copys of the briefing after I die and respawn. If I remove the EventHandler I do not get any briefing. I keep checking this tread to see if others have the same problem but no-one seams to. I am fed-up with trying to get this to work now and have given up on mission editing. I am wating for a patch to fix it (will not happen if there is only me with a problem) or for OFP2 DR to see if I have more luck with that.

I did have everything working untill patch 1.03 but now I can`t get it to work right, guess it just me doing something wrong.

Share this post


Link to post
Share on other sites

Still just me then with no briefings after death when using Group / Side respawn problem?

Share this post


Link to post
Share on other sites
Playing MP with AIs is silly anyway. ;)

But that still dose not confirm anything.

Edited by Xtriaden

Share this post


Link to post
Share on other sites

I'm sure that this question has already been answered in the this, as I have read bits on information on it.

I created a trigger which cancels a task after an event.

Can I create a trigger which adds a new task after the same event? I saw someone wrote you use the 'create' command instead of succeeded/failed but I cant seem to get it to work.

Any ideas?

Thanks,

Leving.

Share this post


Link to post
Share on other sites
I saw someone wrote you use the 'create' command instead of succeeded/failed but I cant seem to get it to work.

It's basically on every page of this thread alone.

tskObj1 = player createSimpleTask["title"];
tskObj1 setSimpleTaskDescription["text", "title", "title"];

To show a hint

nul=[objNull, ObjNull, tskObj1, "CREATED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

Share this post


Link to post
Share on other sites

I think maybe you misunderstood my request.

This code

tskObj1 = player createSimpleTask["title"];

tskObj1 setSimpleTaskDescription["text", "title", "title"];

I'm already using this code in the briefing for tasks which appear at the start of the mission. I don't want the task to appear at the start.

and this

nul=[objNull, ObjNull, tskObj1, "CREATED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

Looks like a code to create a nicer looking hint, and is linked to a script I assume you have to put in your mission folder.

What I want to do is create a new task midway through the mission, not at the start. The task will become active after a set event (condition).

As I said Im sure this was already answered somewhere in this thread, but I could make no sense of it. I'm not as good as most at mission editing.

Thanks,

Leving.

Share this post


Link to post
Share on other sites

I'm already using this code in the briefing for tasks which appear at the start of the mission. I don't want the task to appear at the start.

Nobody is forcing you to just use it at the start. You can use it in trigger etc. So, instead of creating the task at the start and looking for ways to hide and show it, just create it when it is supposed to be shown.

Share this post


Link to post
Share on other sites

Ah right, so

tskObj1 = player createSimpleTask["title"];

tskObj1 setSimpleTaskDescription["text", "title", "title"];

is going in the On Act box of a trigger.

I thought perhaps Id have had to mess around with it in the breifing file.

Thanks very much, this solved my problem.

Thanks,

Leving.

Share this post


Link to post
Share on other sites

I'm having a strange problem with the task hint boxes - for some reason, the objectives are repeating themselves over and over.

Any ideas?

Furthermore, once Ive created a task via a trigger in game - how can I get the NEW TASK ASSIGNED box to show like it does at the start?

Edited by Leving

Share this post


Link to post
Share on other sites

I know this topic is pretty old, but rather than open a new post I'll post here.

How would I go about executing a spawn script when a Task has been selected (and only by uniquely named units)

I have all my markers/waypoints/tasks working, and I have 8 Players and 2 Officers. I want everyone to be able to set a task as their current, which works just fine. When either of the Officers select it, I would like to execute my spawn script.

I know how to execute them via trigger, but as this is a flight map, it would be all too easy to trigger several towns at once, when I only want whatever the Officer selects via Tasks to spawn.

Help would be greatly appreciated :)

Share this post


Link to post
Share on other sites

It's probably best to simply give the Officers an addAction to initiate a spawn, but if you wanted to use the briefing you can use a trigger with the following condition to check when they accept the task:

taskState tskObj1 == "ASSIGNED";

Just make sure you only assign that task to the officer, with something like this:

waitUntil { !isNull player }; // all hip now ;-)
if (officerUnitName == player) then {

  tskObj1 = player createSimpleTask["Spawn: Whatevercity"]; 
  tskObj1 setSimpleTaskDescription["Spawn units in Whatevercity.", "Init Whatevercity", "Active"];
};

Share this post


Link to post
Share on other sites

Hello all, i want to understand the two trigger mission briefing...

for example : I need to find ammo in a ammobox near a place...

this is my first mission object, so i need to create in file that kind of text :

//objective 1

tskobj_1 = player createSimpleTask["Find Weapon"];

tskobj_1 setSimpleTaskDescription ["There are more weapon i a cargo container", "Find Weapon", "ammocrate"];

tskobj_1 setSimpleTaskDestination (getMarkerPos "ammocrate");

-after that i'll see many example thats are command !Alive... this command are useful for all kind of mission object?

example, in my mission i have to :

1obj- find a ammocrate

2obj-find a radiopoint

3obj-escape with friendly elycopter

Wich kind of command in "condition" trigger i must create?

Thanks for now

Sutterk.:eek:

Share this post


Link to post
Share on other sites

@ Leving,

Basically my mission tasks are set 1 to 6 at the start. Then when task 5 has been completed the player activates a trigger cancelling task 6 and adds another task 7.

This is still work in progress but should still help.

Below is an extract from my brief.sqf:-

TASK6 = player createSimpleTask ["TASK6"];

TASK6 setSimpleTaskDescription ["blaaaaaaaa <marker name=mkrExtraction'>Extract</marker> aaaaaaaaaaaaaaaaaaaaaa.", "6. Extraction", "Extraction];

TASK6 setSimpleTaskDestination (getMarkerPos "mkrExtraction");

TASK5 = player createSimpleTask ["TASK5"];

TASK5 setSimpleTaskDescription ["Locate and destroy the <marker name=mkrTASK5'>east</marker> anti-aircraft battery.", "5. Destroy the east anti-aircraft battery", "Destroy east anti-aircraft battery];

TASK5 setSimpleTaskDestination (getMarkerPos "mkrTASK5");

TASK4 = player createSimpleTask ["TASK4"];

TASK4 setSimpleTaskDescription ["Locate and destroy the <marker name=mkrTASK4'>anti-air</marker> radar module.", "4. Destroy anti-air radar module", "Destroy anti-air radar module];

TASK4 setSimpleTaskDestination (getMarkerPos "mkrTASK4");

TASK3 = player createSimpleTask ["TASK3"];

TASK3 setSimpleTaskDescription ["Recon possible AA site on the <marker name=mkrTASK3'>south</marker> of Utes.", "3. Recon the south anti-aircraft battery site", "Recon the anti-aircraft battery site];

TASK3 setSimpleTaskDestination (getMarkerPos "mkrTASK3");

TASK2 = player createSimpleTask ["TASK2"];

TASK2 setSimpleTaskDescription ["Locate and destroy the <marker name=mkrTASK2'>west</marker> anti-aircraft battery.", "2. Destroy the west anti-aircraft battery", "Destroy west anti-aircraft battery];

TASK2 setSimpleTaskDestination (getMarkerPos "mkrTASK2");

TASK1 = player createSimpleTask ["TASK1"];

TASK1 setSimpleTaskDescription ["<marker name=mkrInsertion'>Insert</marker> via zodiac and re-supply at weapons cache as required.", "1. Insertion", "Insertion];

TASK1 setSimpleTaskDestination (getMarkerPos "mkrInsertion");

I am also using fancy task hints. The following extract is taken from my init.sqf

// ***CUSTOM SCRIPT*** - TASK HINTS, used to activate the task hint notice in game.

mk_fTaskHint = compile (preprocessFileLineNumbers "Cust_scripts\Task_hints\fTaskHint.sqf");

sleep 6; // Used to pause the first task hint until the intro screen has finished.

player setCurrentTask TASK1; // When game starts this shows the player that TASK1 has been set as current task.

[TASK1] call mk_fTaskHint; // Shows the player that he received a new task.

The following extracts are saved in a folder:-

"yourmissionname\Cust_scripts\Task_hints"

Save as "TASK1_completed.sqf"

TASK1 setTaskState "SUCCEEDED"; // Sets the task state.

//"mkrInsertion" setMarkerType "empty"; // Hides the task marker once the task has been completed.

[TASK1] call mk_fTaskHint; // Shows the player on the HUD.

hint "Mission plan updated";

sleep 5; // Wait before giving the player a new task.

player setCurrentTask TASK2; // Sets the current task.

[TASK2] call mk_fTaskHint; // Shows the player on the HUD.

Repeat for tasks 2 > 5.

For task 6, save as "TASK6_cancelled.sqf"

TASK6 setTaskState "CANCELED"; // Sets the task state. ("CREATED", "SUCCEEDED", "CANCELED" or "FAILED")

"mkrInsertion" setMarkerType "empty"; // Hides the task marker once the task has been completed.

[TASK6] call mk_fTaskHint; // Shows the player on the HUD.

hint "Mission plan updated";

sleep 5; // Wait before giving the player a new task.

"mkrBOB" setMarkerType "mil_objective";

this setPos getMarkerPos "mkrBOB";

TASK7 = player createSimpleTask ["TASK7"];

TASK7 setSimpleTaskDescription ["<marker name=mkrBOB'>Insert</marker> blaaaaaaaaaaaaaaaaa.", "7. FIND BOB", "BOB];

TASK7 setSimpleTaskDestination (getMarkerPos "mkrBOB");

TASK7 setTaskState "CREATED";

player setCurrentTask TASK7; // Sets the current task.

[TASK7] call mk_fTaskHint; // Shows the player on the HUD.

For task 7, save as "TASK7_completed.sqf"

TASK7 setTaskState "SUCCEEDED"; // Task has been completed

//"mkrTASK7" setMarkerType "empty"; //Hides the task marker once task has been completed.

[TASK7] call mk_fTaskHint; // show the user

hint "Mission plan updated";

sleep 5; // wait a while, so the player can read the hint

// end the mission now

endMission "END1";

In your mission now add a trigger for task 1 with the following in the "On Act" field:-

nul = execVM "Cust_scripts\Task_hints\TASK1_completed.sqf"; publicVariable "TASK1";

Repeat for tasks 2 > 5.

Now add a trigger for the cancellation of task 6, with the following in the "On Act" field:-

nul = execVM "Cust_scripts\Task_hints\TASK6_cancelled.sqf"; publicVariable "TASK6";

In your mission now add a marker at the location of task 7:-

NAME = mkrbob

ICON = empty

TEXT = BOB

Hope This helps, thanks

Cool Breeze-ICON

Share this post


Link to post
Share on other sites

Ok I am having the same issue I'll give this a try. I am basically looking for something to the effect of 'if task1 and 2 are complete then assign task3'

I'll give this a try.

Edited by RazorHead1

Share this post


Link to post
Share on other sites

I have been battling with the briefing/task list ever since arma 2 came out. I finally thought I had it cracked however in my latest map I though all was dandy until the mission/task list started duplicating I think it amounted to around 5 extra lists. Apols if this issue has already been published, however I am pulling my hair out and hope some of you guys out there may lend a hand. People were joining the mission as our server is public, I wonder if it has something to do with this?

Anyways any advice will be greatly appreciated

:yay:

Share this post


Link to post
Share on other sites

Psycho, make sure you're using ArmA2 1.04 and scripts designed for 1.04. That duplication of tasks came from the fact that previously ArmA2 didn't keep track of tasks after you respawned, so everyone built in scripts that would re-add them after you died. However now that that bug has been fixed tasks stay, so anyone using older player written code which added the tasks back will need to remove that function to stop the duplicating.

Share this post


Link to post
Share on other sites

I'm using respawn mode 4 (spawn as one of the remaining group).

The problem is that when one of us dies and respawns into the AI position, we lose our briefing etc and tasks completed.

Is there any way to reinitialise while using this spawn mode without resetting the objectives etc?

I've seen other posts on the subject but there doesn't seem to be a working resolution using respawn mode 4.

Eth

Edited by BangTail

Share this post


Link to post
Share on other sites

Create tasks for each member of the group instead of "player" and update accordingly.

Share this post


Link to post
Share on other sites
Create tasks for each member of the group instead of "player" and update accordingly.

OK so substitute "player" for "x" (x being name of unit) for example?

That's it?

Ill give it a try and thanks :)

Eth

Edited by BangTail

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

×