[Tool] ftldat r7

Discuss and distribute tools and methods for modding. Moderator - Grognak
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby AtillaBosma » Tue Sep 18, 2012 4:47 pm

Alright then, step 1!

Step 1: Look for the file called Blueprints.xml in the data.dat-unpacked folder
Look for this part in the code:

Code: Select all

<shipBlueprint name="PLAYER_SHIP_HARD" layout="kestral" img="kestral">
   <class>Kestrel Cruiser</class>
   <name>The Kestrel</name>
   <desc>This class of ship was decommissioned from Federation service years ago.  After a number of refits and updating this classic ship is ready for battle.</desc>
   <systemList>
      <pilot power="1" room="0" start="true" img="room_pilot">
         <slot>
            <direction>right</direction>
            <number>0</number>
         </slot>
      </pilot>
      <doors power="1" room="2" start="true" img="room_doors"/>
      <sensors power="1" room="3" start="true" img="room_sensors"/>
      <medbay power="1" room="4" start="true" img="room_medbay">
         <slot>
            <number>1</number>
         </slot>
      </medbay>
      <oxygen power="1"  room="13" start="true" img="room_oxygen"/>
      <shields power="2" room="5" start="true" img="room_shields"/>
      <engines power="2" room="14" start="true" img="room_engines"/>
      <weapons power="3" room="10" start="true" img="room_weapons"/>
      <drones power="2" room="1" start="false"/>
      <teleporter power="1" room="15"   start="false"/>
      <cloaking power="1" room="8" start="false"/>
   </systemList>
   <weaponSlots>4</weaponSlots>
   <droneSlots>2</droneSlots>
   <weaponList count="2" missiles="8">
      <weapon name="MISSILES_4"/>
      <weapon name="LASER_BURST_3"/>
   </weaponList>
   <health amount="30"/>
   <maxPower amount ="8"/>
   <crewCount amount = "3" class="human"/>
</shipBlueprint>


Do you see this part:

Code: Select all

   <weaponList count="2" missiles="8">
      <weapon name="MISSILES_1"/>
      <weapon name="LASER_BURST_3"/>

Change the

Code: Select all

<weapon name="MISSILES_1"/>
to

Code: Select all

<weapon name="MISSILES_4"/>
.
This will make it so instead of the usual missile launcher it will spawn you with the weapon you made in the previous tutorials.

And thats it!
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby AtillaBosma » Tue Sep 18, 2012 4:48 pm

I would also like to thank Bas for making these tools to unpack these files, without him we couldn't mod at all!
WarStalkeR
Posts: 3
Joined: Sun Sep 16, 2012 8:51 am

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby WarStalkeR » Tue Sep 18, 2012 8:47 pm

DisposableNinja wrote:Have you tried going to an asteroid field with it? I've just tried.
I actually even survived that :) I don't know the reason for asteroid's unique hatred toward spaceships, lets leave it as is for now and think that all asteroid fields are pretty intensive. Just use cloaking while at asteroid field. Cloaking + 8 bars FTL drive with crew give you 105% evasion and 15 seconds is enough to charge jump-drive :) I think asteroid field reacts to amount of energy bars... Though It's just untested theory...
Image
Tysonclyde
Posts: 41
Joined: Mon Sep 17, 2012 11:16 am

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby Tysonclyde » Tue Sep 18, 2012 9:26 pm

Plzz post a video showing us how to use the ftldat to unpack the data.dat file. I really want to mod this game.
ImATree
Posts: 3
Joined: Tue Sep 18, 2012 3:05 pm

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby ImATree » Wed Sep 19, 2012 1:59 am

bas wrote:
ImATree wrote:I opened the setup.py using the python launcher that comes with python.


You shouldn't have to use it.

Suppose you downloaded ftldat.zip to the Downloads folder, then the following should work on Mac OS X. Open up a terminal and type:

Code: Select all

cd /Applications/FTL.app/Contents/Resources


Now you are in the folder with the .dat files. You can verify this as follows.

Code: Select all

bas@emma /Applications/FTL.app/Contents/Resources $ ls
FTL.icns   data.dat   resource.dat


Thank you! This worked!.

:D

Now we can unpack the data.dat as follows.

Code: Select all

