Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSM Editor Config for CBA Statemachine #1263

Merged
merged 4 commits into from
Dec 21, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions addons/statemachine/CBA_FSMEditor.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/* ----------------------------------------------------------------------------
CBA Statemachine Config for use with FSM Editor

Description:
This is a config that allows you to create and edit CBA Statemachines using
the Arma Tools FSM editor, for increased readability and expandability.

It isn't by any means perfect, but it should be useable

Usage:
1. Select this config using FsmAttributes > Compile Config
2. Change FSM attributes under FsmAttributes > Attributes from Compile Config
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
2.1 'list' parameter is parsed as list = QUOTE(x);
2.2 'skipNull' parameter is parsed as skipNull = x;
3. States
3.1 'initCode' is parsed as is, and may contain onState = "",
onStateEntered = "" and/or onStateLeaving = ""
4. Transitions
4.1 'targetState' does not need to be entered, and simply follows the
transition link
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
4.2 'condition' is parsed as condition = QUOTE(x)
4.3 'action' is parsed as is, and may contain onTransition = ""
and/or events[] = {}

Dependencies:
In order to properly function, script_macros_common need to be included
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved

Author:
Freddo 2019-12-10
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
---------------------------------------------------------------------------- */

class Attributes
{
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
names[] = {"list", "skipNull"};
};

class Compile
{
clearNewLines = 0;
// indenting = -1; //no indenting
rewriteFile = 1; //do not append result to the end of file, but rewriteIt
class Pass_States
{
print_sm = "class %(fsmname)\n{\n";
indent_smOpen = 4;
print_attrList = "list = QUOTE(%(list));\n";
print_attrSkipNull = "skipNull = %(skipNull);\n";
class State_Any
{
print_state = "class %(statename)\n{\n";
indent_stateContents = 0; //Neccessary to preserve formatting
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
print_stateContents = "%(stateinit)\n";
indent_stateOpen = 8;
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
class Links
{
print_transition = "class %(linkname)\n{\n";
indent_transitionOpen = 12;
print_target = "targetState=QUOTE(%(to));\n";
print_condition = "condition=QUOTE(%(condition));\n";
indent_transitionContents = 0; //Neccessary to preserve formatting
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
print_transitionContents = "%(action)\n";
indent_transitionClose = 8;
print_transitionClose = "};\n";
}
indent_stateClose = 4;
print_stateClose = "};\n";
}
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
indent_smClose = 0;
print_smClose = "};\n";
};
};

class Decompile
{
process = 1; //0 for not processing Decompile info
FSMLeft = "/*";
FSMRight = "*/";
class FSMPrefix
{
default = "";
};
class FSMPrefix2
{
default = "";
head = "*/";
};
class FSMSufix
{
default = "";
compile = "\n";
state = "\n";
head = "\n/*\n";
link = "\n";
};
class FSMSufix2
{
default = "";
compile = "";
state = "\n";
head = "\n";
link = "\n";
};
};