alleycat 28 Posted May 14, 2014 I was looking at FSM and after quickly glancing over what it does, I wonder: 1. Can the same things be achieved with normal scripting and is FSM just a visually easier way to handle it? Or is there something in FSM that normal scripting cant do? Share this post Link to post Share on other sites
Lala14 135 Posted May 14, 2014 I have no idea but here is this on the wiki Share this post Link to post Share on other sites
IndeedPete 1038 Posted May 14, 2014 The FSM is a different concept of executing programming code. It's applied when you wish to define the bahaviour of an entity under certain conditions. AI-behaviour or mission flow (or conversation flow in A2) are good examples from the Armaverse. Imagine you have a non-linear mission with a lot of different ways to accomplish it. You could do that in simple .sqf and with a lot of triggers, global variables etc. Or you use an FSM which looks better and is easier and faster to create. Look at the (partial) example from one of my missions below: As you can see this mission has many possible events in one situation. I could have achieved the same functionality with tons of .sqfs, triggers and eventhandlers. But it was way easier to do it with an FSM, and since it's all in one place I can change stuff quickly and see if it could affect another state. Another example would be this (extended) FSM from Arma 2 PMC which controls the behaviour of a protesting civie: Again, you could probably write .sqfs but it will be way more complicated with lots of huge if-then-else or case blocks and loops. On the other hand a strictly linear script or function is easier to write in plain .sqf. You can also combine both e.g. by executing linear stuff like cutscenes from the missionFlow.fsm. Finally, some additional literature about the concept of FSMs in general. Share this post Link to post Share on other sites
zapat 55 Posted May 14, 2014 This thread started about mission.fsm, but you can read a lot about FSMs advantages in general. http://forums.bistudio.com/showthread.php?175522-missionFlow-fsm-is-it-really-an-advantage Share this post Link to post Share on other sites
Tajin 348 Posted May 14, 2014 Ah zapat was faster. I was just about to post that same link :P FSM is good for logical flows, especially for scripted AI. Share this post Link to post Share on other sites
alleycat 28 Posted May 14, 2014 I am feeling more comfortable with sqf scripting, so if apart from a diagram, I would rather not use it. Thanks for the answer. Reading some old interviews of rocket there was screenshots of fsm and zombie behaviour and I assumed from that you can do things with it sqf cant. Ok just to be clear, fsm can use exactly the same scripting commands as regular sqf? Share this post Link to post Share on other sites
sunshimaro 10 Posted May 14, 2014 Are there execution time advantages over scripts? Share this post Link to post Share on other sites
zapat 55 Posted May 14, 2014 (edited) Yes. FSM condition evaluation is on each frame and unscheduled. Spawned, execVMed sqf is scheduled. Other than that a command in an SQF will take the same time as a command in FSM. Only distributed differently. And there is one thing you cannot do in sqfs: complex forking (As IndeedPete wrote). Eg something like this. :) Edited May 14, 2014 by zapat Share this post Link to post Share on other sites
avibird 1 141 Posted October 2, 2020 So for bringing this old thread back up. There is not a lot of information about why vanilla waypoints disappear once a group gets into combat mode and the FSM AI behavior kicks in. I'm trying to understand why does it deletes the waypoints once it puts the group into combat. The we'll just sit idle once the threat is eliminated and never follow its waypoints again that was placed in the editor. I know groups will follow Marker waypoints that are scripted even if combat status is reached and the FSM kicks in the group will follow its Marker way points once the threat is eliminated. I'm trying to find a way to allow editor place waypoints to continue!!! Share this post Link to post Share on other sites