bas@emma /Applications/FTL.app/Contents/Resources $ python ~/Downloads/ftldat/src/main.py unpack data.dat
Loading index ...
Extracting ...
 data/achievements.xml
 data/animations.xml
 data/auto_assault.txt
 data/auto_assault.xml
 data/auto_basic.txt
 data/auto_basic.xml
 data/autoBlueprints.xml
 data/blueprints.xml
 data/boss_1.txt
 data/boss_1.xml
 data/boss_2.txt
 data/boss_2.xml
 data/boss_3.txt
 data/boss_3.xml
 data/circle_bomber.txt
 data/circle_bomber.xml
 data/circle_cruiser.txt
 data/circle_cruiser.xml
 data/circle_cruiser_2.txt
 data/circle_cruiser_2.xml
 data/circle_scout.txt
 data/circle_scout.xml
 data/credits.txt
 data/crystal_bomber.txt
 data/crystal_bomber.xml
 data/crystal_cruiser.txt
 data/crystal_cruiser.xml
 data/crystal_cruiser_2.txt
 data/crystal_cruiser_2.xml
 data/crystal_scout.txt
 data/crystal_scout.xml
 data/energy_bomber.txt
 data/energy_bomber.xml
 data/energy_cruiser.txt
 data/energy_cruiser.xml
 data/energy_cruiser_2.txt
 data/energy_cruiser_2.xml
 data/energy_fighter.txt
 data/energy_fighter.xml
 data/events.xml
 data/events_boss.xml
 data/events_crystal.xml
 data/events_engi.xml
 data/events_fuel.xml
 data/events_imageList.xml
 data/events_mantis.xml
 data/events_nebula.xml
 data/events_pirate.xml
 data/events_rebel.xml
 data/events_rock.xml
 data/events_ships.xml
 data/events_slug.xml
 data/events_zoltan.xml
 data/fed_bomber.txt
 data/fed_bomber.xml
 data/fed_cruiser.txt
 data/fed_cruiser.xml
 data/fed_cruiser_2.txt
 data/fed_cruiser_2.xml
 data/fed_scout.txt
 data/fed_scout.xml
 data/jelly_button.txt
 data/jelly_button.xml
 data/jelly_croissant.txt
 data/jelly_croissant.xml
 data/jelly_cruiser.txt
 data/jelly_cruiser.xml
 data/jelly_cruiser_2.txt
 data/jelly_cruiser_2.xml
 data/jelly_truffle.txt
 data/jelly_truffle.xml
 data/kestral.txt
 data/kestral.xml
 data/kestral_2.txt
 data/kestral_2.xml
 data/mantis_bomber.txt
 data/mantis_bomber.xml
 data/mantis_cruiser.txt
 data/mantis_cruiser.xml
 data/mantis_cruiser_2.txt
 data/mantis_cruiser_2.xml
 data/mantis_fighter.txt
 data/mantis_fighter.xml
 data/mantis_scout.txt
 data/mantis_scout.xml
 data/nameEvents.xml
 data/names.xml
 data/newEvents.xml
 data/rebel_long.txt
 data/rebel_long.xml
 data/rebel_squat.txt
 data/rebel_squat.xml
 data/rock_assault.txt
 data/rock_assault.xml
 data/rock_cruiser.txt
 data/rock_cruiser.xml
 data/rock_cruiser_2.txt
 data/rock_cruiser_2.xml
 data/rock_fight.txt
 data/rock_fight.xml
 data/rock_scout.txt
 data/rock_scout.xml
 data/sector_data.xml
 data/sounds.xml
 data/stealth.txt
 data/stealth.xml
 data/stealth_2.txt
 data/stealth_2.xml
 data/tooltips.xml


You should replace ~/Downloads/ftldat by the folder where you unpacked ftldat. Now you can edit the files in the new folder data.dat-unpacked. You can open it in finder by typing:

Code: Select all

open data.dat-unpacked


Before you repack them, you should make a backup of data.dat. For instance, type:

Code: Select all

cp data.dat data.dat.backup


To restore the backup, you could type:

Code: Select all

cp data.dat.backup data.dat


Now, to repack the files:

Code: Select all

