Jump to content
Sign in to follow this  
b00tsy

creating tasks (walkthrough wanted)

Recommended Posts

Hi community,

I have been trying the last 2 days to get the tasks working in my mission, but I just can't get it to work. The problem is that the wiki does not explain anything and it is also missing a lot of examples.

So far I am able to list the tasks in the map and they are clickable, but I am not able to create a working task description, destination, state and task result.

This is what I have so far that works placed in a trigger:

currentTask = pl createSimpleTask ["Eliminate Col. Aziz and his commander"];

Now the wiki example for the description is "tskCaptObj setSimpleTaskDescription ["Today you have to kill Spongebob.", "Kill Spongebob", "Here he is !"];"

Now I first tried to add that (copy/paste) in the same trigger behind the first line of code, but it does not work, also not when I create a new trigger.

Then for the destination the wiki example mentions this: tskGoHere setSimpleTaskDestination (getMarkerPos "obj1");

I also added that in the same trigger and changed the marker name accordingly, but this also does not work.

Well I can paste more of the example lines from the wiki, but the same goes for the other examples, i can't make it work.

The problem is that the wiki does have some examples, but does not tell me anything about how and where to place the codes. I am really missing a "step by step" walkthrough on how to get a full task from beginning to end to work properly.

For someone like me that is new at trying to script a mission the wiki feels unfinished and is missing vital info. It may show some line of code, but thats it. You basically have to figure out yourself how to use the code and where to put it and thats not easy when you never scripted before.

Any scripter interested in editing the wiki or adding a full step by step walkthrough here? Or if there is already a walkthrough out there on this subject can you point me to the webpage?

No doubt a lot of other ArmA players that are new at scripting would appriciate it too.

Share this post


Link to post
Share on other sites
Now I first tried to add that (copy/paste) in the same trigger behind the first line of code, but it does not work, also not when I create a new trigger.

Copy and pasting examples is never a good idea, unless you have been guaranteed that you're looking at working examples. Are you sure "tskCaptObj" was definied prior to calling setSimpleTaskDescription?

For someone like me that is new at trying to script a mission the wiki feels unfinished and is missing vital info. It may show some line of code, but thats it. You basically have to figure out yourself how to use the code and where to put it and thats not easy when you never scripted before.

While noone will deny that the wiki leaves a lot to be desired, beeing a manual in the first place, it isn't that bad.

Second, it's always a good idea to look at BIS code to get a better idea about commands you're unsure about. Therefore I suggest you unpbo at least the missions.pbo and grab yourself a nice tool, capable of searching through files in a given directory (baregrep is free, fast and simple).

At least I find myself constantly looking up commands in missions(_e).pbo to look who exactly they were used. Item.

And last but not least, please, do not post only one line of your code. Show us a "working" (well, obviously not), a complete example. Otherwise we are basically screwed and can't really help you (except these guys with the crystal balls).

Now to simpleTasks

First, it's really not _that_ hard. So if you struggle with this, watch out for scripting or plain programming errors such as unnamed or misspelled variables.

Step 1: create a new simpleTask

A_SIMPLE_TASK = player createSimpleTask [(localize "STR_aSimpleTask")];

You may create a task at any given point in time. You just need to be aware of the fact, that you've created the task for a single unit (the player). So if you make use of teamSwitch, respawn or similiar, you need to think about how to manage this, so all of these units will have up to date tasks assigned to them.

Second, it's a good practice to use a stringtable, even if you do not plan (yet) to offer translations.

Step 2: task destination

A_SIMPLE_TASK setSimpleTaskDestination _destination;

variable/pointer-to-your-task setSimpleTaskDestination some-position. That's it.

Step 3: task description

A_SIMPLE_TASK setSimpleTaskDescription[
  (localize "STR_aSimpleTaskLongText"),
  (localize "STR_aSimpleTask"),
  (localize "STR_aSimpleTaskWaypointLabel")
];

Again, no magic involved here. You take your task, the command setSimpleTaskDescription an pass an array with three strings in it. The first string is the long description text, the second is the name/title of the task and the last one will show up on-screen on the waypoint in cadet mode.

Step 4: set and update task states

A_SIMPLE_TASK setTaskState "CREATED";

And that's it. Here a minimal working example:

