Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
mr_easy_money
Posts: 621
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby mr_easy_money » Sun Sep 10, 2017 5:57 am

Jimli_ wrote:Hey there, don't know much about event modding and I followed what you just said but the event I whipped up here doesn't seem to be loading in game.

Code: Select all

<event name="START_BEACON">
   <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
   <choice>
      <text>First, let's recruit another crew member.</text>
      <event load="J_CUSTOM_CREW" />
   </choice>
</event>
<event name="J_CUSTOM_CREW">
   <text>Before leaving the station, you're given the oppurtunity to choose a skilled addition to your crew. You have a few options.</text>
   <choice>
      <text>The ace pilot.</text>
      <crewMember amount="1"/>
   </choice>
   <choice>
      <text>The Engi mechanic.</text>
      <crewMember amount="1"/>
   </choice>
   <choice>
      <text>The Rock mercenary</text>
      <crewMember amount="1"/>
   </choice>
</event>


I know I haven't specified the race of the crew member, but shouldn't this event still load and give random crew members? It's just not changing anything, no event at the starting beacon.

the problem lies with the "choice" element having only two possible sub-elements, "text" and "event". in this case you need the "event" element to house the "crewMember" element, like so.
I added other details to the "crewMember" elements to account for their descriptions before realizing the last part of what you wrote... uh.. :roll: Engi mechanic is rather vague considering Engi's are mechanics...

Code: Select all

<event name="J_CUSTOM_CREW">
   <text>Before leaving the station, you're given the oppurtunity to choose a skilled addition to your crew. You have a few options.</text>
   <choice>
      <text>The ace pilot.</text>
      <event>
         <crewMember pilot="2" amount="1"/>
      </event>
   </choice>
   <choice>
      <text>The Engi mechanic.</text>
      <event>
         <crewMember class="engi" repair="1" amount="1"/>
      </event>
   </choice>
   <choice>
      <text>The Rock mercenary</text>
      <event>
         <crewMember class="rock" amount="1"/>
      </event>
   </choice>
</event>

In general, looking at the vanilla files can help you determine what tags/elements go where, as can files of other mods, and that events file structure wiki page might provide some clues.

additionally, I advise using FTL Error Checker, viewtopic.php?f=12&t=17034, to check for problems, though it does think some things are wrong when they aren't, like having a weapon refer to a blueprintList or removing more than one crewmember at a time.

I hope that cleared up the confusion? ;)
User avatar
Jimli_
Posts: 81
Joined: Sat Feb 20, 2016 1:16 am

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby Jimli_ » Sun Sep 10, 2017 1:06 pm

Thanks, that was a big help.
ImageImageImage
User avatar
mr_easy_money
Posts: 621
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby mr_easy_money » Sun Sep 10, 2017 6:48 pm

Jimli_ wrote:Thanks, that was a big help.

I realized I forgot one detail about "event" elements. usually, all events should have a "text" sub-element, which is missing from the event I made within the choice that gives you a crew member.

Code: Select all

<choice>
   <text>The ace pilot.</text>
   <event>
      <crewMember pilot="2" amount="1"/>
   </event>
</choice>

In this case it isn't really necessary because there aren't any choices or a ship fight to follow the event, though a text element might be helpful to better introduce the new crew members, but if you don't want to because you can see the crew you're hiring it's not a big deal, and vanilla does this in some places.
However without the text element, anything afterwards will be skipped, which can lead to a big problem if it's left out when a ship is introduced because it will skip right to the ship fight, no prompt that it's hostile. Now that I think about it, that's probably how slow's No Time to Lose mod works.
User avatar
CarreraCT
Posts: 10
Joined: Wed Sep 06, 2017 1:04 am

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby CarreraCT » Tue Sep 12, 2017 12:47 am

mr_easy_money wrote:
CarreraCT wrote:Hello,
I'm new to posting with community so I apologize in advance if I'm posting in the wrong forum.

Hello! This is the modding questions thread so you're in the right place. :)
CarreraCT wrote:Once I finish creating a player ship, I send it to Slipstream, install and test it out. However, all ships, including the defaults when my mod is installed, get various amounts of yellow and black checkered patterns over it.
...
1. How do you fix the yellow and black checked pattern?

There is an answer to this on the Superluminal FAQ
Q: When I try to play my ship in-game, it has black-yellow checkered images on it!
This happens when you've installed mods with SMM while the editor was running, and then saved the ship. The solution is to either not do that, or use File > Reload Database as soon as you return to the editor.
Update: Since beta10, the editor will reload the database automatically when it detects that you've modified the game's archives.

