Jump to content

Recommended Posts

So here a noobish question. im trying to make a mission here, when task 1 har been completed and they move on to the next objective how do i do for the first objective not to be true anymore?

what i mean is that first objective is to keep a guy alive orelse mission fails, can i remove this guy after its completed or add any code that removes

(!alive x... Force end ??)

sorry if its a stupid q, im learning by doing here.

Share this post


Link to post
Share on other sites

Assuming you have properly setup your briefing.sqf, try something like this in your first objective's trigger:

tskObjective1 setTaskState "SUCCEEDED";
hint "Objective 1 is complete!";

player setCurrentTask tskObjective2;

If they failed it, as in he dies, you can use FAILED instead of SUCCEEDED.

Share this post


Link to post
Share on other sites
Assuming you have properly setup your briefing.sqf, try something like this in your first objective's trigger:

tskObjective1 setTaskState "SUCCEEDED";
hint "Objective 1 is complete!";

player setCurrentTask tskObjective2;

If they failed it, as in he dies, you can use FAILED instead of SUCCEEDED.

this is what i have in my 1st objectives trigger,

"1" objStatus "DONE"; tskobj_1 setTaskState "SUCCEEDED"; 
player setCurrentTask tskobj_2; 
obj_1 = true; 
publicVariable "obj_1";

should make anything different here? cause mission still ends if he dies after its completed.

Share this post


Link to post
Share on other sites

The objStatus and obj_1 = true stuff is for the ArmA style objectives and briefings, don't need to do that anymore.

I'm a little confused about your mission and how it works? Am I correct in this summary:

Your team has someone with them they need to keep alive (we'll call him Ted) until such time as their main objective is completed. If Ted dies before the first objective is completed the team fails the mission.

Once the main objective is completed they are sent to a new objective, but at that point it doesn't matter if Ted dies anymore. The only way to fail now is to lose the whole team before the second objective. Additionally they should be able to FAIL Ted's survival objective at this point, but not the mission because of it.

Share this post


Link to post
Share on other sites

yea im abit confused myself :) never done this stuff before.

Anyway, the story is: mission starts with a team of 10 soldiers that have to keep a colonel named scott alive, they will succeed if they can hold off an attack that is pointing on destroying a vehicle that scott is in, once there is no ei left (within 2k:s) they get the ok for next objective, wich is an attack somewhere (havent gotten that far yet)

So i'm thinking that it would be a shame if the hmmw thats he in xplodes for what ever reason after 2 or more objectives and the whole thing ends, beacuse that objective is completed. thats my thought.

Share this post


Link to post
Share on other sites

You can have your end1 trigger condition

!alive guy and isnull obj1

, having the objective 1 trigger activation include 'obj1'. So, when it gains a value the endgame trigger won't fire.

Or is it isnil? I actually use 'not obj1', and declare it false in init.sqf...

Share this post


Link to post
Share on other sites

You may want to check this thread if you haven't yet. There may be something about it in there:

http://forums.bistudio.com/showthread.php?t=73424

And this one may provide some help but not sure. It's not exactly what you are looking for but you may be able to get some ideas from it:

http://forums.bistudio.com/showthread.php?t=80443&highlight=group+dead

I wish I could provide more but I to have been trying to do something like this for a mission I'm making but have yet to figure it out or search/ask for assistance. I'm looking forward to see a solution.

Share this post


Link to post
Share on other sites

im still looking for a working solution on this, cant find anything so far though.

Share this post


Link to post
Share on other sites

Trigger 1:

0x0, none

Cond: !alive scott

Type: Lose

Name: trgObj1

Trigger 2:

1000x1000, enemy, not present

On Act:

tskObj1 setTaskState "SUCCEEDED";

hint "Scott is safe, yay!";

player setCurrentTask tskObj2;

trgObj1 setTriggerStatements ["false","",""];

Share this post


Link to post
Share on other sites

I'm having a similar issue.

I want the "Task Accomplished" hint to flash when a certain emeny is killed.

I know how to do it for say 'pick up map' using a 'collect.sqf' and the 'deleteVehicle' code. But that involves items.

What about men or say tanks. If the objective is to kill/destroy it...how then after it is done do you get the "Task Accomplished" hint to show.

Share this post


Link to post
Share on other sites
I'm having a similar issue.

I want the "Task Accomplished" hint to flash when a certain emeny is killed.

I know how to do it for say 'pick up map' using a 'collect.sqf' and the 'deleteVehicle' code. But that involves items.

What about men or say tanks. If the objective is to kill/destroy it...how then after it is done do you get the "Task Accomplished" hint to show.

First, name them. Always name important units in your mission so that they will be easy to call.

Once you name you man/Tank say Bill

In your trigger put

  !alive Bill

in the condition box. This will continuously check the trigger area if Bill is not alive and once that is detected it will fire, End1 or whatever you want.

Share this post


Link to post
Share on other sites

Yeah I get the whole !alive thing and linking it to a trigger ie end1. But what I am trying to get is the green box with the words 'Mission Accomplished' in the center of the screen to flash, not end the game itself. In my briefing there are certain tasks. When the mission starts I get the 'Current Task' box. I am trying to get the task hint that when I complete the task.

Edited by RazorHead1

Share this post


Link to post
Share on other sites

dont know i i dont understand u but arent u talking about

init:

!alive bill

on act:

Hint "Mission Accomplished"

Share this post


Link to post
Share on other sites

Thanks guys I figured it out.

Use the '!alive badguy1' in the Cond. of the trigger. Then in the On Act section of the trigger use this line:

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

When the condition is met (whatever it may be) the task hint will flash on screen. I wasn't talking about the simple hints that appear on the side of screen but the large 'Task Hints' in center.

Sorry if I was hard to understand but working it through here on the forums helps alot.

Edited by RazorHead1

Share this post


Link to post
Share on other sites
dont know i i dont understand u but arent u talking about

init:

!alive bill

on act:

Hint "Mission Accomplished"

No, he's talking about centered top mission status box with all the pretty coolers.

Here is how I set it up in my mission. On Activation of the accomplishing trigger:

nul = [objNull, ObjNull, task3, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; task3 setTaskState "SUCCEEDED";

Name of the task is 'task3', the taskHint.sqf is code internal to ArmA2, designed to make things easy for designers. Valid states are "CREATED", "CANCELLED", "CURRENT", "FAILED" and "SUCCEEDED". The taskHint.sqf only displays the taskState selected, so setTaskState must still be done for mission accounting purposes.

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  

×