From 3b2fc58c57da5b0cb8ed611bb7e86b0f7f90ff31 Mon Sep 17 00:00:00 2001 From: mibi88 <76903855+mibi88@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:08:23 +0200 Subject: [PATCH] More faces :) + reduced map converter logs. --- assets-cg/demo_PNJ.png | Bin 4701 -> 0 bytes assets-cg/demo_player.png | Bin 5980 -> 107 bytes assets-cg/npc/face/milkman.png | Bin 0 -> 544 bytes assets-cg/npc/face/police.png | Bin 0 -> 555 bytes assets-fx/demo_player.png | Bin 105 -> 107 bytes assets-fx/npc/face/milkman.png | Bin 0 -> 326 bytes assets-fx/npc/face/police.png | Bin 0 -> 354 bytes assets/converters.py | 70 +++++++++++++++++---------------- 8 files changed, 36 insertions(+), 34 deletions(-) delete mode 100644 assets-cg/demo_PNJ.png create mode 100644 assets-cg/npc/face/milkman.png create mode 100644 assets-cg/npc/face/police.png create mode 100644 assets-fx/npc/face/milkman.png create mode 100644 assets-fx/npc/face/police.png diff --git a/assets-cg/demo_PNJ.png b/assets-cg/demo_PNJ.png deleted file mode 100644 index 8198c5931a59c0c185c422ed67b214b778ce33f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4701 zcmeHKc~leU77vyRMYe~6h(693cqqjrlaT!p1OZLN00snW-6qLQ7|BK!5^+Hh@rh6r ztX3W_=tEHv7YddtARypMg(8YjaYYX*3bvr7>iZH<;k^FiIj{ebb0(SjzTf@bdw=(S z_hdFlgw3(DakC*12zCN~un7EGn=Wfh@U0x10KPw4oEWuGCqfL6TBE{nIST1ks!<3v z;uwKoy!C9SO4AP6)>dlM+^e!2o$9NWV~HEwD;?UNNZkAG&YtJdG zd!NW0W~zInk^fq;M>BVP(RY&0E~)6g5Pze8^3>ZllO|;(wr%Vsd!E%_BS)0tLhm!>d#lgNAHIFdT+ngI z_~krScV_tWs{>rwmHp=} zkN)g`_;OT>+da&dn%YMwr`s*qm~zZe_iW*H=g>T%J|{lr(s`)STXbO7?j0qCQQO21 z{&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V}c+gEVyXa^5p*l{ImZ0 diff --git a/assets-cg/demo_player.png b/assets-cg/demo_player.png index 04c4d34e3fb3e8de9e04e87710feb7d90715a058..7c1da00eb6988b570c732a4e62908d67d942a06f 100644 GIT binary patch delta 78 zcmcbkmpwt*gTctt#W93qX6%`RoD7BnOa}^ozrR_{V&-1c(Is`o)veoVO|o|TXTL?} ioX5@|Saa*-=Z}orzwolZPfA?O00f?{elF{r5}E++tRTw( literal 5980 zcmeHLd2kcg8DAZ?4qq4>Vmk(8nZuB*v|6pKqZVK+8;c@pi~}aqp{(|>w^#?#+LD=R zo46Dj3R9Di#7RsVDBzH^DGqfKk_@Ly3;!f;k|wxKIa&&&Gi`vh92ro*w>oSGn8Yn) z`iIx^_I>*uzxVyV_x5R@AFEq5KTBJr#V{<(UF)icUX7Ys33q>b8{AblxkfkdcF&S5 z;3-pLvV@;(m@JnmFa_w>K^qS;@_*nZveixcr`l|&AAt(F!Zcm+#G?)m3nSywNG&=~J!(`W)tPYdKVKRfa?1iC> zAQaPJH?cT2LP~N%ut`oxPI8(DvLcahI=H6~lP4r(#9bzjW7eYBgxrS$;ELxS`zUq_ z8@HgwT>}Fl8gPsK5v#(~>FKKUG_^{l(rDD$%>1m(jEu~}@p(DWv^tea|> zq0>KDT3lRao%tYPq9|(047<}tRse4jfygu(O=d=BK~`1)SyEg=j{1rn#B$XrCxuLp z$#Z3jTv@Cin*w>J$)qbz1rb#!)6!LHjWz=u`o^J3Ddb8;TAC78j_iA2$CSBg<4a7H z>3NH3m40e6|=hbGhyd^*+a4RvU=6Ync1ESffbM%m0+l%?EivpcF>)iv{L z-3yj9JhXIK0&pf;R=R0=p z>UnYZORw(zb>C~Rzp?Ml!$OfBEa#znwdO;ggG( zE`Ro~e_y$J?KdX3j3z0(q zU+LU6pkzH#fOjt4*XEMU=}!GuNaRkTN&PJlN!nj`pA$QQU0Kn;8@BaQp{lCRT~(zE zh623M!eLmnduwO!f+KbL>kc#w=m&S6(PbBYJHx<-_RLaNm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>bh&?(heP`I6r&^Mc}X`KfmuEaMY4}zd7Fp|4iOgO2U&SSi3xo zVHtU-$*^a;3qYw7-JWXIIdxu6PWGQIu9Ki5+^)(7^@j|5^_@rLjRkeCg2FCceh2Ga v`N-~TKOHxB=^^=MX6?%>>ACgUi`VlwR#c+SOA8gU5R1917r9=Ux3c3u|3lK) diff --git a/assets-cg/npc/face/milkman.png b/assets-cg/npc/face/milkman.png new file mode 100644 index 0000000000000000000000000000000000000000..98b92bfda1f2cec54fc9a2b23eab17ab935e6568 GIT binary patch literal 544 zcmV+*0^j|KP)bd*Cg=Cvd)y*>ixOym^+b7VdAft)Ig6SFC_9;G1jq?~3yvs4PXJJAt6KUOD``(>EaUHPORILmma(4om23jVw4oX|iV)k-IJPrXZ%h(ngeyPdzz&`;?MssxG zm%x-cE}ygN!Y_fjrs)FmU9md>^E;t+Oly8YiP)WhNdtj=Of?EtKWW_wj5-%A66_%~ z5Z?8=?azr0000U0^5~a<_8BncThVOqjewa6HO=sG zG}3Yi$f3)TD7A}P27$nRH0k?PJE`gfCgp)yoGl^`Gyy^(g_3cOc1?g|QeK^ao!)d>{u zhCOBbe-O4M@=u`QHj`y!DG9AywzX89K+%m!$!UpYle;Ye2LwiQK;D*|xtw}y<6Ck@ z&;p$>^nYU#qi?yK@u#;Y@!a2vUPhj_i+!dP{1A}Q!!6o2`7P_x(-0Z?Zg|FT0gHkk t0@h8LHWy@F%#NvzB#`zYZ_la|_yJ?9dnngfgi-(i002ovPDHLkV1iqg{-^)| literal 0 HcmV?d00001 diff --git a/assets-fx/demo_player.png b/assets-fx/demo_player.png index e522e612611bb1d9bae1b69e51e570bc385878f4..7c1da00eb6988b570c732a4e62908d67d942a06f 100644 GIT binary patch delta 76 zcmd1Io}l7xk5tY$HDuj%NLy5j2AZM7y@yZy7@B6H4T g=MSv8b@KB^#_eBt+21E6E@l7%Pgg&ebxsLQ0K1bQDgXcg delta 74 zcmd1KoS@=r;OXKR!Z9;B<;VF3rU;1u7YWH33L;G@NeK-rfA$MFgdJp>nB1~DA<-d- dFR(pLmqALAL-@kV>#Ynx;OXk;vd$@?2>{z68K3|F diff --git a/assets-fx/npc/face/milkman.png b/assets-fx/npc/face/milkman.png new file mode 100644 index 0000000000000000000000000000000000000000..f92f7bf6c62a48c701f4b015174067a6ad7f0531 GIT binary patch literal 326 zcmV-M0lEH(P)kdg0003ENkl*@&`NJOlgPBT9OZzuFFRSH!g<>F)Fp5k@*-(Go%42uqle zta&T9N=s1(HHjU*P6$|}j&&^sfm$R?u^{B4zyAo;JQt6$H&b8+FJ%3Z{UOLXKO|u8 z8uE$+^c3b+7Sd~&e`$PX?!`6R+&dhz%51J0P7(RI=qx^yQx+7HPj7)I$x%uGvbm~= z;ua7ZNYzZZE+8!iWO9hevB#~JoO;wEYau!|7`kdg0003gNklsz<0>5@+&#phEnq7Dd-}# zR}xSJ?>b`pI~(pUh~u*^ajmF}q**M1An33FWVpl(2FKtU6ws0TyObx<281;i4-37* zynZ8zRqz)|Uqp)64R5fP$x-&+ruVW$I5J_tFGwAFiQ@uylK=n!07*qoM6N<$g4e{5 A?*IS* literal 0 HcmV?d00001 diff --git a/assets/converters.py b/assets/converters.py index 7b19bc8..fc7dcad 100644 --- a/assets/converters.py +++ b/assets/converters.py @@ -6,6 +6,7 @@ import pathlib import csv import os +DEBUG = 0 def convert(input, output, params, target): if params["custom-type"] == "map": @@ -34,8 +35,8 @@ def convert_world(input, output, params, target): data = json.load(open(input, "r")) nbMaps = ["fileName" in i for i in data["maps"]].count(True) - print( "We have to treat ", nbMaps, " maps") - print( "So let's go ... ") + if DEBUG: print( "We have to treat ", nbMaps, " maps") + if DEBUG: print( "So let's go ... ") structWorld = fxconv.Structure() #structExtra = fxconv.Structure() @@ -51,26 +52,26 @@ def convert_world(input, output, params, target): nameJSON = "/".join(input.split("/")[:-nbRetour]) + "/" + nameMap + ".json" commandline = 'tiled --export-map json ' + nameTMX + ' ' + nameJSON - print( "TILED COMMAND LINE FOR MAPS : ", commandline ) + if DEBUG: print( "TILED COMMAND LINE FOR MAPS : ", commandline ) os.system( commandline ) mapPath = "/".join(input.split("/")[:-nbRetour]) + "/" + nameMap + ".json" - print("Map ", i , " name : ", mapPath ) + if DEBUG: print("Map ", i , " name : ", mapPath ) xmin = data["maps"][i]["x"] - print( "xmin = ", xmin ) + if DEBUG: print( "xmin = ", xmin ) ymin = data["maps"][i]["y"] - print( "ymin = ", ymin ) + if DEBUG: print( "ymin = ", ymin ) xmax = data["maps"][i]["x"] + data["maps"][i]["width"] - print( "xmax = ", xmax ) + if DEBUG: print( "xmax = ", xmax ) ymax = data["maps"][i]["y"] + data["maps"][i]["height"] - print( "ymax = ", ymax ) + if DEBUG: print( "ymax = ", ymax ) map = get_tile_map_data( mapPath, output, params, target, xmin, ymin, xmax, ymax) - print( "Map = ", map ) + if DEBUG: print( "Map = ", map ) structWorld += fxconv.ptr( map ) structWorld += fxconv.u32(0) @@ -85,7 +86,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): #find the tileset in use. it's a relative path (like ../tileset.tsx) nameTileset = data["tilesets"][0]["source"].replace(".tsx","") - print(nameTileset) + if DEBUG: print(nameTileset) #the name of the tileset without the .something nameTilesetFree = nameTileset.split("/")[-1] #count the number of "back" (cd ..) to locate the tileset on the computer @@ -95,7 +96,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): tilesetJSON = "/".join(input.split("/")[:-nbRetour]) + "/" + nameTileset + ".json" commandline = 'tiled --export-tileset json ' + tilesetTSX + ' ' + tilesetJSON - print( "TILED COMMAND LINE FOR TILESET : ", commandline ) + if DEBUG: print( "TILED COMMAND LINE FOR TILESET : ", commandline ) os.system( commandline ) tileset = open(tilesetJSON, "r") @@ -105,14 +106,14 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): #find the ID of the first tile in the walkable tileset () indexWalkable = data["tilesets"][1]["firstgid"] - print(indexWalkable) + if DEBUG: print(indexWalkable) #Extract from the json the width, height w, h = data["width"], data["height"] #nbTileLayer is the number of "true" layers (without ObjectsLayer) nbTilelayer = ["data" in i for i in data["layers"]].count(True) - 1 - print( nbTilelayer) + if DEBUG: print( nbTilelayer) #index of the various layers (may change from one map to another) layer_walkable = 0 @@ -135,7 +136,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): datavalid = data["layers"][i] if datavalid["name"]=="Walkable": layer_walkable = i - print( "Walkable Tile Data in layer : ", layer_walkable) + if DEBUG: print( "Walkable Tile Data in layer : ", layer_walkable) break elif i==nbTilelayer: print( "ERROR : No Walkable layer data !!!" ) @@ -168,7 +169,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): nameDialog = data["properties"][0]["value"] dialogfile = "/".join(input.split("/")[:-nbRetour]) + "/" + nameDialog - print( "THE DIALOGS ARE CONTAINED IN THE FILE : ", dialogfile ) + if DEBUG: print( "THE DIALOGS ARE CONTAINED IN THE FILE : ", dialogfile ) nbdiag = 0 diagdata = fxconv.Structure() @@ -192,7 +193,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): datavalid = data["layers"][i] if datavalid["name"]=="Background": layer_background = i - print( "Background Tile Data in layer : ", layer_background) + if DEBUG: print( "Background Tile Data in layer : ", layer_background) break elif i==nbTilelayer: print( "ERROR : No Background layer data !!!" ) @@ -210,10 +211,10 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): datavalid = data["layers"][i] if datavalid["name"]=="Foreground": layer_foreground = i - print( "Foreground Tile Data in layer : ", layer_foreground) + if DEBUG: print( "Foreground Tile Data in layer : ", layer_foreground) break elif i==nbTilelayer: - printf( "ERROR : No Foreground layer data !!!" ) + print( "ERROR : No Foreground layer data !!!" ) layer_data = bytes() layer = data["layers"][layer_foreground] @@ -227,11 +228,11 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax): def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): - print( "WE ARE COMPUTING THE EXTRA DATA OF THE MAP : ", input ) + if DEBUG: print( "WE ARE COMPUTING THE EXTRA DATA OF THE MAP : ", input ) data = json.load(open(input, "r")) nblayer = ["id" in i for i in data["layers"]].count(True) - 1 - print( "I found ", nblayer, " of extradata") + if DEBUG: print( "I found ", nblayer, " of extradata") #index of the various layers (may change from one map to another) layer_extradata = 0 @@ -241,7 +242,7 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): datavalid = data["layers"][i] if datavalid["name"]=="ExtraData": layer_extradata = i - print( "Extra Data in layer : ", layer_extradata) + if DEBUG: print( "Extra Data in layer : ", layer_extradata) break elif i==nblayer: print( "ERROR : No ExtraData layer data !!!" ) @@ -287,36 +288,37 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): pathID = None path = j[ "value" ] if path==1: - print( "PNJ has path - NOW LOOKING FOR RELEVANT DATA" ) + if DEBUG: print( "PNJ has path - NOW LOOKING FOR RELEVANT DATA" ) # we start looking for path data with first the ID of the path Object for u in i["properties"]: if u["name"]=="path": pathID = u[ "value" ] - print( "path ID is identified : ID= ", pathID ) + if DEBUG: print( "path ID is identified : ID= ", pathID ) for v in layer["objects"]: if v[ "id" ] == pathID: - print( "path data found : " ) + if DEBUG: print( "path data found : " ) xdata = bytes() ydata = bytes() for w in v[ "polyline" ]: path_length = path_length + 1 - print( "X= ", w[ "x" ], " Y= ", w[ "y" ] ) + if DEBUG: print( "X= ", w[ "x" ], " Y= ", w[ "y" ] ) xdata += fxconv.u16( int( w[ "x" ] ) ) ydata += fxconv.u16( int( w[ "y" ] ) ) else: - print( "PNJ has no Path" ) + if DEBUG: print( "PNJ has no Path" ) else: print( "UNIDENTIFIED PROPERTY : ", j["name"]) - print( "OBJECT X= ", x, " Y= ", y, "STR= ", dialogID ) - print( " Type= ", tpe, " Name= ", nme ) - print( " Action?= ", needAction ) + if DEBUG: + print( "OBJECT X= ", x, " Y= ", y, "STR= ", dialogID ) + print( " Type= ", tpe, " Name= ", nme ) + print( " Action?= ", needAction ) @@ -345,7 +347,7 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): #else we do nothing (yet) else: - print( "Skip this object" ) + if DEBUG: print( "Skip this object" ) return nbExtraData, structData @@ -372,16 +374,16 @@ def convert_font(input, output, params, target): def convert_dialogs(input, output, params, target): - print( "WE ARE COMPUTING THE DIALOGS FROM : ", input ) + if DEBUG: print( "WE ARE COMPUTING THE DIALOGS FROM : ", input ) data = json.load(open(input, "r")) structDialogs = fxconv.Structure() nbdialogs = 0 for d in data["dialogs"]: - print( int(d[ "ID" ])) + if DEBUG: print( int(d[ "ID" ])) # print( d[ "dialog" ] ) - print( int(d[ "isQuestion" ]) ) + if DEBUG: print( int(d[ "isQuestion" ]) ) # print( d[ "choice" ].replace('$', chr(0)) ) # print( d[ "conclusion1" ] ) # print( int(d[ "next1" ] ) ) @@ -402,4 +404,4 @@ def convert_dialogs(input, output, params, target): return nbdialogs, structDialogs - #fxconv.elf(structDialogs, output, "_" + params["name"], **target) \ No newline at end of file + #fxconv.elf(structDialogs, output, "_" + params["name"], **target)