Jump to content
Sign in to follow this  
kremator

How to .... use the FSM tool

Recommended Posts

I'm really interested in learning how to use the FSM that has just been released by BIS.

This thread can be used for all your wonderful finds / and .fsm files.

Happy scripting.

Share this post


Link to post
Share on other sites

A good start TeRp. Now all we need are for some of our community gurus to lead the way and light the torches of knowledge (Oooohhh cheesy !)

Share this post


Link to post
Share on other sites

There are many ways of using the fsm editor in Arma 2 and this tool can be used even beyond Arma 2 engine as you can generate any type of code from it with the fsm compiler driven by custom config files.

However, maybe the most obvious way is to create .fsm file in the editor and use it in your mission by http://community.bistudio.com/wiki/execFSM command instead of the conventional linear script as written in sqf. During Arma 2 mission development, hundreds of different fsms were created and stored directly in fsm format (bifsm can store some additional information but we normally did not use it for common fsm files at all).

You can achieve the same results both ways, but for certain types of tasks fsms are easier to create and understand.

Share this post


Link to post
Share on other sites

Thanks for the input Maruk. Appreciate it.

I'm sure you will see the community coming up with loads of FSM code in the future.

Share this post


Link to post
Share on other sites

really interested to see how fsm tool works out. in arma1 there was expectation of what fsm could do thaT NEVER came to happen. now it seems there's more chance of that.

i looked at the tool but it is non-intuitive for a layman like me. hopefully smart modders could make something amazing and perhaps some real awesome AI innovations.

is it more possible this time? as last there was a limitation where the default AI would auto kick in. now is the new AI able to resist being taken over by default AI automatically.

Share this post


Link to post
Share on other sites

Hello there,

It would be lovely if we could be provided with documentation about the possible functions (function="something")

and what they do as used in the class CfgFSMs of config based FSM structures. :)

Share this post


Link to post
Share on other sites

check BI fsm and you will learn fast

Share this post


Link to post
Share on other sites

There are bound to be FSM gurus out there that can give us a hand.

I totally agree with kju that we should look at what BIS already have - indeed a good starting point.

Anyone used FSMs before ?

Share this post


Link to post
Share on other sites

Heyho,

i just played a little bit around with the FSM Editor and its great!

The scripting is equal to sqf, but you dont have to make loops and if-constructions. You have the ability to make non-linear scripts. Thats not just great for ai-scripting...

I made a easy zombie script... a zombie is attacking a group of civilians... after they died, they return as zombies too... looks great in the editor... 100 civilians and 1 zombie. 10 mins of scripting in fsm editor but a lots of fun!

Share this post


Link to post
Share on other sites
How does one activates the FSM script in game? Just as any other script?

Just like a SQF script, just that you use execFSM instead of execVM.

Share this post


Link to post
Share on other sites

Just for some insight by a normal dude like myself. Can this be done by someone that doesnt know scripting? Thinking more of just taking an example and change values around etc. Or is it massivly complex?

Thanks.

Alex

Share this post


Link to post
Share on other sites

Basically it *is* scripting, just that it's done in a graphical editor. Every single item in the FSM sequence has to be scripted to do anything.

Share this post


Link to post
Share on other sites

Traditionally FSMs are made ONLY with script... using a 'switch' structure where each case in the switch is a state... as in :

switch(state){
     case 1:
           state 1 behaviour;
           check for conditions that lead to other states;
     break;
     case 2:
           same as above and so on and on....
     break;
}

What BIS has done was create a graphical interface through which you can build your FSM in a more visual way... the scripting is still there, but the FSM editor lets you focus on the behaviours and frees you from worrying about the bureaucracies of doing the same thing with code alone...

I didn't know about this editor... it's quite awesome!! that's why ArmA is the best game ever!!

Cheers

Share this post


Link to post
Share on other sites
Heyho,

i just played a little bit around with the FSM Editor and its great!

The scripting is equal to sqf, but you dont have to make loops and if-constructions. You have the ability to make non-linear scripts. Thats not just great for ai-scripting...

I made a easy zombie script... a zombie is attacking a group of civilians... after they died, they return as zombies too... looks great in the editor... 100 civilians and 1 zombie. 10 mins of scripting in fsm editor but a lots of fun!

Care to share said script mate? :)

Share this post


Link to post
Share on other sites
Care to share said script mate? :)

Nope! Why? Because I have to solve some arma2 related issue. The zombies are not good for coops etc... just for some kind of script testing. Exept they are approching and "infecting" other, they act like normal civilians, cause of the micro ai. I have to solve this problem first!

Edited by NeoArmageddon

Share this post


Link to post
Share on other sites

"Why?" was a retorical question. The answer follows in my post: "I have to solve some arma2 related issue."

Nothing to do with the learning thread.

[Edit]I added a "Because" above.[/edit]

If you want to reproduce my script and the bugs just start FSM Editor, place a start state and write:

_unit=_this select 0;
enemys=[soldier1,soldier2,soldier3];

Enemys is a array of units.

Create a "true" condition and like it with the start state. Create a new state with:

_target = enemys select(floor(random(count(enemys)));

Link it with the true-condition. Create a condition with:

!isNil("_enemy")

Priority 0

Link it with a new state with the code:

_unit domove getpos _target;

Link this with two new conditions.

One is:

_target distance _unit>5

and its linked back to the last state

The other condition is:

_target distance _unit>=5

Its linked with a new State:

[_target] execFSM "thisfsm.fsm";

Over a true condition this state is linked with the first white state under the start state.

This is a simple script to "spread a virus"-script. But its not perfcect because of ArmA2 AI

Edited by NeoArmageddon

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  

×