[Mod Help] examples of slipstream's "mod" commands

Discuss and distribute tools and methods for modding. Moderator - Grognak
mutecebu
Posts: 3
Joined: Sun Oct 12, 2014 3:22 am

[Mod Help] examples of slipstream's "mod" commands

Postby mutecebu » Sun Oct 12, 2014 5:16 pm

Hi there! Long-time lurker here. I'm finally trying my hand at modding FTL. I've read all the tutorials I can find, but here's one thing I'm still lacking: a more thorough explanation of Slipstreams unique commands like <mod-append> and <mod:setValue>, etc.

I *finally* found the list of commands in Slipstream's "readme_modders.txt". Some of the explanations are a little brief, though. I've seen them used in Eingi_Scrap_Advantage and in the "Universal Starting Beacon" framework post - these were both very helpful. Is there a good tutorial or mod that uses all the "mod:" commands?

Thanks!
Russian Rockman
Posts: 819
Joined: Fri Jan 10, 2014 11:43 pm

Re: [Mod Help] examples of slipstream's "mod" commands

Postby Russian Rockman » Sun Oct 12, 2014 7:48 pm

Hi there! :) Slipstream mod commands were very confusing for me too. The slipstream commands were not very helpful to me either. :? So I mostly learned how to use them by looking at other people's mods who were smarter than me. ;) So here are a couple examples I think will help you to get a much better understanding of how to use them.

This example removes the oxygen system from the Lanius B, :twisted: and changes the ship's starting crew and augs. The original blueprint can be found in dlcBlueprints.xml

Code: Select all

<mod:findName type="shipBlueprint" name="PLAYER_SHIP_ANAEROBIC_2">*
  <mod:findLike type="systemList">
    <mod:findLike type="oxygen">
      <mod:setAttributes start="false" />**
    </mod:findLike>
  </mod:findLike>
  <mod:findLike type="aug">
    <mod:removeTag />***
  </mod:findLike>
  <mod:findLike type="crewCount">
    <mod:removeTag />****
  </mod:findLike>
  <mod-append:crewCount amount="4" class="anaerobic" />*****
</mod:findName>

*The findName and findLike commands basically just help you locate the line you are trying to change.
findName is used to identify main title of the blueprint by looking for blueprint type= and name=, and findLike finds elements in the blueprint you want to change
**setAttributes is used to change parts of the actual header of an element.  So where the Lanius B blueprint used to read "<oxygen power="1" room="5" start="true"/>", the command will simply change it to "<oxygen power="1" room="5" start="false"/>" without touching anything else.
***The removeTag can be useful to either remove a tag completely, in this case we are removing the tag containing "<aug name="O2_MASKS"/>" so the Lanius B will no longer start with artificial respirators.  Cuz who needs oxygen... :P
****The removeTag arg can also be useful for removing multiple tags with the same name.  This should usually be done before editing the tag in this case because otherwise I believe slipstream might get confused which tag you are trying to edit.  In this example we removed both the tags "<crewCount amount = "1" class="engi"/> and <crewCount amount = "2" class="anaerobic"/>"
*****The mod-append command then added the tag   <mod-append:crewCount amount="4" class="anaerobic" />.  Adding 4 starting Lanius to compensate for having not being able to use oxygen breathers.


Code: Select all

<mod:findName type="shipBlueprint" name="PLAYER_SHIP_ROCK_3">
  <mod-overwrite:floorImage>rock_cruiser_3</mod-overwrite:floorImage>*
  <mod:findLike type="systemList">
    <mod:findLike type="engines">
      <mod:setAttributes img="room_engines_6"/>**
      <mod-overwrite:slot>***
        <direction>down</direction>
        <number>3</number>
      </mod-overwrite:slot>
    </mod:findLike>
  </mod:findLike>
</mod:findName>