CarreraCT wrote:Next, I've tried adding enemy ships but they do not show up. After a few minutes I realized they needed an event in which to show up in. So I searched on here for a bit and found CaptianShooby's FTL Modding Tutorial. This also wasn't helping as the very first download (FTLdat) I cant even get the computer to run since it is files. (I don't know how to run files honestly). I also cant find anyway to make events and after briefly reviewing CaptianShooby's tutorial again I only came out confused.

Therein lies the problem. CaptainShooby's tutorial, while maybe good as a guideline for tracing how sector_data.xml works with the events files, is outdated. Nobody uses ftldat anymore because Slipstream Mod Manager is better in every way.

CarreraCT wrote:3. Is there anything easier to understand on how to add events to sectors?

first and foremost, open readme_modders.txt in the folder you run Slipstream from. The first two sections, "Creating an .ftl File" and "The Append Extension" will get you up to speed on some modding basics.

Unfortunately, most of the modding guides having to do with event structure are outdated. Finding the vanilla files and just looking at those to trace how sector_data.xml works with events.xml and so on can be more helpful than deciphering them, though I will say that some of the older guides can give you pointers on how to read the xml stuff, for example this, https://ftlwiki.com/wiki/Events_file_structure

using a text editor like notepad++ or vim can help to give colors and folding on xml files rather than using the default notepad which imo is just impossible to look at.

(for getting the vanilla files, useful for seeing how sector_data file, events files, and autoBlueprints files are interconnected)
go to slipstream and click patch once it opens to restore it to vanilla, then go to File -> Extract Dats... This'll extract the dat files into a collection of files, xml (and txt) data files for data.dat, and various resource files for resource.dat.

Try looking through CaptainShooby's tutorial again, only paying attention to steps 2) and 3).

(for just adding an event with a ship to the start beacon for testing purposes)
pop this in events.xml.append

Code: Select all

<event name="START_BEACON">
   <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
   <choice>
      <text>Testing an event...</text>
      <event load="MY_CUSTOM_SHIP_EVENT" />
   </choice>
</event>
<event name="MY_CUSTOM_SHIP_EVENT">
   <text>Uh oh, an enemy ship! Battle Stations!</text>
   <ship load="HELLO_SHIP" hostile="true">
</event>
<ship name="HELLO_SHIP" auto_blueprint="NAME_OF_SHIP_IN_AUTO_BLUEPRINTS">
   <destroyed load="DESTROYED_DEFAULT"/>
   <deadCrew load="DEAD_CREW_DEFAULT"/>
</ship>

think that should work...

sorry, I got distracted, uh, I hope that helps, and if there is still confusion I'll answer your questions with a fresh look later... :roll:



Hello again,
I wanted to thank you for explaining all my questions I had. Unfortunately I'm slow witted and still remain confused. I took a look on slipstream for the modder section but I don't quite understand what its talking about.

Second I have no idea where to exactly find these events.xml.append as well as any other files to modify besides the ships, img, and sounds. Which reminds me what if forgot to mention.

How to create and add custom sounds and images. I'm sure the image is standard with events now that I think about it however.

Anyways feel free to respond to which ever at any rate.
Thanks again for your help!
Scilencerz Constantly develop their technology with the help of many games, one of their biggest belong to FTL ships even outpacing Pixel Starships' ships and Galaxy on Fire's Ships with its mass of weapons and systems. Keep on modding :)
User avatar
mr_easy_money
Posts: 621
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby mr_easy_money » Tue Sep 12, 2017 3:09 am

CarreraCT wrote:Hello again,

hello! :)
CarreraCT wrote:I took a look on slipstream for the modder section but I don't quite understand what its talking about.

I guess I'll go over it here then.

Where does modding come from?
The two files in that "resources" folder of wherever FTL is installed contain everything that modding consists of. I said how to extract these two files in my previous reply, which should have resulted in getting the following folders,
from data.dat:
  • data
all the files inside the data folder are text-type files mods will either replace or add onto.

from resource.dat:
  • audio
  • fonts
  • img
all the files inside these folders are what you'd expect them to be: fonts can only be changed, audio in the audio folder can be changed or other sounds can be added (the better approach), and images can be added into some of the img folder's sub-folders, but not all. the other sub-folders have files that can only be changed.

What does slipstream do?
Slipstream opens up these two files, data.dat, and then uses files inside mods to replace existing (vanilla) files, add onto existing files, or add new files. Then slipstream puts all the stuff in and repacks these two files, which are crucial to FTL.