bas@emma /Applications/FTL.app/Contents/Resources $ python ~/Downloads/ftldat/src/main.py pack data.dat
Listing files to pack ...
Create datfile ...
Packing ...
 data/achievements.xml
 data/animations.xml
 data/auto_assault.txt
 data/auto_assault.xml
 data/auto_basic.txt
 data/auto_basic.xml
 data/autoBlueprints.xml
 data/blueprints.xml
 data/boss_1.txt
 data/boss_1.xml
 data/boss_2.txt
 data/boss_2.xml
 data/boss_3.txt
 data/boss_3.xml
 data/circle_bomber.txt
 data/circle_bomber.xml
 data/circle_cruiser.txt
 data/circle_cruiser.xml
 data/circle_cruiser_2.txt
 data/circle_cruiser_2.xml
 data/circle_scout.txt
 data/circle_scout.xml
 data/credits.txt
 data/crystal_bomber.txt
 data/crystal_bomber.xml
 data/crystal_cruiser.txt
 data/crystal_cruiser.xml
 data/crystal_cruiser_2.txt
 data/crystal_cruiser_2.xml
 data/crystal_scout.txt
 data/crystal_scout.xml
 data/energy_bomber.txt
 data/energy_bomber.xml
 data/energy_cruiser.txt
 data/energy_cruiser.xml
 data/energy_cruiser_2.txt
 data/energy_cruiser_2.xml
 data/energy_fighter.txt
 data/energy_fighter.xml
 data/events.xml
 data/events_boss.xml
 data/events_crystal.xml
 data/events_engi.xml
 data/events_fuel.xml
 data/events_imageList.xml
 data/events_mantis.xml
 data/events_nebula.xml
 data/events_pirate.xml
 data/events_rebel.xml
 data/events_rock.xml
 data/events_ships.xml
 data/events_slug.xml
 data/events_zoltan.xml
 data/fed_bomber.txt
 data/fed_bomber.xml
 data/fed_cruiser.txt
 data/fed_cruiser.xml
 data/fed_cruiser_2.txt
 data/fed_cruiser_2.xml
 data/fed_scout.txt
 data/fed_scout.xml
 data/jelly_button.txt
 data/jelly_button.xml
 data/jelly_croissant.txt
 data/jelly_croissant.xml
 data/jelly_cruiser.txt
 data/jelly_cruiser.xml
 data/jelly_cruiser_2.txt
 data/jelly_cruiser_2.xml
 data/jelly_truffle.txt
 data/jelly_truffle.xml
 data/kestral.txt
 data/kestral.xml
 data/kestral_2.txt
 data/kestral_2.xml
 data/mantis_bomber.txt
 data/mantis_bomber.xml
 data/mantis_cruiser.txt
 data/mantis_cruiser.xml
 data/mantis_cruiser_2.txt
 data/mantis_cruiser_2.xml
 data/mantis_fighter.txt
 data/mantis_fighter.xml
 data/mantis_scout.txt
 data/mantis_scout.xml
 data/nameEvents.xml
 data/names.xml
 data/newEvents.xml
 data/rebel_long.txt
 data/rebel_long.xml
 data/rebel_squat.txt
 data/rebel_squat.xml
 data/rock_assault.txt
 data/rock_assault.xml
 data/rock_cruiser.txt
 data/rock_cruiser.xml
 data/rock_cruiser_2.txt
 data/rock_cruiser_2.xml
 data/rock_fight.txt
 data/rock_fight.xml
 data/rock_scout.txt
 data/rock_scout.xml
 data/sector_data.xml
 data/sounds.xml
 data/stealth.txt
 data/stealth.xml
 data/stealth_2.txt
 data/stealth_2.xml
 data/tooltips.xml


Once again, replace ~/Downloads/ftldat by the actual folder you unpacked ftldat.zip. Hope this helps you out.
buzzyrecky
Posts: 43
Joined: Wed Sep 19, 2012 8:15 am

Re: [Modding] Packing and unpacking data.dat and resource.da

Postby buzzyrecky » Wed Sep 19, 2012 8:24 am

Woo.

Don't know if it's already being done, but I want to make a mod just for myself with plenty of new events, so there's a fresher variety. (It would be cool if we had a huge community effort where everyone contributed events to compile into one data.dat, but that sounds like a lot of work so idk)
bas
Posts: 36
Joined: Fri Sep 14, 2012 3:36 pm

Re: [Modding] ftldat r6 (was: Packing ad unpacking data.dat.

Postby bas » Wed Sep 19, 2012 3:17 pm

Bump.
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [Modding] ftldat r6 (was: Packing ad unpacking data.dat.

Postby CaptainShooby » Wed Sep 19, 2012 4:45 pm

Amazing work bas! Thanks for making this :)

buzzyrecky wrote:Don't know if it's already being done, but I want to make a mod just for myself with plenty of new events, so there's a fresher variety.


I just released my guide on creating custom events and sectors, maybe it can help you:
http://www.ftlgame.com/forum/viewtopic.php?f=4&t=2533
Sorry for advertising..
LordOfKaranda
Posts: 2
Joined: Wed Sep 19, 2012 11:44 pm

Re: [Modding] ftldat r6 (was: Packing ad unpacking data.dat.

Postby LordOfKaranda » Thu Sep 20, 2012 1:36 am

Norton keeps removing the installer could someone please help. I am relay looking forward to making mods for this game.
bas
Posts: 36
Joined: Fri Sep 14, 2012 3:36 pm

Re: [Modding] ftldat r7 (was: Packing ad unpacking data.dat.

Postby bas » Thu Sep 20, 2012 10:29 pm

Bump for new version (r7).