[Help] Need Help With a Custom Weapon

Discuss and distribute tools and methods for modding. Moderator - Grognak
BattleBee
Posts: 13
Joined: Sat Sep 28, 2013 12:25 pm

[Help] Need Help With a Custom Weapon

Post by BattleBee »

Hello everyone! I am new to modding, or programming in general, and I wanted to create a personal mod that adds a fast firing laser. I did everything (at least I think so.) I was told to do in this thread here:

http://www.ftlgame.com/forum/viewtopic.php?f=12&t=17122

Then I patched the mod in and started playing, but I could not find it in stores, even with rarity 1. It's either a bug or RNG, but I decided to add the weapon to the Kestral's starting loadout.

I added the code from the weapon creating guide to the weapon blueprints, and slightly modified it as I was also playing with Captain's Edition and CE Player Ships Addon mods. I couldn't get it to work, and the Kestral still had the weapons from CE.

I tried to modify the CE Player Ships Addon instead, doing the same thing I did with my weapon blueprint, except in the CEPS.ftl file.

This time, however, it went worse. Neither CEPS, nor my weapon couldn't work.

I uploaded both .ftl files. I hope this is not against the rules, but here they are:

My .ftl file: http://www.mediafire.com/download/zpo5o ... _laser.ftl
Modified CEPS .ftl file: http://www.mediafire.com/download/lczm0 ... dified.ftl

So, here is the code for the weapon:

Code: Select all

<weaponBlueprint name="LASER_RAPID"> 
   <type>LASER</type>       
   <title>"Havoc" Rapid Fire Laser</title>         
   <short>Havoc Laser</short>                         
   <desc>Equipped to Rebel Cruisers as an anti-fighter weapon, this supercharged laser fires very rapidly. </desc>                         
   <tooltip>1 shot, 1 damage, incredibly fast cooldown. Can't start fires or breach hulls.</tooltip>         
   <damage>1</damage>
   <shots>1</shots>                 
   <sp>0</sp>                           
   <fireChance>0</fireChance>
   <breachChance>0</breachChance>
   <cooldown>1</cooldown>                      
   <power>3</power>                                    
   <cost>65</cost>                                   
   <bp>2</bp>
   <rarity>1</rarity>                                      
   <image>laser_light1</image>                       
   <launchSounds>                                          
      <sound>OHMYGODWHATASOUNDOMG</sound>
      <sound>lightLaser2</sound>
      <sound>lightLaser3</sound>
   </launchSounds>
   <hitShipSounds>                                    
      <sound>hitHull2</sound>
      <sound>hitHull3</sound>
   </hitShipSounds>
   <hitShieldSounds>                                  
      <sound>hitShield1</sound>
      <sound>hitShield2</sound>
      <sound>hitShield3</sound>
   </hitShieldSounds>
   <missSounds>                                       
      <sound>miss</sound>
   </missSounds>
   <weaponArt>laser_burst_rapid</weaponArt>      
</weaponBlueprint>
And here is the ship code I placed both in CEPS addon and my own blueprint:

Code: Select all

<!-- THE KESTREL -->
<!-- LAYOUT = DEFAULT --> 
<!-- SHIP ID = 0 -->    
<shipBlueprint name="PLAYER_SHIP_HARD" layout="kestral" img="kestral">
	<class>Kestrel Cruiser</class>
	<name>The Kestrel</name>
	<desc>This class of ship was decommissioned from Federation service years ago.  After a number of refits and updating this classic ship is ready for battle.</desc>
	<systemList>
		<pilot power="1" room="0" start="true" img="room_pilot">
			<slot>
				<direction>right</direction>
				<number>0</number> 
			</slot>
		</pilot>
		<doors power="1" room="2" start="true" img="room_doors"/>
		<sensors power="1" room="3" start="true" img="room_sensors"/>
		<medbay power="1" room="4" start="true" img="room_medbay">
			<slot>
				<number>1</number> 
			</slot>
		</medbay>
		<oxygen power="1"  room="13" start="true" img="room_oxygen"/>
		<shields power="2" room="5" start="true" img="room_shields"/>
		<engines power="2" room="14" start="true" img="room_engines"/>
		<weapons power="4" room="10" start="true" img="room_weapons"/>
		<drones power="2" room="1" start="false"/>
		<teleporter power="1" room="15"	start="false"/>
		<cloaking power="1" room="8" start="false"/>
	</systemList>
	<weaponSlots>4</weaponSlots>
	<droneSlots>2</droneSlots>
	<weaponList count="1" missiles="8">
		<weapon name="LASER_RAPID"/>
	</weaponList>
	<aug name="TE_GOODS_CIVILIAN_CONSUMER"/>
	<health amount="30"/>
	<maxPower amount ="9"/> 
	<crewCount amount = "3" class="human"/>