What are mods made of?
Mods come in the form of .ftl files. These .ftl files are just renamed .zip files (compressed zipped folders), which can have all the folders inside that result from extracting the data.dat and resource.dat files, along with a mod-appendix folder (see below). extracting one of the example mods that comes with Slipstream, Beginning Scrap Advantage, gives us a folder with the following sub-folders.
  • data
inside this folder we have an "events.xml.append" file, with the following code inside. all this event does is let you get a reward on the start event.

Code: Select all

<event name="START_GAME">
   <text>The data you carry is vital to the remaining Federation fleet. You'll need supplies for the journey, so make sure to explore each sector before moving on to the next. But get to the exit before the pursuing Rebel fleet can catch up!</text>
</event>

<event name="START_BEACON">
   <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Mod) Strip a near-by asteroid for scrap.</text>
      <event>
         <text>You take a shuttle and grab as much metal as you can.</text>
         <autoReward level="HIGH">scrap_only</autoReward>
      </event>
   </choice>
</event>

notice that this file has an .append extension at the end of the file name. if an .append extension was not used, this mod would replace the entire contents of the existing events.xml file, which is problematic because that file contains event information which is used in other files. if you're just going to add events or replace some existing events, use the .append extension.
this goes for other data files where you're just going to add some stuff, not replace all of a file's contents. as an example, you can see this when you saved the enemy ship in superluminal, you get an "autoBlueprints.xml.append" file in the mod's "data" folder, so that it doesn't replace that entire file, just adds something into it.

note that you can override vanilla events and other existing tags by simply repeating that tag again. in this case, the event "START_BEACON" is overridden so that a choice for free scrap is there. (note that there is a way to add stuff to existing events without replacing them, promoting compatibility with other mods, under the "Advanced XML" section in that modders readme, but I'll only go over it if you want)

  • mod-appendix
inside this folder we have a "metadata.xml" file. this file is just for the description you see when you select a mod in Slipstream. helpful, but does not change FTL whatsoever.

CarreraCT wrote:Second I have no idea where to exactly find these events.xml.append as well as any other files to modify besides the ships, img, and sounds.

the "events.xml.append" file is a file you as the modder create. you can create a .txt file, and then rename it to match both the name and extension/file-type.
CarreraCT wrote:Which reminds me what if forgot to mention ... How to create and add custom sounds and images. I'm sure the image is standard with events now that I think about it however.

if you're wondering how to create custom sounds and images for weapons, see this guide, viewtopic.php?f=12&t=17122

if you're wondering how to add custom background images and planets, look in the vanilla folders (the extracted data.dat and resource.dat files) at the "events_imageList.xml" file in the "data" folder and compare it with the images in the "stars" folder in the "img" folder. events and text tags in the events files reference the imageLists in this "events_imageList.xml" file to load them in the game. I'm not entirely certain if you can switch to another image after loading one into an event, but it might be possible.

I hope that cleared up the confusion, but as always, if you have any questions, please ask away. ;)
User avatar
CarreraCT
Posts: 10
Joined: Wed Sep 06, 2017 1:04 am

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby CarreraCT » Sat Sep 16, 2017 4:20 am

mr_easy_money wrote:
CarreraCT wrote:Hello again,

hello! :)
CarreraCT wrote:I took a look on slipstream for the modder section but I don't quite understand what its talking about.

I guess I'll go over it here then.

Where does modding come from?
The two files in that "resources" folder of wherever FTL is installed contain everything that modding consists of. I said how to extract these two files in my previous reply, which should have resulted in getting the following folders,
from data.dat:
  • data
all the files inside the data folder are text-type files mods will either replace or add onto.

from resource.dat:
  • audio
  • fonts
  • img
all the files inside these folders are what you'd expect them to be: fonts can only be changed, audio in the audio folder can be changed or other sounds can be added (the better approach), and images can be added into some of the img folder's sub-folders, but not all. the other sub-folders have files that can only be changed.

What does slipstream do?
Slipstream opens up these two files, data.dat, and then uses files inside mods to replace existing (vanilla) files, add onto existing files, or add new files. Then slipstream puts all the stuff in and repacks these two files, which are crucial to FTL.

What are mods made of?
Mods come in the form of .ftl files. These .ftl files are just renamed .zip files (compressed zipped folders), which can have all the folders inside that result from extracting the data.dat and resource.dat files, along with a mod-appendix folder (see below). extracting one of the example mods that comes with Slipstream, Beginning Scrap Advantage, gives us a folder with the following sub-folders.
  • data
inside this folder we have an "events.xml.append" file, with the following code inside. all this event does is let you get a reward on the start event.