*This time we used the mod-overwrite command instead of mod-append.  Personally I always use this command instead of mod-append.  The reason for this is it automatically "replaces" any existing tags of the name.  So you don't have to use the removeTag command before adding the new tag.  And it just simply adds the tag anyway if one doesn't already exist.  However, you should still use the removeTag command when there are multiple tags with the same name like in the above example.  In this case I changed the floor image of the Rock C because for some reason the AE Type C ships use the Type A floor images.
**As you can see, we can change other attributes using the setAttributes command.  This time I changed the room image rather than the start= attribute.
***In this case I'm changing the position of the engine room's console, because on the Rock C the console used to be sticking out of a door. :p  The position of the console is determined by another "sub"-tag inside a starting and closing tag like this
      <shields power="2" room="12" start="true" img="room_shields_3">
         <slot>
            <direction>left</direction>
            <number>2</number>
         </slot>
      </shields>
so I just used the mod-overwrite tag here, rather than setAttributes, which is for the "header" of the tag itself.


Code: Select all

The basic principles apply to all other blueprints, such as crew blueprints, weapon blueprints, and even events.  Here is another example where I add a choice to the event where there is a fire on a station and you can send your rock crew member in, or a repair drone.  Now you have another blue option for a Lanius crew member.

<mod:findName type="event" name="DISTRESS_STATION_FIRE">
<mod-append:choice hidden="true" req="anaerobic">
   <text>(Lanius Crew) Send your Lanius crew-member in</text>
   <event>
      <text>Your Lanius crew member walks directly into the blaze.  It drains all oxygen from the room within seconds.  The fire soon suffocates and your Lanius crew member returns an unlikely hero.</text>
      <choice hidden="true">
         <text>Contact the survivors.</text>
         <event>
            <text>With most of the fire under control, the scientists are able to help secure the station. They offer you their sincere gratitude and a generous reward.</text>
            <autoReward level="HIGH">augment</autoReward>
         </event>
      </choice>
   </event>
</mod-append:choice>
</mod:findName>
mutecebu
Posts: 3
Joined: Sun Oct 12, 2014 3:22 am

Re: [Mod Help] examples of slipstream's "mod" commands

Postby mutecebu » Sun Oct 12, 2014 10:11 pm

Thanks! That's a big help. It's exactly the kind of thing I was looking for.

For that matter, I don't suppose anyone has made a comprehensive list of various events we can cause? Like:

<boarders min="3" max="5" class="human"/>
<crewMember amount="1"/>
<ship load="FOOBAR" hostile="FALSE"/>
<ship hostile="true"/>
<item_modify>
<item type="drones" min="5" max="5"/>
</item_modify>

...the list goes on. For now, I'm just browsing through the data files looking for ideas.
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Mod Help] examples of slipstream's "mod" commands

Postby Sleeper Service » Sun Oct 12, 2014 11:35 pm

mutecebu wrote:For now, I'm just browsing through the data files looking for ideas.

From my experience that is actually the most viable way to learn what you want to know. See how the game handles whatever you want to mod and imitate it.
Russian Rockman
Posts: 819
Joined: Fri Jan 10, 2014 11:43 pm

Re: [Mod Help] examples of slipstream's "mod" commands

Postby Russian Rockman » Tue Oct 14, 2014 12:56 am

mutecebu wrote:Thanks! That's a big help. It's exactly the kind of thing I was looking for.

For that matter, I don't suppose anyone has made a comprehensive list of various events we can cause? Like:

<boarders min="3" max="5" class="human"/>
<crewMember amount="1"/>
<ship load="FOOBAR" hostile="FALSE"/>
<ship hostile="true"/>
<item_modify>
<item type="drones" min="5" max="5"/>
</item_modify>

...the list goes on. For now, I'm just browsing through the data files looking for ideas.

Well there is this page from the FTL Wiki. It's a bit outdated though and personally I think the Wiki(a) is much more organized. But this page helped me out a lot when I was just starting modding.

Who is online

Users browsing this forum: No registered users and 8 guests