diff --git a/assets/converters.py b/assets/converters.py
index d63ee8f..a44f06b 100644
--- a/assets/converters.py
+++ b/assets/converters.py
@@ -6,6 +6,7 @@ import pathlib
import csv
import os
+
def convert(input, output, params, target):
if params["custom-type"] == "map":
print("ERROR : Asset ", params["name"], " has legacy type map")
@@ -275,16 +276,14 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
if v[ "id" ] == pathID:
print( "path data found : " )
- xdata = bytes("", "UTF-16")
- ydata = bytes("", "UTF-16")
+ xdata = bytes()
+ ydata = bytes()
for w in v[ "polyline" ]:
path_length = path_length + 1
print( "X= ", w[ "x" ], " Y= ", w[ "y" ] )
xdata += fxconv.u16( int( w[ "x" ] ) )
ydata += fxconv.u16( int( w[ "y" ] ) )
- print("xdata : ", xdata)
- print("ydata : ", ydata)
else:
print( "PNJ has no Path" )
@@ -292,17 +291,17 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
else:
print( "UNIDENTIFIED PROPERTY : ", j["name"])
- print( "OBJECT X= ", x, " Y= ", y, "STR= ", dialog )
+ print( "OBJECT X= ", x, " Y= ", y, "STR= ", dialogID )
print( " Type= ", tpe, " Name= ", nme )
- print( " Q?= ", quest, " Choi= ", choi )
- print( " c1= ", conc1, " c2=", conc2)
+ print( " Action?= ", needAction )
+
structData += fxconv.u32( int(x) )
structData += fxconv.u32( int(y) )
structData += fxconv.string( nme )
structData += fxconv.string( tpe )
- structData += fxconv.u32( int(dialogID))
+ structData += fxconv.u32( int(dialogID) )
structData += fxconv.u32( int(needAction) )
if path==0:
@@ -323,7 +322,8 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
#else we do nothing (yet)
else:
- break
+ print( "Skip this object" )
+
return nbExtraData, structData
@@ -355,13 +355,23 @@ def convert_dialogs(input, output, params, target):
structDialogs = fxconv.Structure()
for d in data["dialogs"]:
+ print( int(d[ "ID" ]))
+ # print( d[ "dialog" ] )
+ print( int(d[ "isQuestion" ]) )
+ # print( d[ "choice" ].replace('$', chr(0)) )
+ # print( d[ "conclusion1" ] )
+ # print( int(d[ "next1" ] ) )
+ # print( d[ "conclusion2" ] )
+ # print( int(d[ "next2" ] ) )
+ # print( int(d[ "nextOther" ]) )
+
structDialogs += fxconv.u32( int(d[ "ID" ] ) )
- structDialogs += fxconv.string( int(d[ "dialog" ] ) )
+ structDialogs += fxconv.string( d[ "dialog" ] )
structDialogs += fxconv.u32( int(d[ "isQuestion" ] ) )
- structDialogs += fxconv.string( int(d[ "choice" ] ) )
- structDialogs += fxconv.string( int(d[ "conclusion1" ] ) )
+ structDialogs += fxconv.string( d[ "choice" ].replace('$', chr(0)) )
+ structDialogs += fxconv.string( d[ "conclusion1" ] )
structDialogs += fxconv.u32( int(d[ "next1" ] ) )
- structDialogs += fxconv.string( int(d[ "conclusion2" ] ) )
+ structDialogs += fxconv.string( d[ "conclusion2" ] )
structDialogs += fxconv.u32( int(d[ "next2" ] ) )
structDialogs += fxconv.u32( int(d[ "nextOther" ] ) )
diff --git a/assets/fxconv-metadata.txt b/assets/fxconv-metadata.txt
index 9150b69..17810e2 100644
--- a/assets/fxconv-metadata.txt
+++ b/assets/fxconv-metadata.txt
@@ -2,6 +2,6 @@ WorldRPG.world:
custom-type: world
name: worldRPG
-DialogsRPG.json
+DialogsRPG.json:
custom-type: dialogs
name: dialogRPG
diff --git a/assets/level0.tmx b/assets/level0.tmx
index a3b4853..4554f3b 100644
--- a/assets/level0.tmx
+++ b/assets/level0.tmx
@@ -146,7 +146,7 @@
-