</shipBlueprint>
Thanks! C:
Last edited by BattleBee on Sat Sep 28, 2013 5:02 pm, edited 2 times in total.
User avatar
slowriderxcorps
Posts: 469
Joined: Thu Apr 25, 2013 8:42 am

Re: [Help] Need Help With a Custom Weapon

Post by slowriderxcorps »

You could paste the code for just the new weapon in between a pair of Code tags and that'll work fine too,

Code: Select all

Like this.
Image
BattleBee
Posts: 13
Joined: Sat Sep 28, 2013 12:25 pm

Re: [Help] Need Help With a Custom Weapon

Post by BattleBee »

slowriderxcorps wrote:You could paste the code for just the new weapon in between a pair of Code tags and that'll work fine too,

Code: Select all

Like this.
Oh, okay. I will try that.
User avatar
slowriderxcorps
Posts: 469
Joined: Thu Apr 25, 2013 8:42 am

Re: [Help] Need Help With a Custom Weapon

Post by slowriderxcorps »

BattleBee wrote:Oh, okay. I will try that.
Hopefully that was read as in posting it onto this here forum, not in the mod files itself. *sweatdrop*
Image
BattleBee
Posts: 13
Joined: Sat Sep 28, 2013 12:25 pm

Re: [Help] Need Help With a Custom Weapon

Post by BattleBee »

slowriderxcorps wrote:
BattleBee wrote:Oh, okay. I will try that.
Hopefully that was read as in posting it onto this here forum, not in the mod files itself. *sweatdrop*
Absolutely.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Help] Need Help With a Custom Weapon

Post by kartoFlane »

The XML looks correct... Are you certain your mod is being installed as last?
If it is, and it's still not having any effect, it's probably wrong directory structure/filenames in the .ftl file itself. Run it through SMM's validate function.
Superluminal2 - a ship editor for FTL
BattleBee
Posts: 13
Joined: Sat Sep 28, 2013 12:25 pm

Re: [Help] Need Help With a Custom Weapon

Post by BattleBee »

kartoFlane wrote:The XML looks correct... Are you certain your mod is being installed as last?
If it is, and it's still not having any effect, it's probably wrong directory structure/filenames in the .ftl file itself. Run it through SMM's validate function.
"This mod doesn't append. It clobbers." -SMM

I have no idea what this means.
User avatar
5thHorseman
Posts: 1665
Joined: Sat Mar 02, 2013 2:29 am

Re: [Help] Need Help With a Custom Weapon

Post by 5thHorseman »

BattleBee wrote:
kartoFlane wrote:"This mod doesn't append. It clobbers." -SMM

I have no idea what this means.
That means your file names are of type *.xml, not *.xml.append

Which means that SMM will completely replace the file in FTL with this mod's files and not just append them. This is fine if that's what it mod needs to do, but mostly you don't want that.

Did you try to load your mod by itself? I find simplifying as much as possible to be insanely beneficial in troubleshooting.
My Videos - MY MOD HUB
Simo-V - The Potential - Automated Scout - "Low O2" Icons
The Black Opal - The Asteroid - The Enforcer - The Pyro

"Every silver lining has a cloud..."
BattleBee
Posts: 13
Joined: Sat Sep 28, 2013 12:25 pm

Re: [Help] Need Help With a Custom Weapon

Post by BattleBee »

5thHorseman wrote:
BattleBee wrote:
kartoFlane wrote:"This mod doesn't append. It clobbers." -SMM

I have no idea what this means.
That means your file names are of type *.xml, not *.xml.append

Which means that SMM will completely replace the file in FTL with this mod's files and not just append them. This is fine if that's what it mod needs to do, but mostly you don't want that.

Did you try to load your mod by itself? I find simplifying as much as possible to be insanely beneficial in troubleshooting.
The file names are ".xml.append" files, not just ".xml". I don't think that's the problem.

What do you mean by "loading the mod by itself"? Do you mean loading the mod alone? Because that doesn't work either.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Help] Need Help With a Custom Weapon

Post by kartoFlane »

Huh. That's odd. But SMM rarely is mistaken.

It'll be a lot simpler if you just upload your .ftl file so we can figure out what's wrong -- you don't have to worry about it containing stuff from other mods, IIRC technically every mod is part of public domain by default. Especially given the fact that .ftl files can be easily unpacked.
Superluminal2 - a ship editor for FTL
Post Reply