Jump to content
Sign in to follow this  
atomickrypton

How to make addAction set a task state to succeeded?

Recommended Posts

Hello,

So I have been working on this mission for a while now, and everything is going great, in fact, it almost completed... except one thing is preventing that. I need the mission to end, but not by entering a trigger. I would like to have it set to where you walk up to the Major, and you have an option to talk to him. After you hit MMB, it'll set the task state to succeeded. After that, I'll have a trigger check if that the certain task is succeeded, if it is, then the mission will end. I have looked all over the internet, and I still can't get the first part to work. Here is my work so far...

Major's INIT field:

this addAction ["Talk with Major Hart", "chat.sqf"];

Chat.sqf:

_Task7 setTaskState "Succeeded"

For this .sqf file, I have tried putting "tsk7","_tsk7", and "Task7" in place of "_Task7", but nothing seems to work. I have seen forums where they say this is how to have a script set a task state to "Succeeded", but unfortunately, it doesn't seem to work for me. If you guys can help me out that'd be great. The task ID in the module is "tsk7", and the name of the module is "Task7". Also, there will be dialogue between the player and the Major, so all I will need to do is put sleep X; at the top line in chat.sqf? X being the number that I decide is fit.

As for the triggers checking if the task is complete, I can take care of that. I just need help with this script. Please note that when I have quotation marks around tsk7 and Task7, that is for organization in this post, I am not putting quotation marks around those names in the script.

Thanks in advance,

Atomic Krypton

Share this post


Link to post
Share on other sites

Simple solution. Have the addaction change a variable to true. Then use publicvariable to send that to the server. Have the trigger look at the variable for being true then it can end the mission

The trigger can call a script that will make the task true as well

On my phone so not easy to post code. Will see if I can throw something up later

  • Like 1

Share this post


Link to post
Share on other sites

Hello, thanks for the response. I ended up messing around with the variables, and I got it to work. Thanks for the help!

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  

×