Page 11 of 26

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

Posted: Mon Sep 17, 2012 10:26 am
by Vigilant
Packing:
ftldat pack N:\temp\FTL\resources\packed\data.dat N:\temp\FTL\resources\unpacked

Unpacking:
ftldat unpack N:\temp\FTL\resources\data.dat N:\temp\FTL\resources\unpacked

The bold and underlined part has to be identical.

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

Posted: Mon Sep 17, 2012 10:38 am
by StealthCl0wn
Alright, I've extracted everything to an "unpacked" folder, which in turn has the data folder in there.

So I don't mess this up, what should my pack.bat look like now? Unpack.bat is E:\FTL\Resources\Unpacked for reference

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

Posted: Tue Sep 18, 2012 3:09 pm
by ImATree
I was wondering if someone could help me set up ftldat. I'm on mac osx and I downloaded it and installed python and when i run it it says "-bash: /usr/bin/env python: No such file or directory" How do I get this to work. Help would be appreciated.

Thanks in advance!


:D

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

Posted: Tue Sep 18, 2012 4:09 pm
by bas
ImATree wrote:I was wondering if someone could help me set up ftldat. I'm on mac osx and I downloaded it and installed python and when i run it it says "-bash: /usr/bin/env python: No such file or directory" How do I get this to work. Help would be appreciated.

Thanks in advance!


:D
That is odd: you should not have to install Python – it is installed by default. What command did you execute?

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

Posted: Tue Sep 18, 2012 4:14 pm
by AtillaBosma
Hey guys, I found out how to add additional weapons to the game, just adding them, not yet making them dropped from events.
They are also duplicate weapons with just reskinned animations/models and damage values changed a bit, but I know people can figure it out further.

I shall give you a quick tutorial here:

Step 1: Unpack Data.dat and Resource.dat
That step is quite straightforward, follow the intructions in the first post.

Step 2: Go to data.dat-unpacked folder and look for these files:
Animations.xml, autoBlueprints.xml and Blueprints.xml.

Step 3: Open up Animations.xml.
What I did was make a duplicate missile, so look for

Code: Select all

<animSheet name="missiles_1" w="75" h="43" fw="25" fh="43">weapons/missiles_1_strip3.png</animSheet>
Copy that line and paste it underneath that line, rename it so it says this:

Code: Select all

<animSheet name="missiles_4" w="75" h="43" fw="25" fh="43">weapons/missiles_4_strip3.png</animSheet>
This means that it will start using the animation from the file missiles_4_strip3.png, but we'll get to that later.

Now look for this part of the code:

Code: Select all

<weaponAnim name="missiles_1">
	<sheet>missiles_1</sheet>
	<desc length="3" x="0" y="0"/>
	<chargedFrame>1</chargedFrame>
	<fireFrame>2</fireFrame>
	<firePoint  x="15" y="20"/>
	<mountPoint x="7" y="30"/>
	<chargeImage>weapons/missiles_1_glow.png</chargeImage>
</weaponAnim>
Copy that and paste it underneath with 1 line between, that means it will start using a duplicate version of missiles_1, change the code you pasted to:

Code: Select all

<weaponAnim name="missiles_4">
	<sheet>missiles_4</sheet>
	<desc length="3" x="0" y="0"/>
	<chargedFrame>1</chargedFrame>
	<fireFrame>2</fireFrame>
	<firePoint  x="15" y="20"/>
	<mountPoint x="7" y="30"/>
	<chargeImage>weapons/missiles_1_glow.png</chargeImage>
</weaponAnim>
This will make it so the weaponAnimation of Missiles_4, the one that we created earlier, will have the animation of missiles_1, you can make your own graphics but for the sake of this tutorial I didnt.

Now, the last part of the animations we have to cover is the actual projectile, look for this part of the code:

Code: Select all

<animSheet name="missile_1" w="32" h="80" fw="32" fh="80">weapons/missile_1.png</animSheet>
<anim name="missile_1">
	<sheet>missile_1</sheet>
	<desc length="1" x="0" y="0"/>
	<time>1</time>
</anim>
Do the same as last time and change the code to:

Code: Select all

<animSheet name="missile_4" w="32" h="80" fw="32" fh="80">weapons/missile_4.png</animSheet>
<anim name="missile_4">
	<sheet>missile_1</sheet>
	<desc length="1" x="0" y="0"/>
	<time>1</time>
</anim>
This means it will start using the file missile_4.png in the resource.dat as a graphic, but I'll get to that later.

Alright, we got the animations ready for our missile!
We only need to create the info about the missile, define its damage values and make it so your ship starts with it!

End of part 1 of this tutorial, I'll write part 2 as soon as possible.

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

Posted: Tue Sep 18, 2012 4:18 pm
by ImATree
bas wrote:
ImATree wrote:I was wondering if someone could help me set up ftldat. I'm on mac osx and I downloaded it and installed python and when i run it it says "-bash: /usr/bin/env python: No such file or directory" How do I get this to work. Help would be appreciated.

Thanks in advance!


:D
That is odd: you should not have to install Python – it is installed by default. What command did you execute?
I opened the setup.py using the python launcher that comes with python.

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

Posted: Tue Sep 18, 2012 4:30 pm
by AtillaBosma
Alright, lets continue!

Lets go to autoBlueprints.xml, this is gonna be a quick one since it's just 1 line of code that you need to add.