A_SIMPLE_TASK = player createSimpleTask ["simple task title"];
A_SIMPLE_TASK setSimpleTaskDestination (position player);
A_SIMPLE_TASK setSimpleTaskDescription[
  "simple task long description",
  "simple task title",
  "simple task waypoint label"
];
A_SIMPLE_TASK setTaskState "CREATED";

And then later in the mission:

A_SIMPLE_TASK setTaskState "SUCCEEDED";

If you want to keep the player in the loop about the status of tasks, you may always do this:

[objNull, ObjNull, A_SIMPLE_TASK, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

...or write your own dialog, hintbox or what not.

Share this post


Link to post
Share on other sites

Hey thanks, both awnsers are very useful especially seeing the full code. I think I should be able to get it working now! I see if I can edit the wiki myself and put the example code posted in there, because this is way more detailed and understandable then anything ive read in the wiki.

I do want to note though that I have already given much more time and effort trying to learn a feature of a "game" (20+ years of gaming) then I did with any other game. I still do not get why the hell BIS dares to advertise this editor as "easy to use" and "intuitive" because thats simply not true. Thank god for a helpful community, otherwise i would be lost even more then i already am trying to get a full functional mission working.

Edited by B00tsy

Share this post


Link to post
Share on other sites

From the FAQ sticky in this forum, just above the "SEARCH BEFORE POSTING" sticky:

http://forums.bistudio.com/showthread.php?t=73424

As I've mentioned in another thread, the editor is extremely easy to use. It's only when you start to get into all the other features that the difficulty ramps up. Briefings with pretty task pictures isn't required to make a good mission, it's just icing on the cake.

Share this post


Link to post
Share on other sites

Seems pretty standard to me to have working tasks and objectives. Placing a couple of waypoint with an end trigger I don't call a mission... unless you have a lot of imagination of course. IMO its far from "extremely easy", it requires learning a scripting language just to do some simple things... for a game mind you.

And I used the forum search function and not a related thread showed up with the search terms I used. I always search before posting.

Share this post


Link to post
Share on other sites

@Bootsy: Searching is an artform. And I would say, that if you did not find at least one related thread, then you should propably reconsider your search parameters. That being said, I often have trouble finding threads that I know must be there. One important thing is to make use of the advanced search, and only search in the appropriate forum.

@Kylania: I do think that B00tsy has got a point about the editor. In general I guess this discussion is not as much whether the editor is in fact easy-to-use, but more about what you understand by 'easy-to-use'. I would say that the editor gives me more possibilities to make missions without the use of scripting, than I have experienced before. In that regard it is certainly easy-to-use. Then again, I can understand why (some) people assume, that an "extremely easy-to-use editor" means that you can make aesthetic and professional-looking missions, without knowing how to code. In some respect I feel that is somehow a justified assumption. At the very least I would concur with B00tsy, that it would seem pretty standard "to have working tasks and objectives". I think BIS would go a long way in improving (at least peoples perception of) the editor if they added a simple briefing/objective wizard.

In the end I dont really care. I love to look at this game as edutainment. I love opening up an old mission, realizing that I did not know what the hell I was doing - feeling like the newborn 1337 haxxor as I proceed to mock my old code like:" Did I really write this piece of sh!t garbage script", and then rewrite it to my full satisfaction.

In the end I guess it all comes down to what you expect to get out of this (or any) game. When I do not know how to do something in the editor, I take it as a challenge not a source of irritation. If all you want from this game is solid entertainment, then I can understand why coding n00bs like myself are discouraged by the level of involvment it takes to make a nice looking mission. If you expect (like the boxcover promises) to be able to spit out good missions in 5min intervals, then you might be surprised about the amount of time you have to spent browsing forums for an answer on what might be percieved as basic questions. Personally I kinda like it that way, but that does not make me close my eyes to the legitimacy of the claim... - not saying that you do. I have just seen this discussion a few times allready, and seen a lot of opinionated claims about how easy- or not easy-to-use the editor in fact is, without anyone taking note of the discursive nature of the subject.

...omg, that turned into a rant. :o

this disablePlayer "RANT";

Regards,

EDIT: Sorry for going that far off topic, but I feel that the original question has been answered in full by ruebe and the link from kylania.

Edited by Nielsen

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  

×