-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1263 from Freddo3000/statemachine_fsm-editor-cfg
FSM Editor Config for CBA Statemachine
- Loading branch information
Showing
1 changed file
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* ---------------------------------------------------------------------------- | ||
CBA Statemachine Config for use with the 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. | ||
|
||
Usage: | ||
1. Select this config using FsmAttributes > Compile Config | ||
2. Change FSM attributes under FsmAttributes > Attributes from Compile Config. | ||
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. | ||
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.hpp must be included. | ||
|
||
Author: | ||
Freddo & PiZZADOX | ||
---------------------------------------------------------------------------- */ | ||
|
||
class Attributes { | ||
names[] = {"list", "skipNull"}; | ||
}; | ||
|
||
class Compile { | ||
clearNewLines = 0; | ||
indenting = 0; // no indenting | ||
rewriteFile = 1; // Do not append result to the end of file, but rewrite it. | ||
|
||
class Pass_States { | ||
print_sm = "class %(fsmname) {\n"; | ||
indent_smOpen = 4; | ||
print_attrList = "list = QUOTE(%(list));\n"; | ||
print_attrSkipNull = "skipNull = %(skipNull);\n"; | ||
|
||
class State_Any { | ||
print_state = "class %(statename) {\n"; | ||
indent_stateContents = 8; //Neccessary to preserve formatting | ||
print_stateContents = "%(stateinit)\n"; | ||
indent_stateOpen = 8; | ||
|
||
class Links { | ||
print_transition = "class %(linkname) {\n"; | ||
indent_transitionOpen = 12; | ||
print_target = "targetState = QUOTE(%(to));\n"; | ||
print_condition = "condition = QUOTE(%(condition));"; | ||
indent_transitionContents = 12; // Neccessary to preserve formatting. | ||
print_transitionContents = "%(action)\n"; | ||
indent_transitionClose = 8; | ||
print_transitionClose = "};\n"; | ||
}; | ||
|
||
indent_stateClose = 4; | ||
print_stateClose = "};\n"; | ||
}; | ||
|
||
indent_smClose = 0; | ||
print_smClose = "};\n"; | ||
}; | ||
}; | ||
|
||
class Decompile { | ||
process = 0; // 1 for 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"; | ||
}; | ||
}; |