Jump to content
Sign in to follow this  
jedra

Procedural Missions - Anyone figured this out?

Recommended Posts

Hi,

After writing like a million TimeTrials, I thought I would move onto something else and have a go at making a small procedural mission. The problem is that I can't see how it works.

Let's take the BIS example of 'The Nineteenth Hole'. I can find it's config entry which points to a generic mission folder (Proc_United_States_H.United_States_H) and I can find the FSM that runs the mission (fn_missionVisitGolf.fsm). The thing is that I can't find anything anywhere that actually calls this FSM or the compiled BIS_fnc_missionVisitGolf version.

I have a small repeatable mission in mind, and although I could just do it the usual way, I thought I would try and do it this way (not for any other reason than I want to try).

With the time trials it was easy to work out how it works as it explicitly calls the compiled Time Trial FSM from within a mission folder init.sqf - I just can't find how a procedural mission is called!

Am I going mission blind? I have been looking at this for hours!! There's no point in me writing my small mission FSM if I can't figure out how it plugs in!! Is it even possible to do this?

EDIT--->

Got a little bit further this evening. I now know that that the fsm for the mission needs to be defined in cfgFunctions...

class cfgFunctions {
class JED {
 tag = JED;
 class Missions {
  file = "\JedraMissions\functions\Missions";
  class missionTaxi01 {
   description = "Taxi Service";
   file = "\JedraMissions\functions\Missions\fn_missionTaxi01.fsm";
   ext=".fsm";
  };
 };
};
};

I also have my mission set up thus;

class CfgMissions
{
class Missions
{
 class JED_Missions {
  displayName = "Jedra's Missions";
  overviewText = "Missions by Jedra";
  overviewPicture = "JedraMissions\Images\JED_TT.paa";
  overview="";
  class Taxi01 {
   directory = "HSim\Missions_H\campaign\missions\Proc_United_States_H.United_States_H";
   briefingName = "Test Mission";
   overviewText = "Test Mission";
   overviewPicture = "hsim\missions_h\data\missionVisitGolf_ca.paa";
   doneKeys[] = {"JED_Taxi01_test"};
   templateProcedural = 1;
   helicoptersDefault[] = {"JED_Heli_Light02_JedTaxi_H"};
   author = "Jedmod";
  };
 };
};
};

The mission is loading as a function because I can now see it in the functions browser, it's just not running - it just runs an empty mission. For some reason the FSM that loads and runs the procedural missions is either not finding it, or trying to run the mission incorrectly. Or, I could have got my project stucture wrong. I am going to tinker more tomorrow. Unfortunately there's nothing in the .rpt file to help, but I am sure I will get to the bottom of it....

Edited by Jedra

Share this post


Link to post
Share on other sites

Update....

It seems that when a procedural mission initialises, the code prepends "BIS_fnc_mission" to the name of the mission function. Of course I am not a BIS, I am a JED. Thankfully BIS have added a parameter override for this in the config. So, in my CfgMissions entry all I need to do is add;


function = "JED_fnc_missionTaxi01";

Then "lo and behold" my mission fsm function runs!

I now have to figure out how to get the Tasks and Conversations working. They seem to be hardcoded into an INCLUDE somewhere for each mission. I think I have climed the mountain now, just a few small hills to go...

Apologies if this is turning into a blog-like experience, but I promise to put the full procedure down in writing at the end so that those who follow do not have to experience this pain!

Share this post


Link to post
Share on other sites

keep up the blog

I am reading and learning at least :)

Share this post


Link to post
Share on other sites

Good to hear! So I am! Anyway with regard to mission tasks....

BIS declare a SQF (fn_missionTasks.sqf) as a function (BIS_fnc_missionTasks), which is called from the procedural mission FSM to setup the tasks and deal with task related functions (such as completing/failing the task). Unfortunately in the sqf they do this...

#include "fn_missionTasks.hpp"
#include "fn_missionVisit_Tasks.hpp"
#include "fn_missionVisitGolf_Tasks.hpp"
#include "fn_missionSightseeing_Tasks.hpp"
#include "fn_missionSlingload_Tasks.hpp"
#include "fn_missionSlingloadCamp_Tasks.hpp"
#include "fn_missionDropLeaflets_Tasks.hpp"
#include "fn_missionRescue_Tasks.hpp"
#include "fn_missionPursuit_Tasks.hpp"
#include "fn_missionPursuitBoat_Tasks.hpp"
#include "fn_missionTimeTrial_Tasks.hpp"
#include "fn_missionFreeFlight_Tasks.hpp"

Which I think is a bit naughty as this is wrapped up in BIS's pbo and doesn't feel very open. If I want mission specific tasks I can't add them to BIS's function. So, to get round this I needed to make a copy of this SQF in my own mission space and then declare my own function for it in class missionTasks which I can then call from my own FSM.

class cfgFunctions {
class JED {
 tag = JED;
 class Missions {
  file = "\JedraMissions\functions\Missions";
  class missionTaxi01 {
   description = "Taxi Service";
   file = "JedraMissions\functions\Missions\fn_missionTaxi01.fsm";
   ext=".fsm";
  };
  class missionTasks {
   description = "Mission Tasks";
   file = "JedraMissions\functions\Missions\fn_missionTasks.sqf";
  };
 };
};
};

I imagine that there is the same thing with Conversations, I will probably need a couple of mission specific concersations but I will look at that once my mission is working.

Anyway, the result is that I now have a basic procedural mission running with tasks. The mission is very basic at the moment so over the next couple of days I will knock it into shape.

Share this post


Link to post
Share on other sites

Hi Jedra,

By a procedural mission do you mean a mission that has dynamic/procedural objectives?

Where objectives keep coming one after you finish the last but can be of any kind and place?

Would be nice if you could clear this up.

Another thing is that you do not actually need to use any of the custom functions, so you can make your own, that do what you specified.

Be it .sqs, .sqf, .fsm or java, you can use whatever you feel more comfortable with, so if you are starting with RV scripting, I would advise you to start with normal .sqf format, since to make a Finite State Machine you will need to know how to use it.

I took a look at the Wiki and found out that most of the custom functions are not yet documented, although if you d'pbo the modules.pbo from TKOH addons folder, you then are able to manually check the functions files, and probably find their own documentation there, usually on top of each file.

_neo_

Share this post


Link to post
Share on other sites

Hi Neokika,

Yes, the procedural missions are how BIS have put together their 'Challenges' and also they plug into the campaign. So, the mission I am writing will be 'different' each time (in that positions are randomised etc).

Yes, I could write them in the normal way using SQF like I do for Arma 2, but I wanted to understand how/why BIS had done it this way. Having figured out how the procedural missions work, it seems it should be reasonably easy just to plug a new FSM into the framework and voilla you have a new mission that works just be adding a few config entries. For example, although it took me a good day or so to figure out how BIS had done it, last night I wrote a simple FSM based mission that is different every time in about 20 minutes.

It allows BIS (and us) to quickly knock up some interesting 'process type' missions (i.e go there, do that, go there, do this, repeat).

Using the Mission functions also has another advantage in that things like tasks are easy to manage, and also the scripted waypoint functions save you writing reems of code to do things like loading/unloading the helo, checking if a helicopter has landed, checking if a helicopter is flying straight etc. It also means that not a single trigger is used! The fact the functions aren't documented isn't too much of a problem as I know SQF, so I can figure them out.

Anyway, once I have finished this mission and given it a bit of polish I'll release it so everyone can see how its done.

Share this post


Link to post
Share on other sites

Nearly done now! Hopefully I should get this polished enough to release before we are graced with the presence of Hinds! Anyway, one last moment of confusion regarding conversations.

In the BIS missions, they seem to define the conversations in two places, both in the config (.cpp) and the bkib file. Basically, the same code seems to be in both...

class 01_oneliners_taxi_BUY_0
{
 text = "I need you to show me some properties. Please follow the map you have been supplied with!";
 speech[] = {"\hsim\dubbing_h\missionvisit\01_Oneliners_Property\01_oneliners_property_BUY_0.ogg"};
 actor = "hsim_Buyer";
 variant = "";
 variantText = "";
 class Arguments {};
};

The above code appears both in the mission config AND the bkib file. (The above is from my mission, BIS use stringables for multi-language support).

I am not an expert with conversations - I have only done one or two in Arma, so for the moment I have to blindly copy this method (which works) until I understand why this is in two places.

Anyway, I now have a reasonably interesting procedural mission, which is different every time you play (in the same way that the BIS missions are 'different'). It just needs some polish and I need to finish skinning one of the choppers...

Share this post


Link to post
Share on other sites

I just wanted to pop in with a word of encouragement and say that I am dying to see your finished product! Keep up the good work.

Share this post


Link to post
Share on other sites

For those wishing to see what I cam up with, I'll just leave this here...

Once I have take a breath I will document what I did in case it helps someone else!

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  

×