Jump to content
scifer

missionFlow.fsm is it really an advantage?

Recommended Posts

This might be a bit too much for some people but when studying in uni if found this youtube video, both helpful and actually interesting. For those of you interested in tackling FSM - have a look at

maybe it will shed some light on the concept if you have no clue. Dont worry, the stuff in the video is not what you will have to do in Arma, but an understanding of what a FSM can and cannot do.

Share this post


Link to post
Share on other sites

Creating a scriptedFSM

  1. Click on FsmAttributes
  2. Click on compile config
  3. Click on browse
  4. You need to find your BI tools folder, mine is C:\program Files x86\Bohemia Interactive\Tools\FSM Editor Personal Edition
  5. Then click on scriptedFSM.cfg, click the select button.
  6. Then click OK.
  7. Go back up to FsmAttributes click on FSM Name and give your FSM a name. For example: missionFlow.fsm
  8. Now click on the save button. Name of FSM should now be missionFlow.fsm
  9. Now the file name should be missionFlow.fsm
  10. Save as type should be compiled FSM (*.fsm)
  11. Save the file to somewhere you can find it like your desktop.
  12. Click the select button.
  13. You should now have a compiled FSM on your desktop. You can now move it to your mission folder and start to edit the fsm.

Some things to take note of:

  • A condition should never lead to another condition. When you try to compile it you will get an error.
  • A condition should always be followed by a state.
  • You cannot use commands like sleep, waitUntil, or while in an FSM. We can however trick the FSM by using a timeout.

In one of your statement boxes you would put:

_t = time;

You would then create a user condition which would be:

time > _t + 15

This will stop the FSM for 15 seconds.

If you want to use waitUntil, sleep, or a while loop you will have to spawn it in one of the statement boxes like so:

[] spawn { some stuff goes here... sleep maybe};

Here is a small missionFlow example where you have to kill two officers. The stuff in the top right is just for reference. This FSM is also in a loop.

complete_zps48ea7bb1.jpg

When an FSM is in a loop and a condition is met, we then have to stop that condition from being true again otherwise it will continue to loop through the condition OVER AND OVER AND OVER. So in the start state (RED BOX) above I put:

_officerOneDead = false;
_officerTwoDead = false;

The condition diamonds (YELLOW) would be like this:

!(alive officerOne) && !(_officerOneDead)

The state (WHITE BOX) would be like this:

_officerOneDead = true;
["Task_One","succeeded"] call bis_fnc_missionTasks;

The third and final condition checks to see if both officers are dead. If they are the script will terminate (ORANGE BOX).

In the orange box I have:

"end1" call bis_fnc_endMission;

Anyways I hope some of this is helpful to somebody. Once you have the basics down start ripping into BI showcase missions and looking at their FSMs I have learned alot from them.

Edited by cobra4v320
  • Like 1

Share this post


Link to post
Share on other sites

is there an fsm editor in arma 3 tools? I can't seem to find it...

Share this post


Link to post
Share on other sites

Thanks for explaining that, I'm pretty advanced in my current project but I guess switching to FSMs for mission progress handling might come in handy. ;)

Cheers

Share this post


Link to post
Share on other sites

How would I go about executing the ambientPlane.fsm and ambientHelicopter.fsm at the beginning of a mission? Can this be done from the init? With the Fsm in the mission folder.

Thanks.

Share this post


Link to post
Share on other sites

another good example of Fsm is Zone Killer's battlefield or one of his other missions.

 

https://forums.bistudio.com/topic/188235-zks-battlefield-mp-coop/?p=2983223

 

https://forums.bistudio.com/topic/186666-zks-lost-mp-survival-mission/?p=2951736

 

battle field has been around I believe  since ofp and re edited by zonekiller thru the arma series .. <--- (just  giving some un needed back round info).

Share this post


Link to post
Share on other sites

I learned the basics with this video tut. the guy who made it seems to be very tired and so its sometimes a bit to slow in my opinion. but I learned all I nedded from it:

FSM-Video Tutorial

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

×