TheWizard97 10 Posted June 10, 2013 (edited) hey all, I started making my own mission today and I am having some trouble with the task modules. I am trying to make a mission where the goal is to infiltrate the enemy base and kill an officer... then get back out again all while cover from a sniper on a hill. I have placed my ground troops in a boat just a little off shore and created a task to get to the coast. until here everything works fine until I get to the next task I want to make. I got the task set up with the create task, assign task, and complete task modules. and a trigger that gets activated by Blufor when the units get to the coast. at the task destination module it goes wrong. I can not get it to work. I set the module to synchronized object and synchronized it to the officer that is the target and the create task module. but it does not work. does it matter which way I do the synchronizing, like create task -> task destination or the other way around? ---------- Post added at 18:09 ---------- Previous post was at 16:57 ---------- nevermind I already figured it out... I think. just synchronized the destination module to the trigger that starts the task and it seems to work EDIT: aaand it broke again Edited June 10, 2013 by TheWizard97 Share this post Link to post Share on other sites
Larrow 2822 Posted June 10, 2013 Destinations can be a bit flaky. I found that if they get created at the same time as the create task they dont always show. If you use something like nil = [] spawn { _taskcreated = false; while {!(_taskcreated)} do { _taskcreated = ["TASKNAME"] call BIS_fnc_taskExists; sleep 0.5; }; sleep 1; ["TASKNAME", MYTASKPOSITION] call BIS_fnc_taskSetDestination; }; //TASKNAME as in module Task ID //MYTASKPOSITION = OBJECT or ARRAY or STRING of your task destination in the trigger thats firing off your create task then they work 100%. Just makes sure the create task has finished and the task exists before setting the destination through script rather than using the destination module. Share this post Link to post Share on other sites
TheWizard97 10 Posted June 10, 2013 (edited) where exactly do I put this? I tried putting it in all open spots in the trigger at least once and every time I get an error message. EDIT: put it in the on act box and it didn't give me an error this time but the marker is still not showing up :S Edited June 10, 2013 by TheWizard97 Share this post Link to post Share on other sites
dale0404 5 Posted June 10, 2013 You need to sync the create task module to the trigger with that script in it. Don't forget to sync the module and trigger to yourself as well. Share this post Link to post Share on other sites
TheWizard97 10 Posted June 10, 2013 I got it to work now! I didn't have the trigger sync'd to the player. thanks for the help guys! I just have one more question. if I want a task for the player to move to a certain area could I create an invisible map marker and set that as the destination? Share this post Link to post Share on other sites
Larrow 2822 Posted June 10, 2013 It needs to go in the OnAct of the trigger that is synced to your createtask module. Remember to change TASKNAME for what ever your createtasks ID is and MYTASKPOSITION for what ever your position is, like shown in the two comments at the bottom of that script. e.g OBJECT = player or a unit or a vehicle etc ARRAY = a position array like [3434,643,6745] STRING = a markername "myMissionMarker" Remember to take out the last two comment lines as they will cause errors in a triggers OnAct box. _______________________________________________ For your last question while i was typing this, YES see above about marker name Share this post Link to post Share on other sites
dale0404 5 Posted June 10, 2013 I got it to work now! I didn't have the trigger sync'd to the player.thanks for the help guys! I just have one more question. if I want a task for the player to move to a certain area could I create an invisible map marker and set that as the destination? Use the Set Task Destination module and sync it to an object (like a pile of bricks for instance), then sync a trigger to it. Set the countdown to 0.1 seconds. This will make sure the module "fires" after the create task fires. Share this post Link to post Share on other sites
TheWizard97 10 Posted June 10, 2013 (edited) I tried adding what I understood so far in the mission and it still didn't work so I am gonna tell step by step how I tried it. and I hope one of you can see where I went wrong. 1: I added a trigger field that is activated by blufor and has the following code: nil = [] spawn { _taskcreated = false; while {!(_taskcreated)} do { _taskcreated = ["task1"] call BIS_fnc_taskExists; sleep 0.5; }; sleep 1; ["task1", target] call BIS_fnc_taskSetDestination; }; //task1 name of the task and target is the name of the soldier that I want the task to mark to as the target //comments obviously not in the code I added :P 2: after this I added a create task module and name the task ID: task1 and the marker to kill 3: added a set task state - succeeded and a set task state - assigned modules. 4: added a trigger with the following code in the conditions: !alive target; 5: I then synced the player to the first trigger and the create task module. 6: synced the first trigger to the create task module 7: synced the two set task state modules to the create task module. 8: synced the second trigger to the succeed module. and synced the assign state module to the first trigger. after doing this it does not work. does it matter which way I sync the modules? I mean does it matter which I select first and then drag to the second? will take another look at this thread tomorrow tho cause trying this while tired doesn't really help :P Edited June 10, 2013 by TheWizard97 Share this post Link to post Share on other sites
TheWizard97 10 Posted June 11, 2013 I tried a diffrent way and this seems to work every time. I'm just really new to the whole scripting thing I think :). I made a second trigger set to timeout 1 and let that start the destination and the assignment so it gets created after the task and it seems to work every time. thx for helping me but I think I need to practice a bit more with the basic stuff before I start adding scripts and things. Share this post Link to post Share on other sites