diff --git a/assets/converters.py b/assets/converters.py index 28d224b..2d267f9 100644 --- a/assets/converters.py +++ b/assets/converters.py @@ -28,6 +28,8 @@ from tinytiled import * # If the output of the converter should be verbose. VERBOSE = 1 +# The valid path objects. +PATH_TYPES = ["polyline", "polygon"] # The sign types, used to find the sign icon. SIGN_TYPES = ["SGN", "INFO"] # The NPC faces, used to find the face id. @@ -70,7 +72,7 @@ def convert_map(input: str, output: str, params: dict, target): npcs = {} signs = {} portals = {} - + indoor = 0 name = os.path.splitext(os.path.basename(input))[0] @@ -87,7 +89,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the dialog file.\n" + f" Error message: {e}\n") sys.exit(1) - + # Get the map position try: if VERBOSE: print("INFO: Getting the map position") @@ -99,7 +101,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the map position.\n" + f" Error message: {e}\n") sys.exit(1) - + # Get informations about dialogs try: if VERBOSE: print("INFO: Getting informations about dialogs") @@ -123,7 +125,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the outdoor tileset.\n" + f" Error message: {e}\n") sys.exit(1) - + # Get the walkable tileset try: if VERBOSE: print("INFO: Getting the walkable tileset") @@ -133,7 +135,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the walkable tileset.\n" + f" Error message: {e}\n") sys.exit(1) - + # Check if this is an indoor map try: if VERBOSE: print("INFO: Checking if it is an indoor map") @@ -141,7 +143,7 @@ def convert_map(input: str, output: str, params: dict, target): except Exception as e: # Show a warning print(f"WARNING: Indoor property not found.\n") - + if indoor: # Get the indoor tileset try: @@ -176,7 +178,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the background layer.\n" + f" Error message: {e}\n") sys.exit(1) - + # Get the foreground try: if VERBOSE: print("INFO: Getting the foreground layer") @@ -195,7 +197,7 @@ def convert_map(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed to get the foreground layer.\n" + f" Error message: {e}\n") sys.exit(1) - + # Get the walkable layer try: if VERBOSE: print("INFO: Getting the walkable layer") @@ -218,7 +220,7 @@ def convert_map(input: str, output: str, params: dict, target): ed_objgroup = input_map.get_objectgroup_by_name("ExtraData") # Get the paths the NPCs take. for object in ed_objgroup.objects: - if object.get_data_type() == "polyline": + if object.get_data_type() in PATH_TYPES: npc_paths[object.id] = object.get_data() # Get the NPCs for object in ed_objgroup.objects: @@ -323,7 +325,7 @@ def convert_map(input: str, output: str, params: dict, target): if x: xpath += fxconv.u16(n) else: ypath += fxconv.u16(n) x = not x - + npc_struct += fxconv.ptr(xpath) npc_struct += fxconv.ptr(ypath) @@ -401,7 +403,7 @@ def convert_dialog(input: str, output: str, params: dict, target): sys.stderr.write(f"ERROR: Failed parse json.\n" + f" Error message: {e}\n") sys.exit(1) - + # Create the dialog struct dialog_struct = fxconv.Structure() try: diff --git a/assets/interior1_0.tmx b/assets/interior1_0.tmx index 7299f5f..ddb8fc0 100644 --- a/assets/interior1_0.tmx +++ b/assets/interior1_0.tmx @@ -1,5 +1,5 @@ - + @@ -76,5 +76,18 @@ + + + + + + + + + + + + + diff --git a/assets/interior1_0_dialogs.json b/assets/interior1_0_dialogs.json index f503523..59575a4 100644 --- a/assets/interior1_0_dialogs.json +++ b/assets/interior1_0_dialogs.json @@ -1,13 +1,13 @@ { "dialogs":[ { "ID":0, - "dialog":"_", - "isQuestion":0, - "choice":"_", - "conclusion1":"_", + "dialog":"Bonjour, qu'est ce que je vous sers ?", + "isQuestion":1, + "choice":"Une pinte de biere$Rien", + "conclusion1":"Voici pour vous.`$life+10`", "next1":-1, - "conclusion2":"_", + "conclusion2":"Bah qu'est ce que vous faites ici alors !", "next2":-1, - "nextOther":1 + "nextOther":-1 } ] } diff --git a/assets/tinytiled b/assets/tinytiled index b084ecd..b88240b 160000 --- a/assets/tinytiled +++ b/assets/tinytiled @@ -1 +1 @@ -Subproject commit b084ecda91a2352a72a5d1a61b37e0009228ee40 +Subproject commit b88240b6f8cb3ccace66ae7ea4801b5acefc91ff