Added a NPC to the taverne. Polygons are now valid paths.

This commit is contained in:
mibi88 2024-08-01 13:27:16 +02:00
parent e581fd31b1
commit 3170f25e91
4 changed files with 34 additions and 19 deletions

View file

@ -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.
@ -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:

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="24" height="16" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="3">
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="24" height="16" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="5">
<properties>
<property name="dialogFile" type="file" value="interior1_0_dialogs.json"/>
<property name="indoor" type="int" value="1"/>
@ -76,5 +76,18 @@
<property name="destPortal" value="taverne"/>
</properties>
</object>
<object id="3" name="SERVEUR" type="NPC" x="109.092" y="88.3408">
<properties>
<property name="dialogID" type="int" value="0"/>
<property name="face" value="MALE"/>
<property name="hasPath" type="int" value="1"/>
<property name="needAction" type="int" value="1"/>
<property name="path" type="object" value="4"/>
</properties>
<point/>
</object>
<object id="4" name="Chemin serveur" type="TRJ" x="108.796" y="87.7479">
<polygon points="0,0 43.2811,-4.74313 46.2455,19.5654 46.542,-34.6841 50.3958,-4.74313 -97.8271,-3.85379 -97.5306,28.1623 -61.0678,27.8659 -53.0638,27.8659 -61.3642,23.4192 -58.3998,-2.66801 -48.6171,-7.41114 -50.0993,-28.1623 8.30048,-28.7552 7.70759,-52.7673 -69.6647,-52.4709 8.30048,-53.0638 9.48626,-26.6801"/>
</object>
</objectgroup>
</map>

View file

@ -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
}
]
}

@ -1 +1 @@
Subproject commit b084ecda91a2352a72a5d1a61b37e0009228ee40
Subproject commit b88240b6f8cb3ccace66ae7ea4801b5acefc91ff