diff --git a/CMakeLists.txt b/CMakeLists.txt
index be43288..65291bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,6 @@ set(SOURCES
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
assets/WorldRPG.world
- assets/DialogsRPG.json
# ...
)
diff --git a/assets/DialogsRPG.json b/assets/DialogsLvl0.json
similarity index 100%
rename from assets/DialogsRPG.json
rename to assets/DialogsLvl0.json
diff --git a/assets/DialogsLvl1.json b/assets/DialogsLvl1.json
new file mode 100644
index 0000000..e3e6b3a
--- /dev/null
+++ b/assets/DialogsLvl1.json
@@ -0,0 +1,35 @@
+{ "dialogs":[
+ { "ID":0,
+ "dialog":"Le tombeau du Chevalier Legendaire",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":1
+ },
+ {
+ "ID":1,
+ "dialog":"Salut, je suis le gardien du Tombeau. As-tu remarque quelque chose d'etrange en venant ici ?",
+ "isQuestion":1,
+ "choice":"Rien de special$Des pas dans les bois",
+ "conclusion1":"Ok, soit prudent tout de meme",
+ "next1":2,
+ "conclusion2":"Je vais finir mon tour de ronde et verifier",
+ "next2":2,
+ "nextOther":-1
+ },
+ {
+ "ID":2,
+ "dialog":"A bientot l'ami et prend garde aux brigands.",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":-1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/assets/DialogsLvl2.json b/assets/DialogsLvl2.json
new file mode 100644
index 0000000..5f81e3f
--- /dev/null
+++ b/assets/DialogsLvl2.json
@@ -0,0 +1,46 @@
+{ "dialogs":[
+ { "ID":0,
+ "dialog":"Encore une tombe ...",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":-1
+ },
+ {
+ "ID":1,
+ "dialog":"Un passage souterrain ...",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":2
+ },
+ {
+ "ID":2,
+ "dialog":"Je me demande bien ou il peut conduire. Une prochaine expedition a faire peut-etre ...",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":-1
+ },
+ {
+ "ID":3,
+ "dialog":"C'est la maison du gardien du cimetiere",
+ "isQuestion":0,
+ "choice":"_",
+ "conclusion1":"_",
+ "next1":-1,
+ "conclusion2":"_",
+ "next2":-1,
+ "nextOther":-1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/assets/DialogsLvl3.json b/assets/DialogsLvl3.json
new file mode 100644
index 0000000..6e4a4f9
--- /dev/null
+++ b/assets/DialogsLvl3.json
@@ -0,0 +1,59 @@
+{
+ "dialogs": [
+ {
+ "ID": 0,
+ "dialog": "Maison du Fermier",
+ "isQuestion": 0,
+ "choice": "_",
+ "conclusion1": "_",
+ "next1": -1,
+ "conclusion2": "_",
+ "next2": -1,
+ "nextOther": -1
+ },
+ {
+ "ID": 1,
+ "dialog": "Maison du Marechal Ferrand",
+ "isQuestion": 0,
+ "choice": "_",
+ "conclusion1": "_",
+ "next1": -1,
+ "conclusion2": "_",
+ "next2": -1,
+ "nextOther": -1
+ },
+ {
+ "ID": 2,
+ "dialog": "Maison du Boucher",
+ "isQuestion": 0,
+ "choice": "_",
+ "conclusion1": "_",
+ "next1": -1,
+ "conclusion2": "_",
+ "next2": -1,
+ "nextOther": -1
+ },
+ {
+ "ID": 3,
+ "dialog": "Maison du Boulanger",
+ "isQuestion": 0,
+ "choice": "_",
+ "conclusion1": "_",
+ "next1": -1,
+ "conclusion2": "_",
+ "next2": -1,
+ "nextOther": -1
+ },
+ {
+ "ID": 4,
+ "dialog": "Maison du Maire",
+ "isQuestion": 0,
+ "choice": "_",
+ "conclusion1": "_",
+ "next1": -1,
+ "conclusion2": "_",
+ "next2": -1,
+ "nextOther": -1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/assets/WorldRPG.world b/assets/WorldRPG.world
index fc910f1..7cbaa1d 100644
--- a/assets/WorldRPG.world
+++ b/assets/WorldRPG.world
@@ -6,6 +6,27 @@
"width": 384,
"x": 0,
"y": 0
+ },
+ {
+ "fileName": "level1.tmx",
+ "height": 192,
+ "width": 384,
+ "x": 384,
+ "y": 0
+ },
+ {
+ "fileName": "level2.tmx",
+ "height": 192,
+ "width": 384,
+ "x": 0,
+ "y": 192
+ },
+ {
+ "fileName": "level3.tmx",
+ "height": 192,
+ "width": 384,
+ "x": 384,
+ "y": 192
}
],
"onlyShowAdjacentMaps": false,
diff --git a/assets/WorldRPG.world.bak b/assets/WorldRPG.world.bak
deleted file mode 100644
index 7cbaa1d..0000000
--- a/assets/WorldRPG.world.bak
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "maps": [
- {
- "fileName": "level0.tmx",
- "height": 192,
- "width": 384,
- "x": 0,
- "y": 0
- },
- {
- "fileName": "level1.tmx",
- "height": 192,
- "width": 384,
- "x": 384,
- "y": 0
- },
- {
- "fileName": "level2.tmx",
- "height": 192,
- "width": 384,
- "x": 0,
- "y": 192
- },
- {
- "fileName": "level3.tmx",
- "height": 192,
- "width": 384,
- "x": 384,
- "y": 192
- }
- ],
- "onlyShowAdjacentMaps": false,
- "type": "world"
-}
diff --git a/assets/converters.py b/assets/converters.py
index a44f06b..7b19bc8 100644
--- a/assets/converters.py
+++ b/assets/converters.py
@@ -21,7 +21,8 @@ def convert(input, output, params, target):
convert_font(input, output, params, target)
return 0
elif params["custom-type"] == "dialogs":
- convert_dialogs(input, output, params, target)
+ print("ERROR : Asset ", params["name"], " has legacy type dialog")
+ #convert_dialogs(input, output, params, target)
return 0
else:
return 1
@@ -148,6 +149,8 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
structMap += fxconv.ptr(walk_data)
+
+
nbextra = 0
extradata = fxconv.Structure()
@@ -161,6 +164,26 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
structMap += fxconv.ptr( extradata )
+
+
+ nameDialog = data["properties"][0]["value"]
+ dialogfile = "/".join(input.split("/")[:-nbRetour]) + "/" + nameDialog
+ print( "THE DIALOGS ARE CONTAINED IN THE FILE : ", dialogfile )
+
+ nbdiag = 0
+ diagdata = fxconv.Structure()
+
+ nbdiag, diagdata = convert_dialogs(dialogfile, output, params, target)
+
+ if (nbdiag==0):
+ structMap += fxconv.u32( 0 )
+ structMap += fxconv.u32( 0 )
+ else:
+ structMap += fxconv.u32( int(nbdiag) )
+ structMap += fxconv.ptr( diagdata )
+
+
+
#extraction of the data contained in the layer "Background" and "Foreground" of the map
@@ -353,6 +376,7 @@ def convert_dialogs(input, output, params, target):
data = json.load(open(input, "r"))
structDialogs = fxconv.Structure()
+ nbdialogs = 0
for d in data["dialogs"]:
print( int(d[ "ID" ]))
@@ -364,6 +388,7 @@ def convert_dialogs(input, output, params, target):
# print( d[ "conclusion2" ] )
# print( int(d[ "next2" ] ) )
# print( int(d[ "nextOther" ]) )
+ nbdialogs = nbdialogs + 1
structDialogs += fxconv.u32( int(d[ "ID" ] ) )
structDialogs += fxconv.string( d[ "dialog" ] )
@@ -375,5 +400,6 @@ def convert_dialogs(input, output, params, target):
structDialogs += fxconv.u32( int(d[ "next2" ] ) )
structDialogs += fxconv.u32( int(d[ "nextOther" ] ) )
+ return nbdialogs, structDialogs
- fxconv.elf(structDialogs, output, "_" + params["name"], **target)
\ No newline at end of file
+ #fxconv.elf(structDialogs, output, "_" + params["name"], **target)
\ No newline at end of file
diff --git a/assets/dialogs.json.bak b/assets/dialogs.json.bak
deleted file mode 100644
index 987338b..0000000
--- a/assets/dialogs.json.bak
+++ /dev/null
@@ -1,134 +0,0 @@
-[
- {
- "ID": 0,
- "dialog": "Bienvenue a Toi, l'Ami, dans cette magnifique ville de Nabrouch. Comme tu peux le constater, les habitants ne sont pas tres nombreux et ont tendance a se terrer dans leur maison depuis la revolution. Il faut dire que les Anciens dirigeants, bien qu'exiles, exercent encore une certaine forme de pouvoir ...",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": 1
- },
- {
- "ID": 1,
- "dialog": "Depuis la mort de ton Pere, la region a bien change ... Enfin, surtout ses habitants. Tu devras te mefier de tout le monde.",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": 2
- },
- {
- "ID": 2,
- "dialog": "Tu devrais commencer par rejoindre la taverne que ton pere t'a laisse en heritage.",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 3,
- "dialog": "Taverne de Pue Le Bouc",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 4,
- "dialog": "Tiens !! Quelqu'un est mort ici. Tu le connais ?",
- "isQuestion": 1,
- "choice": "Oui$Non",
- "conclusion1": "C'est bien triste mon Ami.`$life-2``$power-5`",
- "next1": -1,
- "conclusion2": "Dommage quand meme pour Lui.",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 5,
- "dialog": "Salut Hero !! Quel bon vent t'ammene ici a Nabrouch ?",
- "isQuestion": 1,
- "choice": "De Passage$La Famille",
- "conclusion1": "Entre donc te reposer dans la taverne, c'est la seule du coin.",
- "next1": -1,
- "conclusion2": "Fais bien attention alors.",
- "next2": 6,
- "nextOther": -1
- },
- {
- "ID": 6,
- "dialog": "On dit qu'il se passe des choses étranges par ici depuis quelques temps. Fais bien attention a Toi.",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 7,
- "dialog": "Salut Hero, je suis le cremier. Veux tu me delester un peu ?",
- "isQuestion": 1,
- "choice": "Oui$Non",
- "conclusion1": "Voici donc pour toi`$life+5``$mana+5``$power+2`",
- "next1": -1,
- "conclusion2": "Bon bah casse toi ...",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 8,
- "dialog": "Le Sanctuaire Maudit ...",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 9,
- "dialog": "Etrange ce coffre abandonne et ouvert ... Fouiller dedans ?",
- "isQuestion": 1,
- "choice": "Oui$Non",
- "conclusion1": "Trop cool, du stuff `$life+5``$mana+5``$power+2`",
- "next1": -1,
- "conclusion2": "Je ferai mieux de partir loin ...",
- "next2": -1,
- "nextOther": -1
- },
- {
- "ID": 10,
- "dialog": "Et sa tombe est en train d'etre creusee ?",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": 11
- },
- {
- "ID": 11,
- "dialog": "Beaucoup de morts pour une si petite bourgade ...",
- "isQuestion": 0,
- "choice": "_",
- "conclusion1": "_",
- "next1": -1,
- "conclusion2": "_",
- "next2": -1,
- "nextOther": -1
- }
-]
\ No newline at end of file
diff --git a/assets/fxconv-metadata.txt b/assets/fxconv-metadata.txt
index 17810e2..822cad1 100644
--- a/assets/fxconv-metadata.txt
+++ b/assets/fxconv-metadata.txt
@@ -2,6 +2,6 @@ WorldRPG.world:
custom-type: world
name: worldRPG
-DialogsRPG.json:
- custom-type: dialogs
- name: dialogRPG
+#DialogsRPG.json:
+# custom-type: dialogs
+# name: dialogRPG
diff --git a/assets/level0.tmx b/assets/level0.tmx
index 4554f3b..a5d1322 100644
--- a/assets/level0.tmx
+++ b/assets/level0.tmx
@@ -3,6 +3,9 @@
+
+
+
diff --git a/assets/level1.tmx b/assets/level1.tmx
index cee3aac..c3af03c 100644
--- a/assets/level1.tmx
+++ b/assets/level1.tmx
@@ -1,5 +1,8 @@