Code: Select all

<event name="START_GAME">
   <text>The data you carry is vital to the remaining Federation fleet. You'll need supplies for the journey, so make sure to explore each sector before moving on to the next. But get to the exit before the pursuing Rebel fleet can catch up!</text>
</event>

<event name="START_BEACON">
   <text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Mod) Strip a near-by asteroid for scrap.</text>
      <event>
         <text>You take a shuttle and grab as much metal as you can.</text>
         <autoReward level="HIGH">scrap_only</autoReward>
      </event>
   </choice>
</event>

notice that this file has an .append extension at the end of the file name. if an .append extension was not used, this mod would replace the entire contents of the existing events.xml file, which is problematic because that file contains event information which is used in other files. if you're just going to add events or replace some existing events, use the .append extension.
this goes for other data files where you're just going to add some stuff, not replace all of a file's contents. as an example, you can see this when you saved the enemy ship in superluminal, you get an "autoBlueprints.xml.append" file in the mod's "data" folder, so that it doesn't replace that entire file, just adds something into it.

note that you can override vanilla events and other existing tags by simply repeating that tag again. in this case, the event "START_BEACON" is overridden so that a choice for free scrap is there. (note that there is a way to add stuff to existing events without replacing them, promoting compatibility with other mods, under the "Advanced XML" section in that modders readme, but I'll only go over it if you want)

  • mod-appendix
inside this folder we have a "metadata.xml" file. this file is just for the description you see when you select a mod in Slipstream. helpful, but does not change FTL whatsoever.

CarreraCT wrote:Second I have no idea where to exactly find these events.xml.append as well as any other files to modify besides the ships, img, and sounds.

the "events.xml.append" file is a file you as the modder create. you can create a .txt file, and then rename it to match both the name and extension/file-type.
CarreraCT wrote:Which reminds me what if forgot to mention ... How to create and add custom sounds and images. I'm sure the image is standard with events now that I think about it however.

if you're wondering how to create custom sounds and images for weapons, see this guide, https://subsetgames.com/forum/viewtopic ... 12&t=17122

if you're wondering how to add custom background images and planets, look in the vanilla folders (the extracted data.dat and resource.dat files) at the "events_imageList.xml" file in the "data" folder and compare it with the images in the "stars" folder in the "img" folder. events and text tags in the events files reference the imageLists in this "events_imageList.xml" file to load them in the game. I'm not entirely certain if you can switch to another image after loading one into an event, but it might be possible.

I hope that cleared up the confusion, but as always, if you have any questions, please ask away. ;)



Alright so I believe I have made a basic start event text in notepad++. What do I save it as and where as I cant find anywhere that seems suitable. I cant even find the vanilla events to modify at all. I honestly hope your not too bothered by probably repeat questions I'm just having a hard time trying to figure this out.
Scilencerz Constantly develop their technology with the help of many games, one of their biggest belong to FTL ships even outpacing Pixel Starships' ships and Galaxy on Fire's Ships with its mass of weapons and systems. Keep on modding :)
User avatar
mr_easy_money
Posts: 621
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby mr_easy_money » Sat Sep 16, 2017 6:38 pm

CarreraCT wrote:Alright so I believe I have made a basic start event text in notepad++. What do I save it as

save it as "events.xml.append", making sure the extension changed and not just the file name

Image

if you're on windows but can't see the file extensions, on the newer versions of windows there's a view tab at the top with an option to see them. there's some other way to do it in control panel or something, search online for that

Image
CarreraCT wrote:and where as I cant find anywhere that seems suitable.

place that file inside a folder called data. add that "mod-appendix" folder with a changed metadata.xml file to give it a custom description in Slipstream

Image

then finally send the folder(s) to a compressed zipped folder. once that's done you'll have a ".zip" which you can rename to a ".ftl" file, and then place in the "mods" folder of Slipstream. that should do it :)

Image

CarreraCT wrote:I cant even find the vanilla events to modify at all.

(by modify, I hope you mean take parts of them and change them, then make xml.append files to overwrite those parts)
go into Slipstream and select File → Extract Dats...

Image

it should bring up a dialog with the following header,

Image

then it should be straightforward, extract the dats into a folder, then go to that folder to see the extracted files.

I hope the pictures cleared up the confusion? :mrgreen:
User avatar
CarreraCT
Posts: 10
Joined: Wed Sep 06, 2017 1:04 am

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby CarreraCT » Sat Sep 16, 2017 9:35 pm

