Jump to content
Sign in to follow this  
Ikavnieks

objective appear by walking into a trigger

Recommended Posts

Hey I was just wondering how I'd make an objective appear once you walk through the trigger? Can't for the life of me seem to find out!

Share this post


Link to post
Share on other sites

Thanks Mate, took me a while to understand :P Didn't realise it's just basically your objectives that you put in your briefing.sqf but in the trigger activation.

Share this post


Link to post
Share on other sites

Yes, you can add new tasks/objectives anywhere, not just the briefing.sqf This allows you to make new tasks "on the fly" so the mission appears more dynamic.

Good luck!

Share this post


Link to post
Share on other sites

Agh! Now encountered a new problem... The objectives wont complete anymore, for example: "3" objStatus "DONE"; tskobj_3 setTaskState "SUCCEEDED"; obj_3 = true; publicVariable "obj_3";

Doesn't seem to tick off the objective anymore, any ideas?

EDIT: It says "Objective completed." however the checkbox next to the objective doesn't turn green

EDIT 2: Fixed it by taking out "3" objStatus "DONE"

Edited by Ikavnieks

Share this post


Link to post
Share on other sites

objStatus is an old and obsolete command, so Its functionality is limited.

The way that works for me and is consistent is using:

(taskstate obj) == "SUCCEEDED"

which relates to the createsimpletask command and others.

Share this post


Link to post
Share on other sites

Ninja'd

FYI, you are mixing the old objective system from OFP and A1 and the new task system in A2 & OA. See this Biki article for a good overview: Tasks

The command objStatus is not part of the task system.

To complete the full task cycle in A2, you should do the following (if using triggers):

On Act:

task1 = player createSimpleTask ["taskName1"]; task1 setTaskState "ASSIGNED";

Then in another trigger that detects the conditions for completetion of the task:

On Act.

task1 setTaskState "SUCCEEDED";

Then the green dot shouls show up in the tasks section of the briefing.

They key thing to remember in A2 is that tasks are unit specific. So if you are in a MP scenario and you want multiple units/players to have a task, you have to make sure the code to create and update the tasks runs on every machine (trigger are good for that). Can you share more details and perhaps we can hone a comprehensive solution?

Edited by Loyalguard
Ninja'd

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  

×