Welcome, Guest Thursday 24th April 2014, 23:34:28
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: mk_taskHint (showing task hints the easy way) (ACCEPTED)  (Read 8796 times)
0 Members and 1 Guest are viewing this topic.
mikey
Editors Depot Staff
*****
Offline Offline


Whitespace Whore


« on: 19 Jul 2009, 14:09:50 »

The taskHint command by BIS is too difficult to use for novice scripters since it requires the scripter to provide the formatting, rgba and the icon name to use. So a few weeks ago I wrote a function to simplify all this. I thought I'd share it.



How to load the function
In your init.sqf, put this:
Code:
// Create a taskHint
//    Usage: [tskExample] call mk_fTaskHint;  
//        Gets the taskState of the passed task, and shows the status on screen
mk_fTaskHint = compile (preprocessFileLineNumbers "fTaskHint.sqf");
** NB: Change the filepath to where you keep the file. This is just a copy and paste from my own template **



How to use the function
This function will only work with tasks you've created (see my briefing tutorial on how to do that), and it will output the task's current state:
Code:
[tskExample] call mk_fTaskHint;  




Screenshots













NB:
- Task hints are different from regular hints, so they can be used at the same time.
- Task hints last only very shortly.
- This function does not manipulate the task at all, it only echo's out the current state.


OFPEC Download
« Last Edit: 10 Aug 2009, 16:01:31 by hoz » Logged
Worldeater
Editors Depot
Administrator
*****
Offline Offline


Suum cuique


« Reply #1 on: 19 Jul 2009, 14:50:30 »

Good job.  Good

Just two things:
  • You should consider using an OFPEC Tag.
  • The function mk_fEcho is missing.
Logged

try { return true; } finally { return false; }
mikey
Editors Depot Staff
*****
Offline Offline


Whitespace Whore


« Reply #2 on: 19 Jul 2009, 18:18:50 »

Calls to mk_fEcho have been commented out (that was silly of me).

And I would register my tag, but i've kinda grown accustommed to my mk tag, and ofpec rules state a 3 to 5 letter tag  Sad
Logged
Breeze
*
Offline Offline


« Reply #3 on: 25 Jul 2009, 20:06:57 »

Ok so where do we put the echo thing cause I got an error when just trying to call the script
Logged
mikey
Editors Depot Staff
*****
Offline Offline


Whitespace Whore


« Reply #4 on: 26 Jul 2009, 17:15:15 »

I just downloaded the version hosted here, and tried it in a mission which doesnt use my mission template, and it works fine for me?

Can you elaborate on your problem?
Logged
Porkyjack
*
Offline Offline


« Reply #5 on: 27 Jul 2009, 14:49:14 »

Hello mate Smiley

I need some help, could you make a dummy tutorial how to do this, please?
Where to put the script lines, which files etc etc.
Logged
hoz
OFPEC Site
Administrator
*****
Offline Offline



« Reply #6 on: 28 Jul 2009, 23:31:31 »

You should also consider packaging the script into a simple example mission.Nice work!
Logged

Xbox Rocks
mikey
Editors Depot Staff
*****
Offline Offline


Whitespace Whore


« Reply #7 on: 29 Jul 2009, 10:52:59 »

example mission added
Logged
sofmisfortune
*
Offline Offline


« Reply #8 on: 16 Aug 2009, 00:43:52 »

Thanks for the script and templates. I am having trouble as it will show my current task and then say completed before i reach the marker. What triggers the the completed message? sorry if this is a dumb question, I am new to this.

Any help would be appreciated!
« Last Edit: 16 Aug 2009, 14:11:00 by sofmisfortune » Logged
mikey
Editors Depot Staff
*****
Offline Offline


Whitespace Whore


« Reply #9 on: 17 Aug 2009, 12:11:46 »

This script solely echoes out the current state of the task, so if you set the task to completed with the "setTaskState" command, and then call the function, it will show that you've completed the task.
So what I think is wrong in your case is that you execute tskWhatever setTaskState "SUCCEEDED" too early.
Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: