Jump to content
Sign in to follow this  
SwiftyBoy

Create new task after completing previous task

Recommended Posts

Hi all

How do you go about "revealing" the next task in the briefing screen after the previous task has been completed?

I've a simple scenario where the player is searching for a witness to a crime. The first task is to go to her house. This shows up in the map/briefing screen fine, along with the diary notes etc. Unfortunately for the player, she's not there, so the player is directed to look in the centre of town for her.

Once the first task is complete, up pops the hint "Task 1 completed", so far so good, I've got this far, but...

what I want to happen now is for the second task (already defined in the briefing.sqf) to now appear on the map/briefing screen.

What do I need to put in the trigger for the completion of task1 to make the next task appear in the map/briefing screen?

At the moment, BOTH tasks are in the briefing screen, and I only want the first one to be there until it's completed, at which point the player gets the message "New task assigned" and lo and behold, there is the next task in the briefing screen.

PS I have been scouring these forums for days trying to find an answer to this specific query, without success.

Share this post


Link to post
Share on other sites

Cut & paste the 2nd task commands from briefing to the onAct field of the trigger.

You dont show/hide tasks in Arma2, you create them when they are needed.

Share this post


Link to post
Share on other sites

In a trigger put this in the Condition line:

taskCompleted task_1's_name;

And this in the OnAct line:

task2(task_2s_name) = player createSimpleTask ["Task_Briefing_Name"]; task2 setSimpleTaskDescription ["Task_Description","Task_Briefing_Name","HUD_marker_icon_name"]; task2 setSimpleTaskDestination markerpos "Marker_Name"; player setCurrentTask task_2s_name;

Also I believe I learned how to do it in this thread but I can't remember for sure. And your right, I haven't seen a good thread in the search. I know I learned it somewhere on the forums since I'm the one that asked. ; If I can remember where, I'll post the link. In the mean time check the above link. I know it's long but just about everything I wanted to know about tasks is in there.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Brilliant, thanks chaps, I'll try that later and let you know how I get on.

There's one other thing which is bugging me - in the above scenario, I've got the witness's name (Elena Vershinova) but I can't figure out how to get the AI bot to show this in a conversation i.e. I want it to show on-screen as:

Elena Vershinova: Good morning

but it's coming up with

Hanna Something-ova: Good morning.

How do I re-name the bot "permanently" so to speak, so that she's always Elena V in this scenario (I've tried the Name text box in the unit screen but this doesn't seem to work...)?

Share this post


Link to post
Share on other sites

---------- Post added at 10:39 AM ---------- Previous post was at 10:39 AM ----------

[/color]

Brilliant, thanks chaps, I'll try that later and let you know how I get on.

There's one other thing which is bugging me - in the above scenario, I've got the witness's name (Elena Vershinova) but I can't figure out how to get the AI bot to show this in a conversation i.e. I want it to show on-screen as:

Elena Vershinova: Good morning

but it's coming up with

Hanna Something-ova: Good morning.

How do I re-name the bot "permanently" so to speak, so that she's always Elena V in this scenario (I've tried the Name text box in the unit screen but this doesn't seem to work...)?

It's something using:

this setIdentity "Elena Vershinova";

in the units init line or something like that. I can't remember though

Edited by Manzilla

Share this post


Link to post
Share on other sites

Cheers Manzilla (twice!). I'll have a scout round for the identity thing.

FWIW I think I'm getting myself a bit mixed up between the "tsk" names you use in the briefing (eg tskobj_1), and the "obj_1" names you use in the triggers. All very confusing, couldn't get the thing running just now when I tried it, but I'll persevere and let you know how it goes...

Share this post


Link to post
Share on other sites

If you need more help just let me know. My knowledge is limited but I do know how to set up tasks! :D

My code description above was changed to make it a bit easier, hopefully. I changed the place holder names so hopeful it cuts down on the confusion.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Thanks Manzilla (and shk), I've now got to the point where I've created the first task on mission start up, so no need to put it in the briefing.sqf, and the second task fires up on completion of the first.

I now have two problems (one minor, one not-so-minor):

1. Minor: the second "task created" hint ("Go to the fountain") appears before the first completed task hint ("Get to Elena's house"). I have both in the same trigger, run On Activation. Does the order in the On Act. box matter?

2. Not-so-minor: how does one "close" the first task so it can't be selected from the map screen? At the moment, both tasks are open in the briefing screen once the triggers have gone off and created them and, while the player can set them as current task, they never get checked off and "closed" once completed. What do I need to put in the trigger(s) to check them off and disable them?

Share this post


Link to post
Share on other sites

1) Thanks for Arma working in mysterious ways, the order doesnt matter. To make sure they will be shown in right order, you need to sleep between them. That will probably mean you need to put all your stuff in onact inside a spawn.

nul = [] spawn {your onact stuff here, taskhint completed; sleep 3; taskhint newtask };

2) You are setting the first task as succeeded with settaskstate, right?

Share this post


Link to post
Share on other sites

@shk:

1. Thanks mate, I thought I might have to put a sleep delay in there, but frankly I had no idea how to do it, so that's brilliant. Odd thing is, it *was* working perfectly, played it through a couple of times, no problems at all. Then... loaded it up again, and it started displaying the second hint *first*. And now does it all the time in that order. Just weird.

2. I thought I was setting the task state as complete - it may be that I'm only setting it as "SUCCEEDED" in the

execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf

part of the code... can't check now, it'll be tomorrow before I can look into it. Come to think of it, you may well be right though, I'll need to use the setTaskState in the trigger On Act. field to close down tskobj_1.

PS One thing I found which may be useful for other n00bs like me trying to create a "sequence" of tasks/objectives on the fly - use the "Empty" type of marker to define the objective, that way it won't show up in the map screen until the trigger fires to activate the task it relates to. Sorry if that's obvious, but I only worked it out yesterday :-(

Edited by SwiftyBoy

Share this post


Link to post
Share on other sites

manzilla thanks bud i new its been 8 years or so but i just came across your code and it works perfect thank you saved me a lot of aggro 

 

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
Sign in to follow this  

×