[Modding] R&D and current findings

Discuss and distribute tools and methods for modding. Moderator - Grognak
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

[Modding] R&D and current findings

Postby CaptainShooby » Sun Sep 16, 2012 5:13 pm

Greetings.

I'm CaptainShooby and I think it would be helpful to gather information about modding FTL under a single thread.
I also have a thread running on Reddit: http://www.reddit.com/r/ftlgame/comments/zz3pc/modding_rd_and_current_findings/

GOOD NEWS EVERYONE
I contacted the author of the FTLWiki and he kindly set up some modding sections in there.
I suggest we add all our discoveries there from now on.

http://ftlwiki.com/wiki/Home
http://ftlwiki.com/wiki/Mods
http://ftlwiki.com/wiki/Modding_Guide


ftldat by bas thank you!
a tool for unpacking and packing of the FTL .dat files

Findings


I'm currently working on custom sectors and events. My findings and progress so far:

I'm also writing a tutorial/guide on everything I do so that I can help others as well.
I have to rethink the structure of my guide, but most of the content for the first part is ready.

If you are modding FTL as well, please comment and share your findings!

edit: update
Last edited by CaptainShooby on Wed Sep 19, 2012 4:35 pm, edited 12 times in total.
Techercizer
Posts: 45
Joined: Sat Sep 15, 2012 6:02 pm

Re: [Modding] R&D and current findings

Postby Techercizer » Sun Sep 16, 2012 5:18 pm

Thanks for the heads up. I'm going to try and mod my ship/crew names so I don't have to keep changing them every time.
StealthCl0wn
Posts: 78
Joined: Sat Sep 15, 2012 6:55 pm

Re: [Modding] R&D and current findings

Postby StealthCl0wn » Sun Sep 16, 2012 5:20 pm

Using the DRM free version, I seem to be unable to mod anything, as the changes either don't show or cause crashes.
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [Modding] R&D and current findings

Postby CaptainShooby » Sun Sep 16, 2012 5:32 pm

StealthCl0wn wrote:Using the DRM free version, I seem to be unable to mod anything, as the changes either don't show or cause crashes.


I think I read somewhere that the DRM version has a read-only folder structure. You have to move the data.dat and resource.dat files out of there and unpack them elsewhere. You can then make changes, repack and move them back in to the original folder. Let us know if this works!
StealthCl0wn
Posts: 78
Joined: Sat Sep 15, 2012 6:55 pm

Re: [Modding] R&D and current findings

Postby StealthCl0wn » Sun Sep 16, 2012 5:46 pm

CaptainShooby wrote:
StealthCl0wn wrote:Using the DRM free version, I seem to be unable to mod anything, as the changes either don't show or cause crashes.


I think I read somewhere that the DRM version has a read-only folder structure. You have to move the data.dat and resource.dat files out of there and unpack them elsewhere. You can then make changes, repack and move them back in to the original folder. Let us know if this works!


Right so, I'm using two .bat files to automate it.


@echo off
ftldat unpack data.dat c:\users\user\desktop
ftldat unpack resources.dat c:\users\user\desktop

The "pack" .bat looks the same, but what should I set the filepath as? AFAIK I set it to the "data" folder it creates and it still crashes.
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [Modding] R&D and current findings

Postby CaptainShooby » Sun Sep 16, 2012 5:58 pm

The "pack" .bat looks the same, but what should I set the filepath as? AFAIK I set it to the "data" folder it creates and it still crashes.


Without additional parameters, ftldat tries to find the unpacked folders in its own directory. You are currently creating them on your desktop, so change your pack.bat to this:

Code: Select all

@echo off
ftldat pack c:\users\user\desktop\data.dat c:\users\user\desktop\data.dat-unpacked
ftldat pack c:\users\user\desktop\resource.dat c:\users\user\desktop\resource.dat-unpacked

Note that you don't really have to unpack and pack the resource.dat if you are not making changes to audio, graphics or fonts.

This should create the new data.dat and resource.dat files on your desktop. You then place these in the original resources -folder. Now, unless you've made changes that themselves cause crashing, everything should work.

Currently, it's hard to know what kind of changes we can implement without crashes so it's better to make small ones and run a lot of testing in between.
Zuriki
Posts: 30
Joined: Sat Sep 15, 2012 1:58 pm

Re: [Modding] R&D and current findings

Postby Zuriki » Sun Sep 16, 2012 6:20 pm

The room layout (shipname.txt) file is like this

Code: Select all

X_OFFSET
<number> [<number>*35 offsets the entire ship in the X axis]
Y_OFFSET
<number> [<number>*35 offsets the entire ship in the Y axis]
VERTICLE
<number> [<number> offsets the entire ship in the Y axis by this many pixels]
ELLIPSES [The shield graphic uses these parameters]
<width>
<height>
<x-offset>
<y-offset>
ROOM
<id> [Unique ID]
<x> [How many tiles from 0 the room is on the X-axis]
<y> [How many tiles from 0 the room is on the Y-axis]
<w> [How wide is the room]
<h> [How tall is the room]
DOOR
<x> [How many tiles from 0 the door is on the X-axis]
<y> [How many tiles from 0 the door is on the Y-axis]
<room (left/up)> [The room ID to the left (verticle) or above (horizontal) this door]
<room (right/down)> [The room ID to the right (verticle) or below (horizontal) this door]
<verticle/horizontal> [0 = verticle, 1 = horizontal : Door snaps to the left or top wall of that tile always]
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [Modding] R&D and current findings

Postby CaptainShooby » Sun Sep 16, 2012 6:26 pm

Zuriki wrote:The room layout (shipname.txt) file is like this


Whoa, nice work Zuriki!

My post will quickly become huge if I add all our findings.. Hmm.
I guess we should start adding this stuff to the wiki: http://ftlwiki.com/wiki/Home
Zuriki
Posts: 30
Joined: Sat Sep 15, 2012 1:58 pm

Re: [Modding] R&D and current findings

Postby Zuriki » Sun Sep 16, 2012 7:58 pm

Could you point me to the file that allows you to disable the rebel fleet?
CaptainShooby
Posts: 20
Joined: Sun Sep 16, 2012 4:54 pm

Re: [Modding] R&D and current findings

Postby CaptainShooby » Sun Sep 16, 2012 8:07 pm

Zuriki wrote:Could you point me to the file that allows you to disable the rebel fleet?


You can change this via events.xml
  • Find the event "START_GAME" and/or "START_BEACON"
  • Add <modifyPursuit amount="-100000"/>

When these events trigger, it will set the pursuit value to whatever you wish. -100000 is a bit overkill, but it works. "START_GAME" is triggered when you start a new game and "START_BEACON" is the default event for new sectors.

I've also added a link to a fresh data.dat file with nothing but these changes and instructions on how to use it:
http://www.reddit.com/r/ftlgame/comments/zyzl1/modder_has_figured_out_how_to_disable_fleet/c6911ii