shuko 59 Posted November 26, 2010 Since I don't have a crystal ball, I'm going to guess and say that you try to add them from somewhere that is not run on the server. Share this post Link to post Share on other sites
1para{god-father} 105 Posted November 27, 2010 (edited) I have them all placed in my init.ext file which I presume is correct , should that work ? Can I send you the .pbo, if you would not mind and let us know if i have done anything wrong ? I just tested it with your demo and I works but as soon as i try with a demo using the Random Task I still get nothing on the server. run it on my local PC and host and they work great. Demo using Randon Task init.ext taskCount = paramsarray select 0; //taskCount = 6; fncAddTask = { switch _this do { case 0: { ["Task1","Task1Title","TaskDesc"] call SHK_Taskmaster_add; }; case 1: { ["Task2","Task2Title","Task2Desc"] call SHK_Taskmaster_add; }; case 2: { ["Task3","Task3Title","Task3Desc"] call SHK_Taskmaster_add; }; case 3: { ["Task4","Task4Title","Task4Desc"] call SHK_Taskmaster_add; }; case 4: { ["Task5","Task5Title","Task51Desc"] call SHK_Taskmaster_add; }; case 5: { ["Task6","Task6Title","Task6Desc"] call SHK_Taskmaster_add; }; }; }; fncPickTask = { if isserver then { if (count tasks == 0) then { theEnd = true; publicvariable "theEnd"; } else { addTask = tasks select (floor random count tasks); tasks = tasks - [addTask]; publicvariable "addTask"; if !isdedicated then { addTask call fncAddTask }; }; }; }; theEnd = false; if isserver then { tasks = []; for "_i" from 0 to (taskCount - 1) do { tasks set [_i,_i]; }; } else { [] spawn { waituntil {!isnil "addTask"}; addTask call fncAddTask; "addTask" addpublicvariableeventhandler {(_this select 1) call fncAddTask}; }; }; call compile preprocessfile "shk_taskmaster.sqf"; call fncPickTask; // add first task for briefing Edited November 27, 2010 by psvialli Update Share this post Link to post Share on other sites
shuko 59 Posted November 27, 2010 call compile preprocessfile "shk_taskmaster.sqf"; //taskCount = paramsarray select 0; taskCount = 6; SHK_addTask = { if isserver then { if (count SHK_Tasks == 0) then { // whatever you want server to do when mission should end TheEnd = true; publicvariable "TheEnd"; } else { [] spawn { if (count SHK_Tasks != taskCount) then {sleep 1}; private "_t"; _t = SHK_Tasks select (floor random count SHK_Tasks); SHK_Tasks = SHK_Tasks - [_t]; switch _t do { case 0: { ["Task1","Task 1","Task1Desc"] call SHK_Taskmaster_add }; case 1: { ["Task2","Task 2","Task2Desc"] call SHK_Taskmaster_add }; case 2: { ["Task3","Task 3","Task3Desc"] call SHK_Taskmaster_add }; case 3: { ["Task4","Task 4","Task4Desc"] call SHK_Taskmaster_add }; case 4: { ["Task5","Task 5","Task5Desc"] call SHK_Taskmaster_add }; case 5: { ["Task6","Task 6","Task6Desc"] call SHK_Taskmaster_add }; }; }; }; }; }; if isserver then { SHK_Tasks = []; for "_i" from 0 to (taskCount - 1) do { SHK_Tasks set [_i,_i]; }; call SHK_addTask; // first task }; example Copy the shk_taskmaster from the example rar or from here. I just updated it a bit. ---------- Post added at 04:05 PM ---------- Previous post was at 04:05 PM ---------- Updated: 0.27 Fixed: Attempt to prevent double tasks from being added when the add parameter is used with the update function. 0.26 Added: Script can be called without parameters, just to load the functions for later use. Share this post Link to post Share on other sites
1para{god-father} 105 Posted November 27, 2010 Many thanks for your work on this it really is appreciated I will give that a go tonight. Share this post Link to post Share on other sites
1para{god-father} 105 Posted November 29, 2010 (edited) Hi Shk, Works Great Many Many Many thanks - Recommend Task master to everyone !!! Edited November 29, 2010 by psvialli Share this post Link to post Share on other sites
1para{god-father} 105 Posted November 29, 2010 (edited) heheh sorry me again with another question ! Should this work or can I not use pictures with Task Master ? ["Intel", "bla blar", "An image of blar blar<br/><img image=pics\blarblar.jpg'/>]; call SHK_Taskmaster_addNote; Cannot seem to get a picture to come up with notes OK solved i left the ";" in at the end - opps sorry Edited November 29, 2010 by psvialli Me being stupid Share this post Link to post Share on other sites
galzohar 31 Posted November 29, 2010 Also, it's init.sqf, not init.ext Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 27, 2011 Hi Shk, It is probably the way I am calling this but I am having an issue with the Task marker , it shows fine but when the task is complete the flag marker stays and i then get a new one foir the next random task. I have tried setMarkerAlphaLocal 0 after the task is complete but thsi will not work for JIP. case 0: { ["Task1","Task 1","Task1Desc",true,["markertask1",getmarkerpos "task1","flag","ColorYellow"]] call SHK_Taskmaster_add }; case 1: { ["Task2","Task 2","Task2Desc",true,["markertask2",getmarkerpos "task2","flag","ColorYellow"]] call SHK_Taskmaster_add }; I presume i am calling the flag marker wrong ? Thnaks Share this post Link to post Share on other sites
shuko 59 Posted January 27, 2011 I just tested the following in SP editor preview and on dedi server: init.sqf: [] call compile preprocessfile "shk_taskmaster.sqf"; if isserver then { _r = floor random 2; switch _r do { case 0: { ["Task1","Task 1","Task1Desc",true,["markertask1",getmarkerpos "task1","flag","ColorYellow"]] call SHK_Taskmaster_add }; case 1: { ["Task2","Task 2","Task2Desc",true,["markertask2",getmarkerpos "task2","flag","ColorYellow"]] call SHK_Taskmaster_add }; }; }; Editor: - empty markers named task1 and task2 - a radio trigger for each task with successful update (["Task1","succeeded"] call SHK_Taskmaster_upd) The yellow marker disappeared every time. Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 27, 2011 (edited) Hmmm I am using ,true, in my statement could that be the reason ? Ill takes it out and see, Forgot to say it is the JIP that has the problem when they join they see all the Marker that have been completed. say i complete 3 task and come out of the game and come and in I then see all the previous markers Edited January 27, 2011 by psvialli Share this post Link to post Share on other sites
shuko 59 Posted January 27, 2011 In what statement? Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 27, 2011 sorry ignore that comment ! Just tested again on Dedi completed 3 tasks and they completed fine and went away - so i then come out of the game and back in and on the map i can see all 3 Task markers Share this post Link to post Share on other sites
shuko 59 Posted January 27, 2011 Ah, so they dont get hidden for JIPs? Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 27, 2011 yes that is correct - sorry should ahve explained that better! Share this post Link to post Share on other sites
shuko 59 Posted January 27, 2011 Ok, made a small change, but didn't test it. Tell me how this goes. Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 29, 2011 Looks like it works finre now tested and all seems to work ! Many thanks again for this great script ! Share this post Link to post Share on other sites
shuko 59 Posted January 29, 2011 Updated links on first post. 0.28 Fixed: Markers of completed tasks were not hidden for JIPs. Share this post Link to post Share on other sites
Guest Posted January 29, 2011 Updated version frontpaged on the Armaholic homepage. Taskmaster 2 v0.28 Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 30, 2011 Hi shk, Not sure but think there might be a little bug ,I updated the script and we run the same mission that use Random Task's on the dedi, We completed a task and that all worked fine but then about 1 min later it come up and failed the same task ? - this has never happend before on this mission -so I moved back to the old script and it did not happen again - not sure if it was one of those ARMA things or a bug ? Share this post Link to post Share on other sites
shuko 59 Posted January 30, 2011 Old being 0.27? Only change between 27 and 28 was one IF that filtered out markers for JIPs. :/ Share this post Link to post Share on other sites
1para{god-father} 105 Posted January 30, 2011 Yes back to .27 but ill double check again now myself and complete them 1 at a time and see how things go. Share this post Link to post Share on other sites
shuko 59 Posted February 23, 2011 v0.30 Added new parameter: Destination (object/position/marker) Place to create task destination (game's built-in waypoint/marker). If an object is given, setSimpleTaskTarget command is used, attaching the destination to it. In case of a position or a marker, a static destination will be created. Share this post Link to post Share on other sites
Guest Posted February 23, 2011 Updated version frontpaged on the Armaholic homepage. Taskmaster 2 v0.30 Share this post Link to post Share on other sites
shuko 59 Posted February 26, 2011 Hotfixed, tiny fix to the marker creation. Share this post Link to post Share on other sites
1para{god-father} 105 Posted February 26, 2011 If i update will i need to change anything ? Thanks Share this post Link to post Share on other sites