I'm sorry to keep on messaging you but I still cannot do it right. I have tried for almost an hour now trying to get the text to work but I've come to the conclusion that I've done it all wrong again. I have gotten it zipped up into a .ftl file and the event is a event.xml.append file in the same fashion as your screenshots have shown (Which yes they helped significantly with understanding as I'm more of a visual learner) but I have to be doing something wrong with the actual editing as its the only thing that I'm not fully confident in. Ive tried two ways to modify the startbeacon text, 1. I copied the code you sent two messages ago in your response
<event name="START_GAME">
<text>The data you carry is vital to the remaining Federation fleet. You'll need supplies for the journey, so make sure to explore each sector before moving on to the next. But get to the exit before the pursuing Rebel fleet can catch up!</text>
</event>

<event name="START_BEACON">
<text>Welcome to a new sector! Get to the exit beacon and jump to the next sector before the pursuing Rebels catch you!</text>
<choice hidden="true">
<text>Continue...</text>
<event/>
</choice>
<choice req="engines" lvl="1" hidden="true">
<text>(Mod) Strip a near-by asteroid for scrap.</text>
<event>
<text>You take a shuttle and grab as much metal as you can.</text>
<autoReward level="HIGH">scrap_only</autoReward>
</event>
</choice>
</event>

which I have tried editing its own custom file and 2. Taking a copy of the actual game data and modifying that directing as its own .append. Neither have worked. I'm starting to get rather upset at myself for not figuring this all out already with the amount of help you've given me, but sadly I still haven't gotten to it. Thanks for your help so far though
Scilencerz Constantly develop their technology with the help of many games, one of their biggest belong to FTL ships even outpacing Pixel Starships' ships and Galaxy on Fire's Ships with its mass of weapons and systems. Keep on modding :)
User avatar
mr_easy_money
Posts: 621
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby mr_easy_money » Sun Sep 17, 2017 5:10 am

first off, do you see a blue choice at the start beacon? if that's true, then the mod is loading correctly, just that something is off about what you're trying to do (below). if it isn't true, post a download link to the ftl file here and I'll see if there are any errors with it.

CarreraCT wrote:Ive tried two ways to modify the startbeacon text

oh :oops: therein lies the problem. the text that's displayed when you start up the game on the first beacon consists of the text from the START_GAME event (in events.xml) and a tip from the TIPS_LIST_PC textList (in newEvents.xml). the text in the START_BEACON event is overwritten so that text should be ignored.

in events.xml.append,

Code: Select all

<event name="START_GAME">
   <text>Testing testing 123... Data you're carrying is vital to the survival of the Federation. Rebels' pursuing ya, be careful, but be sure to take as much time as you can to upgrade your ship's offenses and defenses. You're our last hope. Captain Tully out!</text>
</event>

<event name="START_BEACON">
   <text>Ignore this text it isn't used...</text>
   <choice hidden="true">
      <text>Continue...</text>
      <event/>
   </choice>
   <choice req="engines" lvl="1" hidden="true">
      <text>(Mod) Strip a near-by asteroid for scrap.</text>
      <event>
         <text>You take a shuttle and grab as much metal as you can.</text>
         <autoReward level="HIGH">scrap_only</autoReward>
      </event>
   </choice>
</event>

I replaced the tip in newEvents.xml.append just to show it's possible. optional and should only be done if you don't want to see a random tip on the start beacon.

Code: Select all

<textList name="TIPS_LIST_PC">
   <text>Tip: This is a tip, you are reading... a tip. This tip isn't very helpful, but it's a tip! Or is it...</text>
</textList>

result:

Image
CarreraCT wrote:I'm starting to get rather upset at myself for not figuring this all out already with the amount of help you've given me, but sadly I still haven't gotten to it.

I'll take the blame for that, I must've missed something when explaining.. :roll:
User avatar
CarreraCT
Posts: 10
Joined: Wed Sep 06, 2017 1:04 am

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Postby CarreraCT » Sun Sep 17, 2017 10:18 pm

That's the problem. I still cant get it to load at all. Ive tried to edit the start_game now and still no luck regardless how I do it or install it. I simply cant understand why I keep failing to get this to work. Perhaps I should try a new way to look at this. Perhaps you can program the texts instead. I can at least make ship designs and I will try to make new weapons but for events you seem to be able to work this much easier then me. Would you be willing to help me with the events as a partnership?
Scilencerz Constantly develop their technology with the help of many games, one of their biggest belong to FTL ships even outpacing Pixel Starships' ships and Galaxy on Fire's Ships with its mass of weapons and systems. Keep on modding :)

Who is online

Users browsing this forum: No registered users and 22 guests