How to give a custom weapon to a custom enemy ship?

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
bamalf
Posts: 204
Joined: Wed Dec 17, 2014 12:57 pm

How to give a custom weapon to a custom enemy ship?

Post by bamalf »

I have working custom weapon and custom enemy ship, but the ship starting without any weapons.

Code: Select all

<shipBlueprint name="BS_ROCK_OUTPOST" layout="bs_rock_outpost" img="bs_rock_station_b">
	<class>Rock outpost</class>
	<systemList>
		<medbay power="1" max="3" room="4" start="false"/>
		<doors power="3" max="3" room="0" start="true"/>
		<oxygen power="1" max="3" room="5" start="true"/>
		<shields power="8" max="8" room="1" start="true"/>
		<weapons power="4" max="8" room="3" start="true"/>
	</systemList>
	<weaponList missiles="0" load="WEAPONS_ROCK_PRO"/>
	<health amount="20"/>
	<maxPower amount="19"/>
	<crewCount amount="5" max="7" class="rock"/>
	<aug name="ROCK_ARMOR"/>
	<boardingAI>sabotage</boardingAI>
</shipBlueprint>

<blueprintList name="WEAPONS_ROCK_PRO">
	<name>SOLAR_BARRAGE_ARRAY</name>
</blueprintList>
Image Image Image
User avatar
stylesrj
Posts: 3638
Joined: Tue Jul 08, 2014 7:54 am

Re: How to give a custom weapon to a custom enemy ship?

Post by stylesrj »

<blueprintList name="WEAPONS_ROCK_PRO">
<name>SOLAR_BARRAGE_ARRAY</name>
</blueprintList>
I think you'll need a lot more than just a name if you want that weapon to show up and be used on the Rock ship.
You need things like charge time, firing animations, damage, cost.

In fact, look up a weapon in blueprints.xml, copy that and change the values there.
User avatar
bamalf
Posts: 204
Joined: Wed Dec 17, 2014 12:57 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by bamalf »

The weapon already exists, I can add it on own ship, but not on the enemy. I got solve the problem:

Code: Select all

<shipBlueprint name="BS_ROCK_OUTPOST" layout="bs_rock_outpost" img="bs_rock_station_b">
	<class>Rock outpost</class>
	<systemList>
		<medbay power="1" max="3" room="4" start="false"/>
		<doors power="3" max="3" room="0" start="true"/>
		<oxygen power="1" max="3" room="5" start="true"/>
		<shields power="8" max="8" room="1" start="true"/>
		<weapons power="4" max="8" room="3" start="true"/>
	</systemList>
	<weaponList count="1" missiles="0">
		<weapon name="SOLAR_BARRAGE_ARRAY"/>
	</weaponList>
	<health amount="20"/>
	<maxPower amount="19"/>
	<crewCount amount="5" max="7" class="rock"/>
	<aug name="ROCK_ARMOR"/>
	<boardingAI>sabotage</boardingAI>
</shipBlueprint>
Image Image Image
User avatar
stylesrj
Posts: 3638
Joined: Tue Jul 08, 2014 7:54 am

Re: How to give a custom weapon to a custom enemy ship?

Post by stylesrj »

The weapon already exists, I can add it on own ship, but not on the enemy. I got solve the problem:
When you put the blueprint for it outside of the ship blueprint, I assumed the weapon wasn't working because you just gave it a name.

Has the custom ship got weapon mounts?
User avatar
bamalf
Posts: 204
Joined: Wed Dec 17, 2014 12:57 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by bamalf »

Yes, other sets of weapons (e. g. <blueprintList name="WEAPONS_ROCK">) works correctly, weapons at random are chosen from list.
Image Image Image
User avatar
stylesrj
Posts: 3638
Joined: Tue Jul 08, 2014 7:54 am

Re: How to give a custom weapon to a custom enemy ship?

Post by stylesrj »

Well that's all I know from the script... I mean that's as far as my knowledge of modding takes me. I've never actually modded an enemy ship before so I don't know how weapons and mounts work for them. Perhaps someone else will know the issue.
User avatar
Gencool
Posts: 409
Joined: Sun Jun 16, 2013 1:21 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by Gencool »

Did you get this working then?

My only observation is that the original code has a line that reads

Code: Select all

   <weaponList missiles="0" load="WEAPONS_ROCK_PRO"/>
where it probably should be

Code: Select all

   <weaponList count="1" missiles="0" load="WEAPONS_ROCK_PRO"/>
((I'm not sure what happens if you don't have the count tag, but it *might* mean you don't get any weapons))
ImageImageImage
- Gencool (aka Puppetsquid) -- I make weird stuff
User avatar
bamalf
Posts: 204
Joined: Wed Dec 17, 2014 12:57 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by bamalf »

It works, but other enemies did not have "count" in their weaponLists. I'm confused.
Image Image Image
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by kartoFlane »

Proud American Engi wrote:You can make your own weapons list with ONLY your custom weapon , But the ship will have 1-4 of that weapon because you cant make it so that enemy always has the same loadout no matter what!
Actually, you can. The weaponList tag in enemy ships accepts both blueprintLists (via the 'load' attribute), as well as specific weapons listed like in player ships.
At least IIRC, I tested this way before AE...

The 'count' attribute specifies the number of weapons that will be drafted from the list for the ship to use. Generally this should be equal to number of weapon slots on the ship. IIRC omitting this will cause the game to always draft the maximum number of weapons for the ship (ie. count = number of weapon slots)
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: How to give a custom weapon to a custom enemy ship?

Post by kartoFlane »

Well, like I said, you simply do it the same way you do it for player ships, so...

Code: Select all

<weaponList count="2" missiles="#">
  <weapon name="WEAPON_1" />
  <weapon name="WEAPON_2" />
</weaponList>
It may or may not work like that anymore -- as I said, I've tested this before the AE update.
Superluminal2 - a ship editor for FTL
Post Reply