Page 1 of 2
How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 1:26 pm
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>
Re: How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 6:32 pm
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.
Re: How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 7:06 pm
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>
Re: How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 7:15 pm
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?
Re: How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 7:26 pm
by bamalf
Yes, other sets of weapons (e. g. <blueprintList name="WEAPONS_ROCK">) works correctly, weapons at random are chosen from list.
Re: How to give a custom weapon to a custom enemy ship?
Posted: Wed Dec 17, 2014 9:13 pm
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.
Re: How to give a custom weapon to a custom enemy ship?
Posted: Fri Dec 19, 2014 4:09 am
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))
Re: How to give a custom weapon to a custom enemy ship?
Posted: Fri Dec 19, 2014 9:35 am
by bamalf
It works, but other enemies did not have "count" in their weaponLists. I'm confused.
Re: How to give a custom weapon to a custom enemy ship?
Posted: Sun Dec 21, 2014 3:02 pm
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)
Re: How to give a custom weapon to a custom enemy ship?
Posted: Tue Dec 23, 2014 12:28 pm
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.