[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pingus-Devel] Convert XML levels to .pingus format
From: |
Geoffrey De Belie |
Subject: |
Re: [Pingus-Devel] Convert XML levels to .pingus format |
Date: |
Thu, 11 Aug 2016 11:34:10 +0200 |
User-agent: |
Zoho Mail |
Thanks a lot. I've managed to convert them all, but they need cleanup. I'm
writing a script for that (see below).
For example, the converted pingus file contains entrances/entrances,
exits/exits which Pingus does not have. Pingus only knows about exits/ and
entrances/. Currently this is the script I have to convert the XML version 1
files to XML version 2, then to Pingus file format.
=================
#!/bin/bash
IFS=$'\n'
for f in ./*.xml
do
echo "$f"
filename=$(basename "$f")
filename="${filename%.*}"
xsltproc pingusv1tov2.xsl "$f" > "xml-converted/$filename.xml"
ruby xml2sexpr.rb "xml-converted/$filename.xml" "$filename.pingus" >
"$filename.pingus"
done
#Replace a few odd occurences with valid ones so that Pingus recognises them
sed -i -- 's/entrances\/entrances/entrances/g' *.pingus
sed -i -- 's/liquids\/Liquid/liquids/g' *.pingus
sed -i -- 's/exits\/exits/exits/g' *.pingus
sed -i -- 's/textures\/textures/textures/g' *.pingus
=================
What's the difference between Pingus format level 2 and Pingus format level 3?
Kind regards,
Geoffrey De Belie
---- On wo, 10 aug 2016 20:49:47 +0200 Ingo Ruhnke <address@hidden>wrote ----
> On Wed, Aug 10, 2016 at 6:55 PM, Geoffrey De Belie
> <address@hidden> wrote:
> > I wonder if there exists a tool to convert the (old) XML level format to
> > the
> > new pingus format?
>
> There are two scripts that you need to use in succession.
>
> The first one updates the .xml from version 1 to version 2:
>
> https://github.com/Pingus/pingus/blob/master/tools/pingusv1tov2.xsl
>
> The second one then converts the .xml to the current .pingus format:
>
> https://github.com/Pingus/pingus/blob/master/tools/xml2sexpr.rb
>
> I haven't touched the scripts in quite some years, so not sure if they
> still work. If in doubt, send the levels to the mailing list and I'll
> see what I can do.
>
> --
> Blog: http://grumbel.blogspot.com/
> JabberID: xmpp:address@hidden
> ICQ: 59461927
>