Jump to content

Trying To Create a Working Rocket Turret


Recommended Posts

I am new to creating mods for my own use, but have been inspired by some of the best and most useful mods (in my opinion, anyway *LOL*).  Working with bdubyah's The Wasteland, I have made tweaks and additions that work fine, like craftable Lead Lining mods for the power armor, StimPacks, schematics for crafting those things...

But how to make a Rocket Turret is eluding me. 

Created the schematic - Check.
Made a custom icon for inventory - Check.
Created the recipe to craft the turret - Check.
Made the append xpath to point to the blocks.xml file - Check.
Copied the shotgun turret code block, changed the name to rocketTurret, change the ammo type to ammoRocketFrag, changed the muzzle smoke and fire sound to match the Rocket Launcher in the items.xml, etc.  - Check

Open creative, the Rocket Turret is there!  YAY!  The schematic is there.  YAY!  In crafting, it shows up as a craftable item.  YAY!  3 for 3, right?

Place the block, slap some frag rockets in it, hook up power, and....

The muzzle flash is coming from the battery, and the rockets are launching 90 degrees to the right of the direction the turret is pointing.  It was firing continuously even though there are no Zombies to target, and the shotgun turret is not turning back and forth.

Here's the code I used:
 

		<block name="rocketTurret">
			<property name="Extends" value="autoTurret"/>
			<property name="CreativeMode" value="Player"/>
			<property name="Model" value="Entities/Traps/AutoTurret/Auto_TurretShotgunPrefab"/>
			<property name="CustomIcon" value="rocketTurret"/>
			<property name="AmmoItem" value="ammoRocketFrag"/> <!-- does not use the damage value -->
			<!-- <property name="Magazine_items" value="ammoRocketHE,ammoRocketFrag"/>  To be figured out -->
			<property name="MaxDistance" value="100"/>
			<property name="EntityDamage" value="100"/> <!-- does not use range falloff for damage -->
			<property name="BlockDamage" value="5"/>
			<property name="RaySpread" value="1.6"/> <!-- Spread 1.6deg: 1m cone(55% hit) @ 50m -->
			<!-- <property name="RayCount" value="8"/> -->
			<property name="BurstRoundCount" value="4"/>
			<property name="BurstFireRate" value="0.61"/>
			<property name="CooldownTime" value="2"/>
			<property name="OvershootTime" value="0.8"/>

			<property name="ParticlesMuzzleFire" value="rocketLauncherFire"/>
			<property name="ParticlesMuzzleSmoke" value="nozzlesmoke_m136"/>

			<!--<property name="Buff" value="buffShotgunWound01"/>
			<property name="BuffChance" value="0.8"/>-->

			<property name="FireSound" value="m136_fire"/>
			<property name="EconomicValue" value="3500"/>
			<property name="PickupJournalEntry" value="cameraTip"/>
			<property name="UnlockedBy" value="perkAdvancedEngineering,rocketTurretSchematic"/>
		</block>



As a test, I did a copy/paste of the autoTurret block, and literally, the only things I changed in the block code were the block name (to autoTurretHP), and the AmmoItem (to ammo9mmHP).  It shows up in creative, I can place it, load it, and it shoots when a zombie is in its active cone.  But it doesn't swivel back and forth scanning, either. 

I'm missing something, and I am hoping someone experienced with modding blocks can help me out.  Thanks in advance!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...