Advertisement
Brick

A3 OnDisplayCreated FSM

May 13th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 5.80 KB | None | 0 0
  1. /*%FSM<COMPILE "X:\Games\Steam\steamapps\common\Arma 3 Tools\FSMEditor\scriptedFSM.cfg, OnDisplayCreated">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-178.610596,-221.868256,-88.610580,-171.868271,0.000000,"init"};
  5. item1[] = {"Closed",2,250,-178.014099,-95.142662,-88.014069,-45.142662,0.000000,"Closed"};
  6. item2[] = {"WaitForOpen",4,218,-81.049820,-51.554138,8.950180,-1.554138,0.000000,"WaitForOpen"};
  7. item3[] = {"Opened",2,250,-177.543823,-0.838074,-87.543793,49.161926,0.000000,"Opened"};
  8. item4[] = {"WaitForClose",4,218,-272.152405,-50.613510,-182.152435,-0.613510,0.000000,"WaitForClose"};
  9. item5[] = {"_",8,218,-177.332642,-161.043228,-87.332642,-111.043213,0.000000,""};
  10. link0[] = {0,5};
  11. link1[] = {1,2};
  12. link2[] = {2,3};
  13. link3[] = {3,4};
  14. link4[] = {4,1};
  15. link5[] = {5,1};
  16. globals[] = {0.000000,0,0,0,0,640,480,1,65,6316128,1,-318.503601,198.373108,228.692810,-248.099594,980,904,1};
  17. window[] = {0,-1,-1,-1,-1,1340,1049,2421,264,1,998};
  18. *//*%FSM</HEAD>*/
  19. class FSM
  20. {
  21.         fsmName = "OnDisplayCreated";
  22.         class States
  23.         {
  24.                 /*%FSM<STATE "init">*/
  25.                 class init
  26.                 {
  27.                         name = "init";
  28.                         itemno = 0;
  29.                         init = /*%FSM<STATEINIT""">*/"private _identifier = param [0];" \n
  30.                          "private _callback = param [1];" \n
  31.                          "" \n
  32.                          "private _findDisplay = switch (typename _identifier) do" \n
  33.                          "{" \n
  34.                          "    case (typename """"):" \n
  35.                          "    {" \n
  36.                          "        {" \n
  37.                          "            uiNamespace getVariable [_this, displayNull];" \n
  38.                          "        };" \n
  39.                          "    };" \n
  40.                          "" \n
  41.                          "    case (typename 0):" \n
  42.                          "    {" \n
  43.                          "        {" \n
  44.                          "            findDisplay _this;" \n
  45.                          "        };" \n
  46.                          "    };" \n
  47.                          "};" \n
  48.                          ""/*%FSM</STATEINIT""">*/;
  49.                         precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  50.                         class Links
  51.                         {
  52.                                 /*%FSM<LINK "_">*/
  53.                                 class _
  54.                                 {
  55.                                         itemno = 5;
  56.                                         priority = 0.000000;
  57.                                         to="Closed";
  58.                                         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  59.                                         condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
  60.                                         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  61.                                 };
  62.                                 /*%FSM</LINK>*/
  63.                         };
  64.                 };
  65.                 /*%FSM</STATE>*/
  66.                 /*%FSM<STATE "Closed">*/
  67.                 class Closed
  68.                 {
  69.                         name = "Closed";
  70.                         itemno = 1;
  71.                         init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  72.                         precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  73.                         class Links
  74.                         {
  75.                                 /*%FSM<LINK "WaitForOpen">*/
  76.                                 class WaitForOpen
  77.                                 {
  78.                                         itemno = 2;
  79.                                         priority = 0.000000;
  80.                                         to="Opened";
  81.                                         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  82.                                         condition=/*%FSM<CONDITION""">*/"private _display = _identifier call _findDisplay;" \n
  83.                                          "" \n
  84.                                          "!isNull (_display);"/*%FSM</CONDITION""">*/;
  85.                                         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  86.                                 };
  87.                                 /*%FSM</LINK>*/
  88.                         };
  89.                 };
  90.                 /*%FSM</STATE>*/
  91.                 /*%FSM<STATE "Opened">*/
  92.                 class Opened
  93.                 {
  94.                         name = "Opened";
  95.                         itemno = 3;
  96.                         init = /*%FSM<STATEINIT""">*/"_display call _callback;"/*%FSM</STATEINIT""">*/;
  97.                         precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  98.                         class Links
  99.                         {
  100.                                 /*%FSM<LINK "WaitForClose">*/
  101.                                 class WaitForClose
  102.                                 {
  103.                                         itemno = 4;
  104.                                         priority = 0.000000;
  105.                                         to="Closed";
  106.                                         precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  107.                                         condition=/*%FSM<CONDITION""">*/"isNull (_identifier call _findDisplay);"/*%FSM</CONDITION""">*/;
  108.                                         action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  109.                                 };
  110.                                 /*%FSM</LINK>*/
  111.                         };
  112.                 };
  113.                 /*%FSM</STATE>*/
  114.         };
  115.         initState="init";
  116.         finalStates[] =
  117.         {
  118.         };
  119. };
  120. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement