Advertisement
smilne

Mini Cut-Scene Demo Code

Aug 17th, 2015
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 98.07 KB | None | 0 0
  1. {
  2.     // REQUIRED
  3.     "id": "HOME_TOWN_CUT_SCENE",
  4.    
  5.     // REQUIRED
  6.     // The tiled data for this map.
  7.     "mapFilename": "data/maps/tiled/CutSceneTown.tmx",
  8.    
  9.     // In special cases (like cut-scene's) you may not want the player sprite on the map at all.
  10.     // If this is the case for this map configuration, then set this value to true.
  11.     "hidePlayerSprite": true,
  12.    
  13.     // When a loading screen (non-combat) is requested, if you provide a list here, a background will be randomly chosen.
  14.     // If you do not provide a custom list for this map, the adventure list will be used instead.
  15.     "loadScreenBackgrounds": [
  16.         "data/screens/gate.png"
  17.     ],
  18.  
  19.     // REQUIRED
  20.     // Provide the list of backgrounds to use in the combat screen.
  21.     // If more than one is provided, then a random choice will be made.
  22.     "combatBackgrounds": {
  23.  
  24.         // The small device screen background list.
  25.         "small": [
  26.             //"data/maps/tiled/MountainBattle_Small.tmx",
  27.             "data/maps/tiled/BattlefieldSmall.tmx"
  28.         ],
  29.  
  30.         // The medium/large device screen background list.
  31.         "large": [
  32.             //"data/maps/tiled/MountainBattle.tmx",
  33.             "data/maps/tiled/Battlefield.tmx"
  34.         ]
  35.     },
  36.  
  37.     //
  38.     // Internationalization and Localization
  39.     //
  40.     // We provide this through a specialty field called a "LocaleValue" within the configurations.
  41.     //
  42.     // A LocaleValue only loads the value below during GSON loading. Not all values are loaded.
  43.     //
  44.     // We do this here instead of using a GDX bundle because of the lazy loading.
  45.     //
  46.     // The bundles force you to load all the information in the bundle at once, while we're trying to avoid doing that
  47.     // with having lazy loaded configuration data. So, we place our localization information within the configurations directly.
  48.     //
  49.     // It searches the locale in the following order and the first one to match is the one used. If none, it returns NULL.
  50.     // The locale key used follows the exact same pattern as that of java.util.Locale.
  51.     //
  52.     // en_CA_VAR1
  53.     // en_CA
  54.     // en
  55.     // default
  56.     //
  57.     // A typical JSON field using this would look like this:
  58.     //
  59.     //        "name": {
  60.     //            // This value will be used when nothing else is available.
  61.     //            "default": "",
  62.     //            // The list of available locale's for this value.
  63.     //            "locales": {
  64.     //                "en": "",
  65.     //                "en_CA": ""
  66.     //            }
  67.     //        },
  68.     //
  69.  
  70.     "name": {
  71.  
  72.         // This value will be used when nothing else is available.
  73.         "default": "Home Town",
  74.        
  75.         // The list of available values defined by locale.
  76.         // The locale key used follows the exact same pattern as that of java.util.Locale.
  77.         "locales": {
  78.        
  79.             "xx": {
  80.                 "value": "Home Town (XX)"
  81.             },
  82.             "yy": {
  83.                 "value": "Home Town (YY)"
  84.             },
  85.             "en_CA2": {
  86.                 "value": "Home Town (EN_CA)"
  87.             },
  88.             "en2": {
  89.                 "value": "Home Town (EN)"
  90.             },
  91.             "zz": {
  92.                 "value": "Home Town (ZZ)"
  93.             }
  94.         }
  95.     },
  96.  
  97.     // The map lighting allows us to create an ambient lighting over the map, then place light objects onto the map.
  98.     "mapLighting": {
  99.    
  100.         // The shader's to use for the map lighting.
  101.         "vertexShader": "data/maps/lighting/shaders/vertexShader.glsl",
  102.         "lightingPixelShader": "data/maps/lighting/shaders/lightingPixelShader.glsl",
  103.  
  104.         // If providing lights, then you need to provide this shader.
  105.         "defaultPixelShader": "data/maps/lighting/shaders/defaultPixelShader.glsl",
  106.  
  107.         // If you do not provide player or map lights, then the ambientOnly shader will is required to produce the ambient.
  108.         "ambientPixelShader": "data/maps/lighting/shaders/ambientPixelShader.glsl",
  109.    
  110.         // What color should be used to create the ambient "fusion" with the map.
  111.         // If not provided, the "night-time" color will be applied.
  112.         "ambientColor": {
  113.             "r": 0.3,
  114.             "g": 0.3,
  115.             "b": 0.7,
  116.             "intensity": 0.8
  117.         },
  118.  
  119.         // OPTIONAL
  120.         // Place specific light points on the map using Tiled objects (like other map points)
  121.         "lightPoints": [
  122.             {
  123.                 "active": false,
  124.                 "mapPointId": "FIRE_PIT_LIGHT",
  125.                 "mapObjectId": "BILL_END_POINT",
  126.                
  127.                 // MapLight
  128.                 "mapLight": {
  129.                     "light": "circle_glow_light",
  130.                     "flicker": 15,
  131.                     "coverage": 10
  132.                 }
  133.             },
  134.             {
  135.                 "active": false,
  136.                 "mapPointId": "TREE_FIRE_LIGHT",
  137.                 "mapObjectId": "FIRE_MAP_POINT",
  138.                
  139.                 // MapLight
  140.                 "mapLight": {
  141.                     "light": "circle_glow_light",
  142.                     "flicker": 5,
  143.                     "coverage": 30
  144.                 }
  145.             },
  146.             {
  147.                 "active": true,
  148.                 "mapPointId": "TORCH_1",
  149.                 "mapObjectId": "TORCH_1",
  150.                
  151.                 // MapLight
  152.                 "mapLight": {
  153.                     "light": "circle_glow_light",
  154.                     "flicker": 15,
  155.                     "coverage": 10
  156.                 }
  157.             },
  158.             {
  159.                 "active": true,
  160.                 "mapPointId": "TORCH_2",
  161.                 "mapObjectId": "TORCH_2",
  162.                
  163.                 // MapLight
  164.                 "mapLight": {
  165.                     "light": "circle_glow_light",
  166.                     "flicker": 15,
  167.                     "coverage": 10
  168.                 }
  169.             },
  170.             {
  171.                 "active": true,
  172.                 "mapPointId": "TORCH_3",
  173.                 "mapObjectId": "TORCH_3",
  174.                
  175.                 // MapLight
  176.                 "mapLight": {
  177.                     "light": "circle_glow_light",
  178.                     "flicker": 15,
  179.                     "coverage": 10
  180.                 }
  181.             },
  182.             {
  183.                 "active": true,
  184.                 "mapPointId": "TORCH_4",
  185.                 "mapObjectId": "TORCH_4",
  186.                
  187.                 // MapLight
  188.                 "mapLight": {
  189.                     "light": "circle_glow_light",
  190.                     "flicker": 15,
  191.                     "coverage": 10
  192.                 }
  193.             },
  194.             {
  195.                 "active": true,
  196.                 "mapPointId": "TORCH_5",
  197.                 "mapObjectId": "TORCH_5",
  198.                
  199.                 // MapLight
  200.                 "mapLight": {
  201.                     "light": "circle_glow_light",
  202.                     "flicker": 15,
  203.                     "coverage": 10
  204.                 }
  205.             },
  206.             {
  207.                 "active": true,
  208.                 "mapPointId": "TORCH_6",
  209.                 "mapObjectId": "TORCH_6",
  210.                
  211.                 // MapLight
  212.                 "mapLight": {
  213.                     "light": "circle_glow_light",
  214.                     "flicker": 15,
  215.                     "coverage": 10
  216.                 }
  217.             }
  218.         ]
  219.     },
  220.    
  221.     // These are used to display effect animations on the screen at the provided point.
  222.     "animationPoints": [
  223.         {
  224.             // ID of this animation point
  225.             "mapPointId": "ANIMATION_POINT",
  226.            
  227.             // ID of the map object used to place this animation on the map.
  228.             "mapObjectId": "FIRE_MAP_POINT"
  229.         }
  230.     ],
  231.  
  232.     //
  233.     // List of path's used by the camera for scene movement.
  234.     //
  235.     // SETUP:
  236.     // Use these objects on the tiled map to indicate their location then use the "Type" field for the mapObjectId.
  237.     //
  238.     //         - Polyline can only be used for path referencing. The camera will stop on the last point of the polyline.
  239.     //         - Polygon can only be used for path referencing. The camera will path back to the first point of the polygon.
  240.     //        - Use these for the "followCameraPath" event action "coordinatePathId" references.
  241.     //
  242.     // You will need to use comments to indicate which one's are polygon's vs polyline's as to avoid using them incorrectly.
  243.     //
  244.     "cameraPaths": [
  245.        
  246.         // This is a polygon and should only be used for coordinate path references.
  247.         // See "coordinatePathId" in "followCameraPath" event action configurations.
  248.         {
  249.             "mapPathId": "TOWN_NPC_COORD_PATH",
  250.             "mapObjectId": "INTRO_CAMERA_PATH"
  251.         }
  252.     ],
  253.  
  254.     //
  255.     // List of points used by character sprite's for location/movement.
  256.     //
  257.     // SETUP:
  258.     // Use these objects on the tiled map to indicate their location then use the "Type" field for the mapObjectId.
  259.     //
  260.     //         - Rectangle are used for single map points. (start/end/static)
  261.     //        - The sprite is then centered within the rectangle.
  262.     //        - Use these for the player/NPC "landingSquareId" references.
  263.     //
  264.     "spritePoints": [
  265.         {
  266.             "mapPointId": "NPC_SAM_START_POINT",
  267.             "mapObjectId": "SAM_START_POINT"
  268.         },
  269.         {
  270.             "mapPointId": "NPC_SAM_END_POINT",
  271.             "mapObjectId": "SAM_END_POINT"
  272.         },
  273.         {
  274.             "mapPointId": "NPC_BILL_START_POINT",
  275.             "mapObjectId": "BILL_START_POINT"
  276.         },
  277.         {
  278.             "mapPointId": "NPC_BILL_END_POINT",
  279.             "mapObjectId": "BILL_END_POINT"
  280.         },
  281.         {
  282.             "mapPointId": "NPC_SAM_FIRE_PIT_POINT",
  283.             "mapObjectId": "SAM_FIRE_PIT_POINT"
  284.         }
  285.     ],
  286.  
  287.  
  288.     // This is a list of all the NPC's available in the map. Each one can be configured to do multiple jobs if wanted.
  289.     "mapNpcs": [
  290.  
  291.         {
  292.             "id": "NPC_SAM",
  293.             "displayName": {
  294.                 "default": "Sam"
  295.             },
  296.  
  297.             // The atlas file to load for the sprite graphics.
  298.             // NPC atlas files are different because they are not scaled for screen sizes and are constant.
  299.             // Thus we do not provide a key for the sizes like we do for those and instead just load the one atlas for all sizes.
  300.             "spriteAtlas": "spriter/npc/four_directional/directional.atlas",
  301.  
  302.             // The file path to the SCML data.
  303.             "spriteScml": "spriter/npc/four_directional/directional.json",
  304.        
  305.             // The name of the entity to load from the SCML.
  306.             "spriteEntityName": "Knight",
  307.  
  308.             // If you want to have certain character maps applied upon creation, assign them now.
  309.             // Character map names used should be obtained from the animator character map types.
  310.             // For example: com.netprogs.mobile.games.rpg.sprites.creatures.animators.NpcSpriteAnimator.CharacterMap
  311.             "spriteCharacterMaps": [ "mage" ],
  312.  
  313.             // This is the sprite animator you wish to use to build the animations from the atlas above.
  314.             // We leave these as a "loose" connection between core and the game itself because we want to allow us to be
  315.             // able to create as many various animators we want without having to update the core code to do so.
  316.             "spriteAnimator": "npc",
  317.  
  318.             // Overrides inherited if provided.
  319.             // Atlas that contains all the require icons for this creature.
  320.             "iconAtlas": "spriter/npc/four_directional/npc_wizard_icons.atlas",
  321.  
  322.             // Adds to the list of inherited if provided.
  323.             // This is a "loose" connection between the atlas and the code allowing us to define icon textures within it.
  324.             // Each unique key/value in the list is combined with the parent. If same keys are used, these override parent.
  325.             "icons": {
  326.  
  327.                 "general": {
  328.  
  329.                     // 32x32
  330.                     "small": "general_small",
  331.  
  332.                     // 64x64
  333.                     "large": "general_large"
  334.                 }
  335.             },
  336.  
  337.             // [OPTIONAL] This is the list of available paths for the NPC to take.
  338.             "paths": {
  339.  
  340.                 "ENTER_TO_TREE": {
  341.                     "startPointId": "NPC_SAM_START_POINT",
  342.                     "endPointId": "NPC_SAM_END_POINT",
  343.                     "faceDirection": "left",
  344.                     "cameraCentered": true,
  345.                     "decisionWhenCompleted": false
  346.                 },
  347.                
  348.                 "TREE_TO_EXIT": {
  349.                     "startPointId": "NPC_SAM_END_POINT",
  350.                     "endPointId": "NPC_SAM_START_POINT",
  351.                     "faceDirection": "right",
  352.                     "removeWhenCompleted": true,
  353.                     "cameraCentered": false,
  354.                     "forcePlayerWait": false
  355.                 },
  356.                
  357.                 "STEP_TO_FIRE_PIT": {
  358.                     // We don't provide a start point because we want Sam to start where he left off.
  359.                     "endPointId": "NPC_SAM_FIRE_PIT_POINT",
  360.                     "faceDirection": "left",
  361.                     "removeWhenCompleted": false,
  362.                     "cameraCentered": false,
  363.                     "forcePlayerWait": false
  364.                 }
  365.             },
  366.            
  367.             // The decision tree for the NPC.
  368.             //
  369.             // The decision tree here allows us to check character abilities (through combat), allies (through combat)
  370.             // current conversation responses and events all in one place.
  371.             //
  372.             // You can use "import" or "tree" to provide the decision tree to use for this case.
  373.             // "tree" is checked first, if not available, then "import" is used. If both are missing, nothing is used.
  374.             //
  375.             // The decision tree allows you to define the logic as to which script should be activated and when.
  376.             "decisionTree": {
  377.  
  378.                 // This is checked first, if not provided, the "usingTree" is checked.
  379.                 // Import a pre-configured tree here by ID.
  380.                 //"treeId": "TREE_ID",
  381.        
  382.                 // Checked when "treeId" isn't available.
  383.                 "usingTree": {
  384.                     "root": {
  385.                         // Execute each child until one of them succeeds, or they all fail.
  386.                         "priority": {
  387.                             "id": "PRIORITY_NPC_SAM_CONVERSATION",
  388.                             "children": {
  389.                            
  390.                                 // Initial conversation entry.
  391.                                 "count-limit": {
  392.                                     "id": "SAM_INITIAL_CONVERSATION_COUNT",
  393.                                      "limit": 1,
  394.                                     "incrementPolicy": "success",
  395.                                      "allowReinitialize": false,
  396.                                     "children": {
  397.                                         "task": {
  398.                                             "id": "SAM_INITIAL_CONVERSATION_TASK_NODE",
  399.                                             "using": {
  400.                                                 "id": "FOUND_LAKE_TASK",
  401.                                                 "action": {
  402.                                                     "conversationAction": {
  403.  
  404.                                                         // The title does not need to change each time.
  405.                                                         // If not provided, the previous conversation step will be used.
  406.                                                         "title": {
  407.                                                             "default": "{Angry face}...."
  408.                                                         },
  409.  
  410.                                                         // We only need to assign a new face when we want it changed.
  411.                                                         // Otherwise, it will use the previous conversation response face.
  412.                                                         "face": {
  413.                                                             "id": "NPC_SAM",
  414.                                                             "icon": "general",
  415.                                                             "position": "right"
  416.                                                         },
  417.  
  418.                                                         // This is used to determine how you'd like to have the text displayed.
  419.                                                         // progressive - text is displayed showing only a partial amount and increasing over time until completed.
  420.                                                         // instant - shows the entire text all at once.
  421.                                                         "displayStyle": "progressive",
  422.  
  423.                                                         "responseText": {
  424.                                                             "default": "Bill ! You're late again.\nHow do you ever expect to become a decent apprentice ?"
  425.                                                         },
  426.                                                         "autoResponse": {
  427.                                                        
  428.                                                             // How long to wait until moving onto the response.
  429.                                                             "waitDuration": 5,
  430.                                                            
  431.                                                             // The response to move onto.
  432.                                                             "responseId": "NPC_SAM_HELLO_FINISHED"
  433.                                                         }
  434.                                                     }
  435.                                                 },
  436.                                                 "triggers": {
  437.                                                     "logical": {
  438.                                                         "matches": [
  439.                                                             {
  440.                                                                 "matchExpressions": {
  441.                                                                     "conversation": {
  442.                                                                         // Normally to match for a conversation you will want to look for the previous response ID.
  443.                                                                         // However, in the cases when this is the initial conversation, that ID is not available.
  444.                                                                         // This flag allows you to indicate to the match that we're looking for the case when the ID was not provided.
  445.                                                                         "initial": true
  446.                                                                     }
  447.                                                                 }
  448.                                                             }
  449.                                                         ]
  450.                                                     }
  451.                                                 }
  452.                                             }
  453.                                         }
  454.                                     }
  455.                                 },
  456.  
  457.                                 "task": {
  458.                                     "id": "NPC_BILL_FIRST_RESPONSE_TASK_NODE",
  459.                                     "using": {
  460.                                         "id": "NPC_BILL_FIRST_RESPONSE_TASK",
  461.                                         "action": {
  462.                                             "conversationAction": {
  463.  
  464.                                                 "title": {
  465.                                                     "default": "Bill:"
  466.                                                 },
  467.  
  468.                                                 "face": {
  469.                                                     "id": "NPC_BILL",
  470.                                                     "icon": "general",
  471.                                                     "position": "left"
  472.                                                 },
  473.  
  474.                                                 "displayStyle": "progressive",
  475.  
  476.                                                 "responseText": {
  477.                                                     "default": "But..but...I'm here now; that counts...right ?"
  478.                                                 },
  479.                                                 "autoResponse": {
  480.                                                     "waitDuration": 4,
  481.                                                     "responseId": "NPC_BILL_FIRST_RESPONSE_FINISHED"
  482.                                                 }
  483.                                             }
  484.                                         },
  485.                                         "triggers": {
  486.                                             "simple": {
  487.                                                 "conversation": {
  488.                                                     "responseId": "NPC_SAM_HELLO_FINISHED"
  489.                                                 }
  490.                                             }
  491.                                         }
  492.                                     }
  493.                                 },
  494.  
  495.                                 "task": {
  496.                                     "id": "NPC_BILL_FIRST_RESPONSE_TASK_NODE",
  497.                                     "using": {
  498.                                         "id": "NPC_BILL_FIRST_RESPONSE_TASK",
  499.                                         "action": {
  500.                                             "conversationAction": {
  501.  
  502.                                                 "title": {
  503.                                                     "default": "Sam:"
  504.                                                 },
  505.  
  506.                                                 "face": {
  507.                                                     "id": "NPC_SAM",
  508.                                                     "icon": "general",
  509.                                                     "position": "right"
  510.                                                 },
  511.  
  512.                                                 "displayStyle": "progressive",
  513.  
  514.                                                 "responseText": {
  515.                                                     "default": "Bill...Bill...Bill...what will I ever do with you.\nAt least you've started the fire pit without screwing that up."
  516.                                                 },
  517.                                                 "autoResponse": {
  518.                                                     "waitDuration": 7,
  519.                                                     "responseId": "NARRATOR_FIRST"
  520.                                                 }
  521.                                             }
  522.                                         },
  523.                                         "triggers": {
  524.                                             "simple": {
  525.                                                 "conversation": {
  526.                                                     "responseId": "NPC_BILL_FIRST_RESPONSE_FINISHED"
  527.                                                 }
  528.                                             }
  529.                                         }
  530.                                     }
  531.                                 },
  532.  
  533.                                 "task": {
  534.                                     "id": "NPC_BILL_FIRST_RESPONSE_TASK_NODE",
  535.                                     "using": {
  536.                                         "id": "NPC_BILL_FIRST_RESPONSE_TASK",
  537.                                         "action": {
  538.                                             "conversationAction": {
  539.  
  540.                                                 "title": {
  541.                                                     "default": "Narrator:"
  542.                                                 },
  543.  
  544.                                                 "face": {
  545.                                                     "position": "none"
  546.                                                 },
  547.  
  548.                                                 "displayStyle": "instant",
  549.  
  550.                                                 "responseText": {
  551.                                                     "default": "...{All of a sudden}..."
  552.                                                 },
  553.                                                 "autoResponse": {
  554.                                                     "waitDuration": 2,
  555.                                                     "responseId": "CONVERSATION_CLOSE"
  556.                                                 }
  557.                                             }
  558.                                         },
  559.                                         "triggers": {
  560.                                             "simple": {
  561.                                                 "conversation": {
  562.                                                     "responseId": "NARRATOR_FIRST"
  563.                                                 }
  564.                                             }
  565.                                         }
  566.                                     }
  567.                                 },
  568.  
  569.                                 // The final task in the conversation.
  570.                                 "task": {
  571.                                     "id": "CONVERSATION_CLOSE_TASK_NODE",
  572.                                     "using": {
  573.                                         "id": "CONVERSATION_CLOSE_TASK",
  574.                                         "action": {
  575.                                        
  576.                                             // Close out the conversation window.
  577.                                             "conversationAction": {
  578.                                                 "conversationCompleted": true
  579.                                             },
  580.  
  581.                                             // Setup event actions for continued cut-scene display from the main tree.
  582.                                             "eventActions": {
  583.  
  584.                                                 // Set a trigger so that the map decision tree can do additional work.
  585.                                                 "trigger": {
  586.                                                     "eventId": "TOWN_CUT_SCENE",
  587.                                                     "triggerId": "TREE_CATCHES_FIRE"
  588.                                                 }
  589.                                             }
  590.                                         },
  591.                                         "triggers": {
  592.                                             "simple": {
  593.                                                 "conversation": {
  594.                                                     "responseId": "CONVERSATION_CLOSE"
  595.                                                 }
  596.                                             }
  597.                                         }
  598.                                     }
  599.                                 } // end
  600.                             }
  601.                         }
  602.                     }
  603.                 }
  604.             }
  605.         },
  606.  
  607.         {
  608.             "id": "NPC_BILL",
  609.             "displayName": {
  610.                 "default": "Bill"
  611.             },
  612.  
  613.             // The atlas file to load for the sprite graphics.
  614.             // NPC atlas files are different from playable/monsters because they are not scaled for screen sizes and are constant.
  615.             // Thus we do not provide a key for the sizes like we do for those and instead just load the one atlas for all sizes.
  616.             "spriteAtlas": "spriter/npc/four_directional/directional.atlas",
  617.  
  618.             // The file path to the SCML data.
  619.             "spriteScml": "spriter/npc/four_directional/directional.json",
  620.        
  621.             // The name of the entity to load from the SCML.
  622.             "spriteEntityName": "Knight",
  623.  
  624.             // If you want to have certain character maps applied upon creation, assign them now.
  625.             // Character map names used should be obtained from the animator character map types.
  626.             // For example: com.netprogs.mobile.games.rpg.sprites.creatures.animators.NpcSpriteAnimator.CharacterMap (or customs like it)
  627.             "spriteCharacterMaps": [ "archer" ],
  628.  
  629.             // This is the sprite animator you wish to use to build the animations from the atlas above.
  630.             // We leave these as a "loose" connection between core and the game itself because we want to allow us to be
  631.             // able to create as many various animators we want without having to update the core code to do so.
  632.             "spriteAnimator": "npc",
  633.  
  634.             // Overrides inherited if provided.
  635.             // Atlas that contains all the require icons for this creature.
  636.             // These can be generated any way wanted, but you must follow the naming patterns defined to ensure matching animations.
  637.             "iconAtlas": "spriter/npc/four_directional/npc_archer_icons.atlas",
  638.  
  639.             // Adds to the list of inherited if provided.
  640.             // This is a "loose" connection between the atlas and the code allowing us to define icon textures within it.
  641.             // Each unique key/value in the list is combined with the parent. If same keys are used, these override parent.
  642.             "icons": {
  643.  
  644.                 "general": {
  645.  
  646.                     // 32x32
  647.                     "small": "general_small",
  648.  
  649.                     // 64x64
  650.                     "large": "general_large"
  651.                 }
  652.             },
  653.  
  654.             // [OPTIONAL] This is the list of available paths for the NPC to take.
  655.             "paths": {
  656.  
  657.                 "ENTER_TO_TREE": {
  658.                     "startPointId": "NPC_BILL_START_POINT",
  659.                     "endPointId": "NPC_BILL_END_POINT",
  660.                     "faceDirection": "right",
  661.                     "cameraCentered": true,
  662.                     "decisionWhenCompleted": false
  663.                 },
  664.                
  665.                 "TREE_TO_EXIT": {
  666.                     "startPointId": "NPC_BILL_END_POINT",
  667.                     "endPointId": "NPC_BILL_START_POINT",
  668.                     "faceDirection": "left",
  669.                     "removeWhenCompleted": true,
  670.                     "cameraCentered": false,
  671.                     "forcePlayerWait": false
  672.                 }
  673.             },
  674.  
  675.             // [OPTIONAL] This is the list of available paths for the NPC to take.
  676.             "animations": {
  677.  
  678.                 // Make bill fiddle on the ground (start fire pit)
  679.                 "FIDDLE": {
  680.                     "animation": "action",
  681.                     "alternateAnimation": "horizontal_fiddle",
  682.                     "animationSound": {
  683.                         "sound": "data/music/effects/spells/explode5_new.ogg",
  684.                         "looping": false,
  685.                         "delay": 1000
  686.                     },
  687.                     "runningFaceDirection": "right"
  688.                 }
  689.             }
  690.         }
  691.     ],
  692.  
  693.     // This decision tree is called upon every render call regardless of movement.
  694.     "decisionTree": {
  695.    
  696.         // Checked when "treeId" isn't available.
  697.         "usingTree": {
  698.             "root": {
  699.  
  700.                 // Execute each child until one of the succeeds, or they all fail.
  701.                 "priority": {
  702.                     "id": "PRIORITY_NODE_EVENT_TOWN_CUT_SCENE",
  703.                     "children": {
  704.  
  705.                         // Initial scene load should cause the camera to scan across the map.
  706.                         "count-limit": {
  707.                             "id": "COUNT_CUT_SCENE_EVENT_STORYLINE_TASK_NODE",
  708.                              "limit": 1,
  709.                             "incrementPolicy": "success",
  710.                              "allowReinitialize": false,
  711.                             "children": {
  712.                                 "task": {
  713.                                     "id": "CUT_SCENE_EVENT_STORYLINE_TASK_NODE",
  714.                                     "using": {
  715.                                         "id": "CUT_SCENE_EVENT_STORYLINE_TASK",
  716.                                         "action": {
  717.                                             "eventActions": {
  718.  
  719.                                                 // This allows us to make some minor changes to the player sprite itself.
  720.                                                 // If you wish to have advanced features, set visible here to false and create a
  721.                                                 // separate NPC variation of the player instead for the advanced features.
  722.                                                 "updatePlayerSprite": {
  723.                                                
  724.                                                     // Should the player sprite be visible on the screen
  725.                                                     // This overrides the map setting if it was provided.
  726.                                                     "visible": false,
  727.                                                    
  728.                                                     // Blocks player from movement on the map.
  729.                                                     "forcePlayerWait": true,
  730.                
  731.                                                     // Check to see if the navigation console should be displayed or not.
  732.                                                     // This does not block user input, only hides the console.
  733.                                                     // To block the user input (also or instead) you can do so by setting the visible field to false.
  734.                                                     "hideNavigationConsole": true
  735.                                                    
  736.                                                     // If you want to have certain character maps applied, assign them now.
  737.                                                     // Character map names used should be obtained from the animator character map types.
  738.                                                     // SEE: com.netprogs.mobile.games.rpg.sprites.creatures.animators.DirectionalSpriteAnimator.CharacterMap (or customs like it)
  739.                                                     //"characterMaps": {
  740.                                                     //    "apply": [ "archer" ]
  741.                                                     //    "remove": [ "mage" ]
  742.                                                     //},
  743.                                                 },
  744.  
  745.                                                 // Story override
  746.                                                 //"trigger": {
  747.                                                 //    "eventId": "TOWN_CUT_SCENE",
  748.                                                 //    "triggerId": "STORY_COMPLETED"
  749.                                                 //},
  750.  
  751.                                                 // Display the story line window with a brief story.
  752.                                                 "activateStoryline": {
  753.                                                    
  754.                                                     "storylineId": "HOME_TOWN_CUT_SCENE_STORYLINE",
  755.                                                    
  756.                                                     // The list of triggers to invoke once the story is completed.
  757.                                                     "completedTriggers": [
  758.                                                         {
  759.                                                             "eventId": "TOWN_CUT_SCENE",
  760.                                                             "triggerId": "STORY_COMPLETED"
  761.                                                         }
  762.                                                     ]
  763.                                                 }
  764.                                             }
  765.                                         },
  766.        
  767.                                         // The cut scene task should only execute when the INITIAL_CAMERA_COMPLETED is false.
  768.                                         "triggers": {
  769.                                             "logical": {
  770.                                                 "matches": [
  771.                                                     {
  772.                                                         "matchExpressions": {
  773.                                                             "event": {
  774.                                                                 "eventId": "TOWN_CUT_SCENE",
  775.                                                                 "triggerId": "STORY_COMPLETED",
  776.                                                                 "triggered": false
  777.                                                             }
  778.                                                         }
  779.                                                     }
  780.                                                 ]
  781.                                             }
  782.                                         }
  783.                                     }
  784.                                 }
  785.                             }
  786.                         },
  787.  
  788.                         // Initial scene load should cause the camera to scan across the map.
  789.                         "count-limit": {
  790.                             "id": "COUNT_CUT_SCENE_EVENT_CAMERA_PATH_TASK_NODE",
  791.                              "limit": 1,
  792.                             "incrementPolicy": "success",
  793.                              "allowReinitialize": false,
  794.                             "children": {
  795.                                 "task": {
  796.                                     "id": "CUT_SCENE_EVENT_CAMERA_PATH_TASK_NODE",
  797.                                     "using": {
  798.                                         "id": "CUT_SCENE_EVENT_CAMERA_PATH_TASK",
  799.                                         "action": {
  800.                                             "eventActions": {
  801.  
  802.                                                 // Camera override
  803.                                                 //"trigger": {
  804.                                                 //    "eventId": "TOWN_CUT_SCENE",
  805.                                                 //    "triggerId": "INITIAL_CAMERA_COMPLETED"
  806.                                                 //},
  807.  
  808.                                                 // Causes the camera to follow the path provided on the current map.
  809.                                                 // NOTE: This blocks the player movement during this time and is removed upon completion.
  810.                                                 // NOTE: Be careful not to have any player/NPC camera follows at the same time.
  811.                                                 "followCameraPath": {
  812.                
  813.                                                     // Provide a polyline or polygon path ID from the current map that defines an exact path to follow.
  814.                                                     "coordinatePathId": "TOWN_NPC_COORD_PATH",
  815.                                                
  816.                                                     // The speed, in percent of "normal", that the camera should be moved at.
  817.                                                     "speed": 1,
  818.                
  819.                                                     // The list of triggers to invoke once the camera path is completed.
  820.                                                     "completedTriggers": [
  821.                                                         {
  822.                                                             "eventId": "TOWN_CUT_SCENE",
  823.                                                             "triggerId": "INITIAL_CAMERA_COMPLETED"
  824.                                                         }
  825.                                                     ]
  826.                                                 }
  827.                                             }
  828.                                         },
  829.        
  830.                                         // The cut scene task should only execute when the INITIAL_CAMERA_COMPLETED is false.
  831.                                         "triggers": {
  832.                                             "logical": {
  833.                                                 "matches": [
  834.                                                     {
  835.                                                         "matchExpressions": {
  836.                                                             "event": {
  837.                                                                 "eventId": "TOWN_CUT_SCENE",
  838.                                                                 "triggerId": "INITIAL_CAMERA_COMPLETED",
  839.                                                                 "triggered": false
  840.                                                             },
  841.                                                             "event": {
  842.                                                                 "eventId": "TOWN_CUT_SCENE",
  843.                                                                 "triggerId": "STORY_COMPLETED",
  844.                                                                 "triggered": true
  845.                                                             }
  846.                                                         }
  847.                                                     }
  848.                                                 ]
  849.                                             }
  850.                                         }
  851.                                     }
  852.                                 }
  853.                             }
  854.                         },
  855.  
  856.                         // Once the camera is done the path, load in the first NPC (Sam)
  857.                         "count-limit": {
  858.                             "id": "COUNT_CUT_SCENE_EVENT_LOAD_SAM_NPC_TASK_NODE",
  859.                              "limit": 1,
  860.                             "incrementPolicy": "success",
  861.                              "allowReinitialize": false,
  862.                             "children": {
  863.                                 "task": {
  864.                                     "id": "CUT_SCENE_EVENT_LOAD_SAM_NPC_TASK_NODE",
  865.                                     "using": {
  866.                                         "id": "CUT_SCENE_EVENT_LOAD_SAM_NPC_TASK",
  867.                                         "action": {
  868.                                             "eventActions": {
  869.                                                 "updateNpcSprite": {
  870.                                                     "npcId": "NPC_SAM",
  871.                                                     "npcPathId": "ENTER_TO_TREE",
  872.                                                     "npcPathCompletedTriggers": [
  873.                                                         {
  874.                                                             "eventId": "TOWN_CUT_SCENE",
  875.                                                             "triggerId": "NPC_SAM_LOADED"
  876.                                                         }
  877.                                                     ]
  878.                                                 }
  879.                                             }
  880.                                         },
  881.                                         "triggers": {
  882.                                             "logical": {
  883.                                                 "matches": [
  884.                                                     {
  885.                                                         "matchExpressions": {
  886.                                                             "event": {
  887.                                                                 "eventId": "TOWN_CUT_SCENE",
  888.                                                                 "triggerId": "INITIAL_CAMERA_COMPLETED",
  889.                                                                 "triggered": true
  890.                                                             },
  891.                                                             "event": {
  892.                                                                 "eventId": "TOWN_CUT_SCENE",
  893.                                                                 "triggerId": "NPC_SAM_LOADED",
  894.                                                                 "triggered": false
  895.                                                             }
  896.                                                         }
  897.                                                     }
  898.                                                 ]
  899.                                             }
  900.                                         }
  901.                                     }
  902.                                 }
  903.                             }
  904.                         },
  905.  
  906.                         // Make Sam curse because Bill isn't here yet.
  907.                         "count-limit": {
  908.                             "id": "COUNT_CUT_SCENE_EVENT_SAM_CURSE_NPC_TASK_NODE",
  909.                              "limit": 1,
  910.                             "incrementPolicy": "success",
  911.                              "allowReinitialize": false,
  912.                             "children": {
  913.                                 "task": {
  914.                                     "id": "CUT_SCENE_EVENT_SAM_CURSE_NPC_TASK_NODE",
  915.                                     "using": {
  916.                                         "id": "CUT_SCENE_EVENT_SAM_CURSE_NPC_TASK",
  917.                                         "action": {
  918.  
  919.                                             "eventActions": {
  920.  
  921.                                                 "activateCaption": {
  922.                                                
  923.                                                     // This is the ID of the sprite you wish to place the caption above.
  924.                                                     // If the ID is not provided, then the player sprite is used.
  925.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  926.                                                     // then this caption is not displayed.
  927.                                                     "id": "NPC_SAM",
  928.    
  929.                                                     // The list of triggers to invoke once the caption display has completed.
  930.                                                     "completedTriggers": [
  931.                                                         {
  932.                                                             "eventId": "TOWN_CUT_SCENE",
  933.                                                             "triggerId": "NPC_SAM_CURSED"
  934.                                                         }
  935.                                                     ],
  936.  
  937.                                                     // This is the configuration elements for the caption itself.
  938.                                                     "caption": {
  939.    
  940.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  941.                                                         "text": {
  942.                                                             "default": "#$@#, He's late !!!"
  943.                                                         },
  944.                                
  945.                                                         // OPTIONAL
  946.                                                         // The caption style (bubble type).
  947.                                                         // TODO: For now there is only one, but we'll add more later.
  948.                                                         //"captionStyle": true,
  949.                                                        
  950.                                                         // OPTIONAL
  951.                                                         // This can be any style available to the Label.
  952.                                                         "textStyle": "caption",
  953.                                
  954.                                                         // OPTIONAL
  955.                                                         // The amount of time to delay before showing the text.
  956.                                                         "delayDisplayDuration": 0f,
  957.                                
  958.                                                         // OPTIONAL
  959.                                                         // The amount of time to delay before starting the fade effect on the text.
  960.                                                         "delayFadeDuration": 2.0,
  961.                                                        
  962.                                                         // OPTIONAL
  963.                                                         // The amount of time to decrease the fade by each increment.
  964.                                                         // The higher the number, the longer it takes to fade.
  965.                                                         "fadeDuration": 0.75
  966.                                                     }
  967.                                                 }
  968.                                             }
  969.                                         },
  970.                                         "triggers": {
  971.                                             "logical": {
  972.                                                 "matches": [
  973.                                                     {
  974.                                                         "matchExpressions": {
  975.                                                             "event": {
  976.                                                                 "eventId": "TOWN_CUT_SCENE",
  977.                                                                 "triggerId": "INITIAL_CAMERA_COMPLETED",
  978.                                                                 "triggered": true
  979.                                                             },
  980.                                                             "event": {
  981.                                                                 "eventId": "TOWN_CUT_SCENE",
  982.                                                                 "triggerId": "NPC_SAM_LOADED",
  983.                                                                 "triggered": true
  984.                                                             }
  985.                                                         }
  986.                                                     }
  987.                                                 ]
  988.                                             }
  989.                                         }
  990.                                     }
  991.                                 }
  992.                             }
  993.                         },
  994.  
  995.                         // Once the camera is done the path, load in the second NPC (Bill), but only after the first.
  996.                         "count-limit": {
  997.                             "id": "COUNT_CUT_SCENE_EVENT_LOAD_BILL_NPC_TASK_NODE",
  998.                              "limit": 1,
  999.                             "incrementPolicy": "success",
  1000.                              "allowReinitialize": false,
  1001.                             "children": {
  1002.                                 "task": {
  1003.                                     "id": "CUT_SCENE_EVENT_LOAD_BILL_NPC_TASK_NODE",
  1004.                                     "using": {
  1005.                                         "id": "CUT_SCENE_EVENT_LOAD_BILL_NPC_TASK",
  1006.                                         "action": {
  1007.                                             "eventActions": {
  1008.                                                 "updateNpcSprite": {
  1009.                                                     "npcId": "NPC_BILL",
  1010.                                                     "npcPathId": "ENTER_TO_TREE",
  1011.                                                     "npcPathCompletedTriggers": [
  1012.                                                         {
  1013.                                                             "eventId": "TOWN_CUT_SCENE",
  1014.                                                             "triggerId": "NPC_BILL_LOADED"
  1015.                                                         }
  1016.                                                     ]
  1017.                                                 },
  1018.                                                
  1019.                                                 // Displays the caption while he's running.
  1020.                                                 "activateCaption": {
  1021.                                                
  1022.                                                     // This is the ID of the sprite you wish to place the caption above.
  1023.                                                     // If the ID is not provided, then the player sprite is used.
  1024.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  1025.                                                     // then this caption is not displayed.
  1026.                                                     "id": "NPC_BILL",
  1027.  
  1028.                                                     // This is the configuration elements for the caption itself.
  1029.                                                     "caption": {
  1030.    
  1031.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  1032.                                                         "text": {
  1033.                                                             "default": "Wait ! I'm on my way !"
  1034.                                                         },
  1035.  
  1036.                                                         // OPTIONAL
  1037.                                                         // The caption style (bubble type).
  1038.                                                         // TODO: For now there is only one, but we'll add more later.
  1039.                                                         //"captionStyle": true,
  1040.                                                        
  1041.                                                         // OPTIONAL
  1042.                                                         // This can be any style available to the Label.
  1043.                                                         "textStyle": "caption",
  1044.                                
  1045.                                                         // OPTIONAL
  1046.                                                         // The amount of time to delay before showing the text.
  1047.                                                         "delayDisplayDuration": 0f,
  1048.                                
  1049.                                                         // OPTIONAL
  1050.                                                         // The amount of time to delay before starting the fade effect on the text.
  1051.                                                         "delayFadeDuration": 2.0,
  1052.                                                        
  1053.                                                         // OPTIONAL
  1054.                                                         // The amount of time to decrease the fade by each increment.
  1055.                                                         // The higher the number, the longer it takes to fade.
  1056.                                                         "fadeDuration": 0.75
  1057.                                                     }
  1058.                                                 }
  1059.                                             }
  1060.                                         },
  1061.                                         "triggers": {
  1062.                                             "logical": {
  1063.                                                 "matches": [
  1064.                                                     {
  1065.                                                         "matchExpressions": {
  1066.                                                             "event": {
  1067.                                                                 "eventId": "TOWN_CUT_SCENE",
  1068.                                                                 "triggerId": "NPC_SAM_CURSED",
  1069.                                                                 "triggered": true
  1070.                                                             },
  1071.                                                             "event": {
  1072.                                                                 "eventId": "TOWN_CUT_SCENE",
  1073.                                                                 "triggerId": "NPC_BILL_LOADED",
  1074.                                                                 "triggered": false
  1075.                                                             }
  1076.                                                         }
  1077.                                                     }
  1078.                                                 ]
  1079.                                             }
  1080.                                         }
  1081.                                     }
  1082.                                 }
  1083.                             }
  1084.                         },
  1085.  
  1086.                         // Now that Bill has loaded and run over to the tree, get him to start the fire pit.
  1087.                         "count-limit": {
  1088.                             "id": "COUNT_CUT_SCENE_EVENT_BILL_START_FIRE_TASK_NODE",
  1089.                              "limit": 1,
  1090.                             "incrementPolicy": "success",
  1091.                              "allowReinitialize": false,
  1092.                             "children": {
  1093.                                 "task": {
  1094.                                     "id": "CUT_SCENE_EVENT_BILL_START_FIRE_TASK_NODE",
  1095.                                     "using": {
  1096.                                         "id": "CUT_SCENE_EVENT_BILL_START_FIRE_TASK",
  1097.                                         "action": {
  1098.                                             "eventActions": {
  1099.                                                 "updateNpcSprite": {
  1100.  
  1101.                                                     "npcId": "NPC_BILL",
  1102.  
  1103.                                                     // If you wish the NPC to run an animation, set the ID of that animation here.
  1104.                                                     "npcAnimationId": "FIDDLE",
  1105.  
  1106.                                                     // The list of triggers to invoke once the animation is completed.
  1107.                                                     // NOTE: This does not get activated if using a looping animation.
  1108.                                                     "npcAnimationCompletedTriggers": [
  1109.                                                         {
  1110.                                                             "eventId": "TOWN_CUT_SCENE",
  1111.                                                             "triggerId": "NPC_BILL_STARTED_FIRE"
  1112.                                                         }
  1113.                                                     ]
  1114.                                                 }
  1115.                                             }
  1116.                                         },
  1117.                                         "triggers": {
  1118.                                             "logical": {
  1119.                                                 "matches": [
  1120.                                                     {
  1121.                                                         "matchExpressions": {
  1122.                                                             "event": {
  1123.                                                                 "eventId": "TOWN_CUT_SCENE",
  1124.                                                                 "triggerId": "NPC_BILL_LOADED",
  1125.                                                                 "triggered": true
  1126.                                                             }
  1127.                                                         }
  1128.                                                     }
  1129.                                                 ]
  1130.                                             }
  1131.                                         }
  1132.                                     }
  1133.                                 }
  1134.                             }
  1135.                         },
  1136.  
  1137.                         // Now that Bill has loaded and run over to the tree, get him to start the fire pit.
  1138.                         "count-limit": {
  1139.                             "id": "COUNT_CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK_NODE",
  1140.                              "limit": 1,
  1141.                             "incrementPolicy": "success",
  1142.                              "allowReinitialize": false,
  1143.                             "children": {
  1144.                                 "task": {
  1145.                                     "id": "CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK_NODE",
  1146.                                     "using": {
  1147.                                         "id": "CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK",
  1148.                                         "action": {
  1149.                                             "eventActions": {
  1150.  
  1151.                                                 // Show the fire pit layer.
  1152.                                                 "activateMapLayer": {
  1153.                                                     "mapLayerId": "Foreground_FirePit",
  1154.                                                     "visible": true,
  1155.                                                     "opacity": 1.00
  1156.                                                 },
  1157.  
  1158.                                                 // Show the light source for the fire pit.
  1159.                                                 "activateLightPoint": {
  1160.                                                     "mapPointId": "FIRE_PIT_LIGHT",
  1161.                                                     "active": true
  1162.                                                 },
  1163.  
  1164.                                                 // Move Sam forward.
  1165.                                                 "updateNpcSprite": {
  1166.                                                     "npcId": "NPC_SAM",
  1167.                                                     "npcPathId": "STEP_TO_FIRE_PIT",
  1168.                                                     "npcPathCompletedTriggers": [
  1169.                                                         {
  1170.                                                             "eventId": "TOWN_CUT_SCENE",
  1171.                                                             "triggerId": "NPC_SAM_STEPPED_TO_FIREPIT"
  1172.                                                         }
  1173.                                                     ]
  1174.                                                 }
  1175.                                             }
  1176.                                         },
  1177.                                         "triggers": {
  1178.                                             "logical": {
  1179.                                                 "matches": [
  1180.                                                     {
  1181.                                                         "matchExpressions": {
  1182.                                                             "event": {
  1183.                                                                 "eventId": "TOWN_CUT_SCENE",
  1184.                                                                 "triggerId": "NPC_BILL_STARTED_FIRE",
  1185.                                                                 "triggered": true
  1186.                                                             }
  1187.                                                         }
  1188.                                                     }
  1189.                                                 ]
  1190.                                             }
  1191.                                         }
  1192.                                     }
  1193.                                 }
  1194.                             }
  1195.                         },
  1196.  
  1197.                         // Now that Sam has run over to the pit, make him start a conversation with Bill.
  1198.                         "count-limit": {
  1199.                             "id": "COUNT_CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK_NODE",
  1200.                              "limit": 1,
  1201.                             "incrementPolicy": "success",
  1202.                              "allowReinitialize": false,
  1203.                             "children": {
  1204.                                 "task": {
  1205.                                     "id": "CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK_NODE",
  1206.                                     "using": {
  1207.                                         "id": "CUT_SCENE_EVENT_BILL_FIRE_STARTED_TASK",
  1208.                                         "action": {
  1209.                                             "eventActions": {
  1210.  
  1211.                                                 // Start Sam's conversation by running his tree.
  1212.                                                 // You do not want to have conversations in the main decision tree because it gets called too often.
  1213.                                                 // By placing conversations into the NPC tree, we allow it to be called only upon each conversation step.
  1214.                                                 "updateNpcSprite": {
  1215.                                                     "npcId": "NPC_SAM",
  1216.                                                     "executeDecision": true
  1217.                                                 }
  1218.                                             }
  1219.                                         },
  1220.                                         "triggers": {
  1221.                                             "logical": {
  1222.                                                 "matches": [
  1223.                                                     {
  1224.                                                         "matchExpressions": {
  1225.                                                             "event": {
  1226.                                                                 "eventId": "TOWN_CUT_SCENE",
  1227.                                                                 "triggerId": "NPC_BILL_STARTED_FIRE",
  1228.                                                                 "triggered": true
  1229.                                                             }
  1230.                                                         }
  1231.                                                     }
  1232.                                                 ]
  1233.                                             }
  1234.                                         }
  1235.                                     }
  1236.                                 }
  1237.                             }
  1238.                         },
  1239.  
  1240.                         // Picking up where the conversation ended. The tree should now catch on fire !
  1241.                         "count-limit": {
  1242.                             "id": "COUNT_CUT_SCENE_EVENT_TREE_CATCHES_FIRE_TASK_NODE",
  1243.                              "limit": 1,
  1244.                             "incrementPolicy": "success",
  1245.                              "allowReinitialize": false,
  1246.                             "children": {
  1247.                                 "task": {
  1248.                                     "id": "CUT_SCENE_EVENT_TREE_CATCHES_FIRE_TASK_NODE",
  1249.                                     "using": {
  1250.                                         "id": "CUT_SCENE_EVENT_TREE_CATCHES_FIRE_TASK",
  1251.                                         "action": {
  1252.                                             "eventActions": {
  1253.  
  1254.                                                 // This displays an effect animation on the screen in the map point location provided.
  1255.                                                 "displayEffectAnimation": {
  1256.        
  1257.                                                     // The "mapPointId" from "animationPoints" to place the effect within the current map.
  1258.                                                     "animationPointId": "ANIMATION_POINT",
  1259.        
  1260.                                                     // The ID of the sprite effect to animate
  1261.                                                     // See com.netprogs.mobile.games.rpg.sprites.effects.EffectSpriteType for the list of available effect sprite's.
  1262.                                                     "effect": "fire-wall",
  1263.        
  1264.                                                     // This is which layer on the map you wish to have the animation placed.
  1265.                                                     // behind: For animations that the player should "stand in front of" (the objects are in BEHIND them).
  1266.                                                     // front: For animations that the player should "stand behind" (the objects are in FRONT of them).
  1267.                                                     "placement": "behind",
  1268.        
  1269.                                                     // Set the play mode of the animation.
  1270.                                                     // See com.netprogs.mobile.games.rpg.sprites.effects.EffectSpritePlayMode
  1271.                                                     "playMode": "loop",
  1272.        
  1273.                                                     // OPTIONAL
  1274.                                                     // This is the sound to play while the effect sprite is having the animation shown.
  1275.                                                     "sound": {
  1276.        
  1277.                                                         // Path to the sound file to play. This file CANNOT be more than 1MB large due to Android restrictions.
  1278.                                                         // Libgdx supports MP3, OGG and WAV files. RoboVM (iOS) currently does not support OGG files.
  1279.                                                         "sound": "data/music/effects/spells/explode1_new.ogg",
  1280.        
  1281.                                                         // If you want the sound to loop, set to true.
  1282.                                                         "looping": false,
  1283.        
  1284.                                                         // OPTIONAL
  1285.                                                         // Normally the sound will be played immediately along with the animation.
  1286.                                                         // Should you want to delay the sound for a period of time first, add that time here in milliseconds.
  1287.                                                         "delay": 100
  1288.                                                     }
  1289.  
  1290.                                                     // The list of triggers to invoke once the animation is completed.
  1291.                                                     // This only gets called on non-looping sounds.
  1292.                                                     //"completedTriggers": [
  1293.                                                     //    {
  1294.                                                     //        "eventId": "LEAVE_TOWN_EVENT",
  1295.                                                     //        "triggerId": "SPAWNED_TOWN_NPC"
  1296.                                                     //    }
  1297.                                                     //]
  1298.                                                 },
  1299.  
  1300.                                                 // Turn on the layer showing additional fire damage.
  1301.                                                 "activateMapLayer": {
  1302.                                                     "mapLayerId": "Foreground_Fire",
  1303.                                                     "visible": true,
  1304.                                                     "opacity": 1.00
  1305.                                                 },
  1306.                                                
  1307.                                                 // Activate the light for the fire.
  1308.                                                 "activateLightPoint": {
  1309.                                                     "mapPointId": "TREE_FIRE_LIGHT",
  1310.                                                     "active": true
  1311.                                                 },
  1312.  
  1313.                                                 // Make Bill face looking up.
  1314.                                                 "updateNpcSprite": {
  1315.                                                     "npcId": "NPC_BILL",
  1316.                                                     "faceDirection": "up"
  1317.                                                 },
  1318.  
  1319.                                                 // Displays the caption while he's running.
  1320.                                                 "activateCaption": {
  1321.                                                
  1322.                                                     // This is the ID of the sprite you wish to place the caption above.
  1323.                                                     // If the ID is not provided, then the player sprite is used.
  1324.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  1325.                                                     // then this caption is not displayed.
  1326.                                                     "id": "NPC_BILL",
  1327.    
  1328.                                                     // The list of triggers to invoke once the caption display has completed.
  1329.                                                     "completedTriggers": [
  1330.                                                         {
  1331.                                                             "eventId": "TOWN_CUT_SCENE",
  1332.                                                             "triggerId": "NPCS_RUN_AWAY"
  1333.                                                         }
  1334.                                                     ],
  1335.  
  1336.                                                     // This is the configuration elements for the caption itself.
  1337.                                                     "caption": {
  1338.    
  1339.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  1340.                                                         "text": {
  1341.                                                             "default": "!!!???!!!"
  1342.                                                         },
  1343.  
  1344.                                                         // OPTIONAL
  1345.                                                         // The caption style (bubble type).
  1346.                                                         // TODO: For now there is only one, but we'll add more later.
  1347.                                                         //"captionStyle": true,
  1348.                                                        
  1349.                                                         // OPTIONAL
  1350.                                                         // This can be any style available to the Label.
  1351.                                                         "textStyle": "caption",
  1352.                                
  1353.                                                         // OPTIONAL
  1354.                                                         // The amount of time to delay before showing the text.
  1355.                                                         "delayDisplayDuration": 0f,
  1356.                                
  1357.                                                         // OPTIONAL
  1358.                                                         // The amount of time to delay before starting the fade effect on the text.
  1359.                                                         "delayFadeDuration": 2.0,
  1360.                                                        
  1361.                                                         // OPTIONAL
  1362.                                                         // The amount of time to decrease the fade by each increment.
  1363.                                                         // The higher the number, the longer it takes to fade.
  1364.                                                         "fadeDuration": 0.75
  1365.                                                     }
  1366.                                                 },
  1367.  
  1368.                                                 // Make Sam face looking up.
  1369.                                                 "updateNpcSprite": {
  1370.                                                     "npcId": "NPC_SAM",
  1371.                                                     "faceDirection": "up"
  1372.                                                 },
  1373.  
  1374.                                                 // Displays the caption while he's running.
  1375.                                                 "activateCaption": {
  1376.                                                
  1377.                                                     // This is the ID of the sprite you wish to place the caption above.
  1378.                                                     // If the ID is not provided, then the player sprite is used.
  1379.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  1380.                                                     // then this caption is not displayed.
  1381.                                                     "id": "NPC_SAM",
  1382.  
  1383.                                                     // This is the configuration elements for the caption itself.
  1384.                                                     "caption": {
  1385.    
  1386.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  1387.                                                         "text": {
  1388.                                                             "default": "!!!???!!!"
  1389.                                                         },
  1390.  
  1391.                                                         // OPTIONAL
  1392.                                                         // The caption style (bubble type).
  1393.                                                         // TODO: For now there is only one, but we'll add more later.
  1394.                                                         //"captionStyle": true,
  1395.                                                        
  1396.                                                         // OPTIONAL
  1397.                                                         // This can be any style available to the Label.
  1398.                                                         "textStyle": "caption",
  1399.                                
  1400.                                                         // OPTIONAL
  1401.                                                         // The amount of time to delay before showing the text.
  1402.                                                         "delayDisplayDuration": 0f,
  1403.                                
  1404.                                                         // OPTIONAL
  1405.                                                         // The amount of time to delay before starting the fade effect on the text.
  1406.                                                         "delayFadeDuration": 2.0,
  1407.                                                        
  1408.                                                         // OPTIONAL
  1409.                                                         // The amount of time to decrease the fade by each increment.
  1410.                                                         // The higher the number, the longer it takes to fade.
  1411.                                                         "fadeDuration": 0.75
  1412.                                                     }
  1413.                                                 }
  1414.                                             }
  1415.                                         },
  1416.                                         "triggers": {
  1417.                                             "logical": {
  1418.                                                 "matches": [
  1419.                                                     {
  1420.                                                         "matchExpressions": {
  1421.                                                             "event": {
  1422.                                                                 "eventId": "TOWN_CUT_SCENE",
  1423.                                                                 "triggerId": "TREE_CATCHES_FIRE",
  1424.                                                                 "triggered": true
  1425.                                                             }
  1426.                                                         }
  1427.                                                     }
  1428.                                                 ]
  1429.                                             }
  1430.                                         }
  1431.                                     }
  1432.                                 }
  1433.                             }
  1434.                         },
  1435.  
  1436.                         // Now that the tree is on fire, make the NPC's run away from it.
  1437.                         "count-limit": {
  1438.                             "id": "COUNT_CUT_SCENE_EVENT_RUN_AWAY_TASK_NODE",
  1439.                              "limit": 1,
  1440.                             "incrementPolicy": "success",
  1441.                              "allowReinitialize": false,
  1442.                             "children": {
  1443.                                 "task": {
  1444.                                     "id": "CUT_SCENE_EVENT_RUN_AWAY_TASK_NODE",
  1445.                                     "using": {
  1446.                                         "id": "CUT_SCENE_EVENT_RUN_AWAY_TASK",
  1447.                                         "action": {
  1448.                                             "eventActions": {
  1449. /*
  1450.                                                 // Play the continual fire sound.
  1451.                                                 "playSound": {
  1452.    
  1453.                                                     // Path to the sound file to play. This file CANNOT be more than 1MB large due to Android restrictions.
  1454.                                                     // Libgdx supports MP3, OGG and WAV files. RoboVM (iOS) currently does not support OGG files.
  1455.                                                     "sound": "data/music/effects/spells/explode5_new.ogg",
  1456.    
  1457.                                                     // If you want the sound to loop, set to true.
  1458.                                                     "looping": true
  1459.                                                 },
  1460. */
  1461.                                                 // Make Bill run away screaming !
  1462.                                                 "updateNpcSprite": {
  1463.                                                     "npcId": "NPC_BILL",
  1464.                                                     "npcPathId": "TREE_TO_EXIT",
  1465.                                                     "npcPathCompletedTriggers": [
  1466.                                                         {
  1467.                                                             "eventId": "TOWN_CUT_SCENE",
  1468.                                                             "triggerId": "NPC_BILL_FINISHED_RUNNING"
  1469.                                                         }
  1470.                                                     ]
  1471.                                                 },
  1472.  
  1473.                                                 // Displays the caption while he's running.
  1474.                                                 "activateCaption": {
  1475.                                                
  1476.                                                     // This is the ID of the sprite you wish to place the caption above.
  1477.                                                     // If the ID is not provided, then the player sprite is used.
  1478.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  1479.                                                     // then this caption is not displayed.
  1480.                                                     "id": "NPC_BILL",
  1481.  
  1482.                                                     // This is the configuration elements for the caption itself.
  1483.                                                     "caption": {
  1484.    
  1485.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  1486.                                                         "text": {
  1487.                                                             "default": "Run for your life !"
  1488.                                                         },
  1489.  
  1490.                                                         // OPTIONAL
  1491.                                                         // The caption style (bubble type).
  1492.                                                         // TODO: For now there is only one, but we'll add more later.
  1493.                                                         //"captionStyle": true,
  1494.                                                        
  1495.                                                         // OPTIONAL
  1496.                                                         // This can be any style available to the Label.
  1497.                                                         "textStyle": "caption",
  1498.                                
  1499.                                                         // OPTIONAL
  1500.                                                         // The amount of time to delay before showing the text.
  1501.                                                         "delayDisplayDuration": 0f,
  1502.                                
  1503.                                                         // OPTIONAL
  1504.                                                         // The amount of time to delay before starting the fade effect on the text.
  1505.                                                         "delayFadeDuration": 2.0,
  1506.                                                        
  1507.                                                         // OPTIONAL
  1508.                                                         // The amount of time to decrease the fade by each increment.
  1509.                                                         // The higher the number, the longer it takes to fade.
  1510.                                                         "fadeDuration": 0.75
  1511.                                                     }
  1512.                                                 },
  1513.  
  1514.                                                 // Make Sam run away screaming !
  1515.                                                 "updateNpcSprite": {
  1516.                                                     "npcId": "NPC_SAM",
  1517.                                                     "npcPathId": "TREE_TO_EXIT",
  1518.                                                     "npcPathCompletedTriggers": [
  1519.                                                         {
  1520.                                                             "eventId": "TOWN_CUT_SCENE",
  1521.                                                             "triggerId": "NPC_SAM_FINISHED_RUNNING"
  1522.                                                         }
  1523.                                                     ]
  1524.                                                 },
  1525.  
  1526.                                                 // Displays the caption while he's running.
  1527.                                                 "activateCaption": {
  1528.                                                
  1529.                                                     // This is the ID of the sprite you wish to place the caption above.
  1530.                                                     // If the ID is not provided, then the player sprite is used.
  1531.                                                     // If the ID is provided, but if the sprite does not exist in the current map,
  1532.                                                     // then this caption is not displayed.
  1533.                                                     "id": "NPC_SAM",
  1534.  
  1535.                                                     // This is the configuration elements for the caption itself.
  1536.                                                     "caption": {
  1537.    
  1538.                                                         // The text to display. Try to keep it short & simple as it does not wrap.
  1539.                                                         "text": {
  1540.                                                             "default": "#$@#!! apprentice..."
  1541.                                                         },
  1542.  
  1543.                                                         // OPTIONAL
  1544.                                                         // The caption style (bubble type).
  1545.                                                         // TODO: For now there is only one, but we'll add more later.
  1546.                                                         //"captionStyle": true,
  1547.                                                        
  1548.                                                         // OPTIONAL
  1549.                                                         // This can be any style available to the Label.
  1550.                                                         "textStyle": "caption",
  1551.                                
  1552.                                                         // OPTIONAL
  1553.                                                         // The amount of time to delay before showing the text.
  1554.                                                         "delayDisplayDuration": 0f,
  1555.                                
  1556.                                                         // OPTIONAL
  1557.                                                         // The amount of time to delay before starting the fade effect on the text.
  1558.                                                         "delayFadeDuration": 2.0,
  1559.                                                        
  1560.                                                         // OPTIONAL
  1561.                                                         // The amount of time to decrease the fade by each increment.
  1562.                                                         // The higher the number, the longer it takes to fade.
  1563.                                                         "fadeDuration": 0.75
  1564.                                                     }
  1565.                                                 }
  1566.  
  1567.                                                 // Cause a delay, then set the trigger for fading the screen and finishing up.
  1568.                                                 //"trigger": {
  1569.                                                 //    "eventId": "TOWN_CUT_SCENE",
  1570.                                                 //    "triggerId": "NPCS_FINISHED_RUNNING",
  1571.                                                 //    "delay": 2000
  1572.                                                 //}
  1573.                                             }
  1574.                                         },
  1575.                                         "triggers": {
  1576.                                             "logical": {
  1577.                                                 "matches": [
  1578.                                                     {
  1579.                                                         "matchExpressions": {
  1580.                                                             "event": {
  1581.                                                                 "eventId": "TOWN_CUT_SCENE",
  1582.                                                                 "triggerId": "NPCS_RUN_AWAY",
  1583.                                                                 "triggered": true
  1584.                                                             }
  1585.                                                         }
  1586.                                                     }
  1587.                                                 ]
  1588.                                             }
  1589.                                         }
  1590.                                     }
  1591.                                 }
  1592.                             }
  1593.                         },
  1594.  
  1595.                         // The NPC's have run away from the fire, so fade out the screen.
  1596.                         "count-limit": {
  1597.                             "id": "COUNT_CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK_NODE",
  1598.                              "limit": 1,
  1599.                             "incrementPolicy": "success",
  1600.                              "allowReinitialize": false,
  1601.                             "children": {
  1602.                                 "task": {
  1603.                                     "id": "CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK_NODE",
  1604.                                     "using": {
  1605.                                         "id": "CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK",
  1606.                                         "action": {
  1607.                                             "eventActions": {
  1608.  
  1609.                                                 //"trigger": {
  1610.                                                 //    "eventId": "TOWN_CUT_SCENE",
  1611.                                                 //    "triggerId": "MAP_FADE_COMPLETE"
  1612.                                                 //}
  1613.  
  1614.                                                 // Fade the current adventure map.
  1615.                                                 "fadeAdventureMap": {
  1616.                                                
  1617.                                                     // The rate in which you wish the fade to happen.
  1618.                                                     "rate": 0.3,
  1619.        
  1620.                                                     // The list of triggers to invoke once the fade is completed.
  1621.                                                     "completedTriggers": [
  1622.                                                         {
  1623.                                                             "eventId": "TOWN_CUT_SCENE",
  1624.                                                             "triggerId": "MAP_FADE_COMPLETE"
  1625.                                                         }
  1626.                                                     ]
  1627.                                                 }
  1628.                                             }
  1629.                                         },
  1630.                                         "triggers": {
  1631.                                             "logical": {
  1632.                                                 "matches": [
  1633.                                                     {
  1634.                                                         // We want to ensure that both NPC's completed their path's before fading.
  1635.                                                         "matchExpressions": {
  1636.                                                             "event": {
  1637.                                                                 "eventId": "TOWN_CUT_SCENE",
  1638.                                                                 "triggerId": "NPC_SAM_FINISHED_RUNNING",
  1639.                                                                 "triggered": true
  1640.                                                             },
  1641.                                                             "event": {
  1642.                                                                 "eventId": "TOWN_CUT_SCENE",
  1643.                                                                 "triggerId": "NPC_BILL_FINISHED_RUNNING",
  1644.                                                                 "triggered": true
  1645.                                                             }
  1646.                                                         }
  1647.                                                     }
  1648.                                                 ]
  1649.                                             }
  1650.                                         }
  1651.                                     }
  1652.                                 }
  1653.                             }
  1654.                         },
  1655.  
  1656.                         // The NPC's have run away from the fire, so fade out the screen.
  1657.                         "count-limit": {
  1658.                             "id": "COUNT_CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK_NODE",
  1659.                              "limit": 1,
  1660.                             "incrementPolicy": "success",
  1661.                              "allowReinitialize": false,
  1662.                             "children": {
  1663.                                 "task": {
  1664.                                     "id": "CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK_NODE",
  1665.                                     "using": {
  1666.                                         "id": "CUT_SCENE_EVENT_RUN_AWAY_COMPLETED_TASK",
  1667.                                         "action": {
  1668.                                             "eventActions": {
  1669.  
  1670.                                                 // Stop the continual fire sound.
  1671.                                                 "playSound": {
  1672.    
  1673.                                                     // Path to the sound file to play. This file CANNOT be more than 1MB large due to Android restrictions.
  1674.                                                     // Libgdx supports MP3, OGG and WAV files. RoboVM (iOS) currently does not support OGG files.
  1675.                                                     "sound": "data/music/effects/spells/explode5_new.ogg",
  1676.  
  1677.                                                     // If you want to stop all instances of this particular sound, set this to true.
  1678.                                                     "stop": true
  1679.                                                 },
  1680.  
  1681.                                                 // Load the town map, but the one the player can use.
  1682.                                                 "loadAdventureMap": {
  1683.                                                    
  1684.                                                     // The ID of the map to load.
  1685.                                                     "adventureMapId": "HOME_TOWN",
  1686.                                                    
  1687.                                                     // The entry point within the new map for the player to start.
  1688.                                                     "entryPointId": "EAST_PATH_ENTRANCE"
  1689.                                                 }
  1690.                                             }
  1691.                                         },
  1692.                                         "triggers": {
  1693.                                             "logical": {
  1694.                                                 "matches": [
  1695.                                                     {
  1696.                                                         "matchExpressions": {
  1697.                                                             "event": {
  1698.                                                                 "eventId": "TOWN_CUT_SCENE",
  1699.                                                                 "triggerId": "MAP_FADE_COMPLETE",
  1700.                                                                 "triggered": true
  1701.                                                             }
  1702.                                                         }
  1703.                                                     }
  1704.                                                 ]
  1705.                                             }
  1706.                                         }
  1707.                                     }
  1708.                                 }
  1709.                             }
  1710.                         } // end
  1711.                     }
  1712.                 }
  1713.             }
  1714.         }
  1715.     }
  1716. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement