Page 9 of 117

Re: Grognak's Mod Manager

Posted: Sun Sep 23, 2012 9:39 pm
by Grognak
I was wondering if someone knowledgeable about python could point out a way to merge .xml files cleanly? :) My skill with Google has been failing me on this point.

Re: Grognak's Mod Manager

Posted: Sun Sep 23, 2012 10:23 pm
by buzzyrecky
Alblaka wrote:
Grognak wrote:
Patch notes:
- Added custom subdirectory support
- Added an option to be able to use .zip files


Mind elaborating these 2?

Can I now use any sort of file structure below the given root folders? F.e./img/AW/*.png
What exactly do you mean by option? It's a toggle in the modman.ini, I guess?



Yes Alblaka, now you can add your own directories and the GMM will add them to the game and you can choose if the GMM will accept a ZIP file or if you want it just to use FTL files, my opinion is to accept it by default, much easier, but for those that prefer FTL files..
Wait, so does this mean that if I stuck all my changes in a weaponanza.xml file, it would patch into the game and work? Or does it mean something else? *has no technical skills haha*

If not, then can someone explain again how append files work? For example, if I were to add to the starting weapons list, would I add everything (including normal stuff) like:

<blueprintList name="STARTING_WEAPONS">
<name>LASER_BURST_1</name>
<name>LASER_BURST_2</name>
<name>MISSILES_2_PLAYER</name>
<name>BEAM_LONG</name>
<name>ION_1</name>
<name>ION_2</name>
<name>ION_4</name>
<name>BOMB_1</name>
<name>LASER_BURST_3</name>
<name>LASER_HEAVY_1</name>
<name>MISSILES_3</name>
<name>BEAM_1</name>
<name>BEAM_FIRE</name>
<name>LASER_HULL_2</name>
<name>BOMB_FIRE</name>
<name>BOMB_ION</name>
<name>BOMB_HEAL</name>

<name>ION_7</name>
<name>LASER_BURST_1</name>
<name>MISSILES_V</name>
<name>BOMB_CREEP</name>
<name>BOMB_PANACEA</name>
<name>MISSILES_PX</name>
<name>BEAM_RUIN</name>
<name>LASER_NTYK</name>

<name>MISSILES_2X</name>
<name>LASER_BURST_1X</name>
<name>BEAM_BIOX</name>
<name>LASER_BURST_2X</name>
<name>ION_2</name>
<name>ION_7X</name>
<name>MISSILES_1X</name>
<name>BEAM_GLAIVEX</name>
</blueprintList>


or would I just add the new things like this:

<blueprintList name="STARTING_WEAPONS">
<name>ION_7</name>
<name>LASER_BURST_1</name>
<name>MISSILES_V</name>
<name>BOMB_CREEP</name>
<name>BOMB_PANACEA</name>
<name>MISSILES_PX</name>
<name>BEAM_RUIN</name>
<name>LASER_NTYK</name>

<name>MISSILES_2X</name>
<name>LASER_BURST_1X</name>
<name>BEAM_BIOX</name>
<name>LASER_BURST_2X</name>
<name>ION_2</name>
<name>ION_7X</name>
<name>MISSILES_1X</name>
<name>BEAM_GLAIVEX</name>
</blueprintList>

Re: Grognak's Mod Manager

Posted: Sun Sep 23, 2012 10:36 pm
by Trainzack
I really like this. Can you put the version number in the title, so we can know when a new version comes out?

Re: Grognak's Mod Manager

Posted: Sun Sep 23, 2012 10:39 pm
by Grognak
buzzyrecky wrote:Wait, so does this mean that if I stuck all my changes in a weaponanza.xml file, it would patch into the game and work? Or does it mean something else? *has no technical skills haha*

Nope, merging functionality will come as soon as I can figure it out. :P

buzzyreck wrote:If not, then can someone explain again how append files work? For example, if I were to add to the starting weapons list, would I add everything (including normal stuff) like:

Correct.

Trainzack wrote:I really like this. Can you put the version number in the title, so we can know when a new version comes out?

Jolly good idea.

Re: Grognak's Mod Manager

Posted: Mon Sep 24, 2012 1:30 am
by Icehawk78
Grognak wrote:I was wondering if someone knowledgeable about python could point out a way to merge .xml files cleanly? :) My skill with Google has been failing me on this point.

I've been messing with this, and it looks like your best bet is going to be to use something like BeautifulSoup or ElementTree (the latter comes preinstalled with Python, but is quite a bit more difficult to navigate/use, while BS requires an external install and (as of my playing with it) seems to have some difficulty with initially parsing the xml files.

Argh. Upon further testing, it would appear one of the major flaws in creating a "merge" function is that this is essentially invalid XML - the W3C standards indicate that there needs to be exactly one root node, so any XML parser that reads the XML files associated with the game will either choke and die, or only parse the very first node of whatever file you're in.

In Ruby, I had some luck using Nokogiri's XML.fragment, to have it ignore that, but haven't seen anything in Python yet. Sorry.

Re: Grognak's Mod Manager (v1.3)

Posted: Tue Sep 25, 2012 4:52 am
by aedyr
v1.3 question regarding zip files. I updated all the GMM files and went into modman.ini and set allowzip to 1. Then just to be sure, I deleted modorder.txt from the mods directory. However, on loading GMM only the FTL files appear. They have the .ftl extension displayed, as advertised, but the zip I put in the directory to test remains invisible. I repeated the process a few times, deleting modorder as I went just to be sure, but still no dice.

Known issue, or am I missing something? Thanks!

Re: Grognak's Mod Manager (v1.3)

Posted: Tue Sep 25, 2012 6:07 am
by Grognak
aedyr wrote:v1.3 question regarding zip files. I updated all the GMM files and went into modman.ini and set allowzip to 1. Then just to be sure, I deleted modorder.txt from the mods directory. However, on loading GMM only the FTL files appear. They have the .ftl extension displayed, as advertised, but the zip I put in the directory to test remains invisible. I repeated the process a few times, deleting modorder as I went just to be sure, but still no dice.

Known issue, or am I missing something? Thanks!

For some reason, I have no idea why, the code I wrote to populate the list with .zip files is gone. I'll patch that, in the mean time add it manually to modorder.txt and it should work.

Re: Grognak's Mod Manager (v1.3)

Posted: Tue Sep 25, 2012 11:23 am
by Icehawk78
As a further update - the root XML files also have attribute spacing issues, which I'm far too lazy to fix atm, so unless you have a way to clean the data.dat XML files without otherwise altering them (such as downcasing all the attribute names, or whatnot), then most XML parsers are gonna have a very bad time.

Re: Grognak's Mod Manager (v1.3)

Posted: Wed Sep 26, 2012 6:44 pm
by Whale Cancer
Alright, so I keep getting an unexplained error after doing significant editing to events (See attached picture).

C++ERROR.png


So I created a fresh install of FTL, reinstalled Grognak's Mod Manager, and created an extremely simple .ftl

Code: Select all

<!--
Foundation of the Federation
-->

<event name = "MONKEY">
   <text>Monkey!</text>
</event>


Yes, all it says is monkey. And this causes the indicated crash above. Why is this happening? I've done quite a number of fairly complex events, ships, etc., in multiple .ftls and have run them in combination before. Suddenly, this won't even run. An event that doesn't even get referenced anywhere else.

What's the deal? I'd like to resolve this so I can work on my mod, but as it stands I'm just wasting time.

Edit: This also happens with a blank 'events.xml.append' and a 'events.xml.append' with only a comment.

Edit 2: Any help greatly appreciated!

Re: Grognak's Mod Manager (v1.3)

Posted: Wed Sep 26, 2012 6:59 pm
by Grognak
You are likely saving as UTF-8 when you should be saving as ANSI.