Look for:

Code: Select all

<name>MISSILES_1</name>
And then make a copy of it underneath it, rename it to:

Code: Select all

<name>MISSILES_4</name>
There we go, that is autoBlueprints.xml done!

Let's go further then, here comes the damage value part etc. etc.

Step 1: Go to Blueprints.xml and look for:

Code: Select all

<blueprintList name="STARTING_WEAPONS">
You should see

Code: Select all

	<name>MISSILES_2_PLAYER</name>
underneath it, make a copy of that line and paste it underneath it, of course renaming it to:

Code: Select all

<name>MISSILES_4</name>
again.

Now, here comes the damage value stuff, look for this line:

Code: Select all

<weaponBlueprint name="MISSILES_1">
	<type>MISSILES</type>
	<title>Leto Missiles</title>
	<short>Leto</short>
	<desc>This launcher is outdated and weak, but can still be effective.</desc>
	<tooltip>Fires 1 missile; does 1 damage; pierces all shields.</tooltip>
	<damage>1</damage>
	<missiles>1</missiles>
	<shots>1</shots>
	<sp>5</sp>
	<fireChance>1</fireChance>
	<breachChance>1</breachChance>
	<cooldown>9</cooldown>
	<power>1</power>
	<cost>20</cost>
	<bp>2</bp>
	<rarity>0</rarity>
	<image>missile_1</image>
	<launchSounds>
		<sound>smallMissile1</sound>
		<sound>smallMissile2</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>smallExplosion</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>hitShield1</sound>
		<sound>hitShield2</sound>
		<sound>hitShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>miss</sound>
	</missSounds>
	<weaponArt>missiles_1</weaponArt> 
</weaponBlueprint>
Copy that and paste it underneath it with 1 line inbetween, change the code you pasted underneath to:

Code: Select all

<weaponBlueprint name="MISSILES_4">
	<type>MISSILES</type>
	<title>PUTYOURWEAPONTITLEHERE</title>
	<short>SHORTNAMEFORYOUWEAPON</short>
	<desc>YOURWEAPONDESCRIPTION</desc>
	<tooltip>TOOLTIPFORYOURWEAPON</tooltip>
	<damage>AMOUNTOFDAMAGEITDOES</damage>
	<missiles>AMOUNTOFMISSILESITSHOOTS</missiles>
	<shots>AMOUNTOFSHOTSITSHOOTS</shots>
	<sp>5</sp>
	<fireChance>HOWMUCHCHANCEITHASTOCREATEAFIRE</fireChance>
	<breachChance>HOWMUCHCHANCEITHASTOBREAKHULL</breachChance>
	<cooldown>COOLDOWNTIME</cooldown>
	<power>POWERCOST</power>
	<cost>MONEYCOST</cost>
	<bp>2</bp>
	<rarity>HOWRAREITIS</rarity>
	<image>missile_4</image>
	<launchSounds>
		<sound>smallMissile1</sound>
		<sound>smallMissile2</sound>
	</launchSounds>
	<hitShipSounds>
		<sound>smallExplosion</sound>
	</hitShipSounds>
	<hitShieldSounds>
		<sound>hitShield1</sound>
		<sound>hitShield2</sound>
		<sound>hitShield3</sound>
	</hitShieldSounds>
	<missSounds>
		<sound>miss</sound>
	</missSounds>
	<weaponArt>missiles_4</weaponArt> 
</weaponBlueprint>
Of course don't forget to change all those big caps-locked messages to your liking.

End of part 2, next part will show you how to create custom animations and graphics.

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

Posted: Tue Sep 18, 2012 4:32 pm
by bas
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
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.

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

Posted: Tue Sep 18, 2012 4:33 pm
by bas
AtillaBosma wrote:Alright, lets continue!
Nice. Maybe this find deserves a topic on its own!

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

Posted: Tue Sep 18, 2012 4:43 pm
by AtillaBosma
Well then, let's go to the custom animations/graphics!

Step 1: Go to the folder resource.dat-unpacked
You have probably unpacked resource.dat and data.dat, or else you couldn't have started modding, so yeah, look for that folder.

Step 2: Go to img\weapons and make a copy of missile_1.png and missiles_1_strip_3.png
In the other 2 parts we told the code to look for these files, but we said that the name for them were missile_4.png and missiles_4_strip_3.png, so rename the copies you made of those files.

Step 3: Create your own graphics!
HINT: USE PAINT.NET OR PHOTOSHOP, IF YOU DONT THE FILES WILL LOOK LIKE BIG WHITE BLOCKS!

You can change the colour of the missile or launcher, maybe change it to a nyan gun or something, then just overwrite it!

Step 4: Pack the 2 folders!
What I did was make a .cmd file that automatically packs the 2 files, make a .cmd in the folder that has data.dat-unpacked and resource.dat-unpacked in it and paste this into the CMD:

Code: Select all

ftldat pack O:\FTLModding\data.dat O:\FTLModding\data.dat-unpacked
ftldat pack O:\FTLModding\resource.dat O:\FTLModding\resource.dat-unpacked
Then run the CMD and it will have created the 2 files called data.dat and resource.dat, put those in your FTL\resources folder and start the game, it will have the mods you included in the game!

And that's it, I will put 1 extra that will show you how to make it your starting weapon!