[Help] Enemies loading weapons from blueprintLists

Discuss and distribute tools and methods for modding. Moderator - Grognak
SliderVX
Posts: 2
Joined: Sun Apr 09, 2017 3:50 am

[Help] Enemies loading weapons from blueprintLists

Postby SliderVX » Sun Apr 09, 2017 4:11 am

I'm new to FTL modding and wish to create a mod that includes custom enemies not found in the vanilla game. I've used superluminal 2 to create a test enemy (RM_TEST_DUMMY) which appears to work fine in-game when loaded except it never has any weapons. The following is the code for my custom ship and loading it:

rm_test_dummy.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--Copyright (c) 2012 by Subset Games. All rights reserved.-->
<img x="-76" y="-129" w="372" h="513" />
<offsets>
   <floor x="186" y="256" />
   <cloak x="186" y="256" />
</offsets>
<weaponMounts>
   <mount x="91" y="204" rotate="false" mirror="true" gib="-1" slide="up" />
   <mount x="273" y="220" rotate="false" mirror="false" gib="-1" slide="up" />
   <mount x="54" y="237" rotate="false" mirror="true" gib="-1" slide="up" />
   <mount x="314" y="237" rotate="false" mirror="false" gib="-1" slide="up" />
</weaponMounts>
<explosion>
   <gib1>
      <velocity min="1.35" max="1.49" />
      <direction min="0" max="0" />
      <angular min="-4.38" max="4.38" />
      <x>32</x>
      <y>253</y>
   </gib1>
</explosion>


autoBlueprints.xml.append:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<shipBlueprint name="RM_TEST_DUMMY" layout="rm_test_dummy" img="rm_test_dummy">
   <class>Test Dummy</class>
   <minSector>1</minSector>
   <maxSector>8</maxSector>
   <systemList>
      <doors power="1" max="3" room="5"/>
      <engines power="1" max="5" room="4"/>
      <oxygen power="1" max="1" room="3"/>
      <pilot power="1" max="1" room="0"/>
      <shields power="2" max="8" room="2"/>
      <weapons power="8" max="8" room="1"/>
   </systemList>
  <weaponSlots>4</weaponSlots>
  <droneSlots>2</droneSlots>
  <weaponList missiles="10" load="WEAPONS_REBEL"/>
   <health amount="8"/>
   <maxPower amount="7"/>
   <crewCount amount="2" max="4" class="human"/>
   <boardingAI>sabotage</boardingAI>
</shipBlueprint>


events_ships.xml.append:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<ship name="RM_TEST_DUMMY" blueprint="RM_TEST_DUMMY">
  <destroyed>
    <text>You destroyed the test dummy.</text>
  </destroyed>
  <deadCrew>
    <text>You killed all of the test dummy's crew.</text>
  </deadCrew>
</ship>


events.xml.append

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<event name="START_GAME">
   <text>This is some custom mod sample text.</text>
</event>

<event name="START_BEACON">
  <text>Dummy text, you can't actually read this.</text>
   <choice hidden="true">
    <text>Battle RM test dummy</text>
    <event>
      <ship load="RM_TEST_DUMMY" hostile="true"/>
      </event>
   </choice>
</event>


I've tried plenty of things including changing <weaponList missiles="10" load="WEAPONS_REBEL"/> to <weaponList missiles="10" count="4" load="WEAPONS_REBEL"/>, removing the <weaponSlots> and <weaponDrones> lines, and loading different weapon blueprintLists, including my own custom weapon blueprintLists. Nothing I do seems to work, the enemy always loads into the game, you can fight and destroy it but it doesn't have any weapons. I am able to set it to load predefined weapons which works but I want my enemies to select random weapons from lists like every other ship in the game.
Can anyone help me with this? I must be doing something wrong. If you want to try-out my code for yourself I've added it as an attachment.
meklozz
Posts: 350
Joined: Wed Sep 23, 2015 9:11 am

Re: [Help] Enemies loading weapons from blueprintLists

Postby meklozz » Sun Apr 09, 2017 4:33 am

Try:
events_ships.xml.append:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<ship name="RM_TEST_DUMMY" auto_blueprint="RM_TEST_DUMMY">
  <destroyed>
    <text>You destroyed the test dummy.</text>
  </destroyed>
  <deadCrew>
    <text>You killed all of the test dummy's crew.</text>
  </deadCrew>
</ship>
SliderVX
Posts: 2
Joined: Sun Apr 09, 2017 3:50 am

Re: [Help] Enemies loading weapons from blueprintLists

Postby SliderVX » Mon Apr 10, 2017 5:16 am

meklozz wrote:Try:
events_ships.xml.append:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<ship name="RM_TEST_DUMMY" auto_blueprint="RM_TEST_DUMMY">
  <destroyed>
    <text>You destroyed the test dummy.</text>
  </destroyed>
  <deadCrew>
    <text>You killed all of the test dummy's crew.</text>
  </deadCrew>
</ship>


Thank you! This fixes my issue. I thought the problem was in autoBlueprints.xml.append.