SPOILERS Custom weapon (for custom enemy)

I have no past modding experience and am getting by purely on trial and error.

Hello!

To spice up act 3 freeroam I set out to make a more tanky version of the Zin rocket specialist with a custom weapon based on Zinyak's plasma cannon. After some tinkering I got the NPC to spawn when I want him to, but no matter what I do the custom weapon refuses to work. When I give him the normal plasma cannon or the Zinyak version everything works fine (though the Zinyak one has no model), so the offender has to be the weapon.

Here's what I've done, in conveniently quoted walls of code:

weapon.xtbl
Code:
    <Weapon>
        <Name>Explosive-PlasmaCannon-Custom</Name>
        <Weapon_Class>launcher</Weapon_Class>
        <Trigger_Type>burst</Trigger_Type>
        <Magazine_Size>6000</Magazine_Size>
        <Range_Max>300</Range_Max>
        <Damage_Max>
            <NPC_Damage>1250</NPC_Damage>
            <Player_Damage>200</Player_Damage>
        </Damage_Max>
        <Explosion>Plasma_RPG_Zinyak</Explosion>
        <Projectile_Info>
            <Model>rpg_projectile</Model>
            <Speed>30</Speed>
            <Attached_Effect>VFX_PlasmaRPG_Trail</Attached_Effect>
                <Projectile_Flags>
                    <Flag>has light attached</Flag>
                    <Flag>rocket flight</Flag>
                    <Flag>dont detonate from explosion</Flag>
                    <Flag>use bullet collision quality</Flag>
                </Projectile_Flags>
            <Mass>10</Mass>
            <X>0.0</X>
            <Y>0.0</Y>
            <Z>0.0</Z>
            <Foley_Name></Foley_Name>
            <Fade_Out_Time>0.0</Fade_Out_Time>
            <Post_Ignition_Speed>30</Post_Ignition_Speed>
            <Projectile_Ignition_Delay_MS>0</Projectile_Ignition_Delay_MS>
            <Gravity>0</Gravity>
            <Speed_NPC>30</Speed_NPC>
            <Post_Ignition_Speed_NPC>30</Post_Ignition_Speed_NPC>
        </Projectile_Info>
        <_Editor>
            <Category>Entries:weapon_radial:explosive</Category>
        </_Editor>
        <Animation_Group>RPG</Animation_Group>
        <AI_Ideal_Range_Max>50</AI_Ideal_Range_Max>
        <Flags>
            <Flag>melee can dislodge movers</Flag>
            <Flag>explosions damage tanks</Flag>
            <Flag>allow offhand grenade</Flag>
            <Flag>do not hide when sprinting</Flag>
            <Flag>not allowed with human shield</Flag>
            <Flag>no random give</Flag>
            <Flag>explosion ignores owner</Flag>
        </Flags>
        <Category>WPNCAT_SPECIAL</Category>
        <NPCWeaponSpread>
            <SpreadMinMax>
                <NPC_Spread_Max>2</NPC_Spread_Max>
                <NPC_Spread_Min>2</NPC_Spread_Min>
            </SpreadMinMax>
        </NPCWeaponSpread>
        <Underwater_Explosion>Underwater Large</Underwater_Explosion>
        <Time_Management>
            <Refire_Delay>1000</Refire_Delay>
            <npc_refire_delay>
                <min>3000</min>
                <max>6000</max>
            </npc_refire_delay>
        </Time_Management>
        <Ammo>Laser-Rifle</Ammo>
        <Inv_Slot>explosive</Inv_Slot>
        <Ammo_per_Shot>1</Ammo_per_Shot>
        <Alt_Trigger_Type>single</Alt_Trigger_Type>
        <Alt_Time_Management>
            <Refire_Delay>0</Refire_Delay>
            <min>0</min>
            <max>0</max>
        </Alt_Time_Management>
        <Strafe_Angles>RPG</Strafe_Angles>
        <Melee_Attack_Info>RPG</Melee_Attack_Info>
        <AI_Ideal_Range_Min>10</AI_Ideal_Range_Min>
        <Camera_Info>
            <Primary_Fire_Camera_Shake>weapon_fire_rpg</Primary_Fire_Camera_Shake>
            <Primary_Fine_Aim_Camera_Shake>weapon_fire_rpg</Primary_Fine_Aim_Camera_Shake>
            <Primary_Fire_Camera_Shake_Intensity>1.0</Primary_Fire_Camera_Shake_Intensity>
            <Primary_Fire_Fine_Aim_Camera_Shake_Intensity>1.0</Primary_Fire_Fine_Aim_Camera_Shake_Intensity>
        </Camera_Info>
        <Ragdoll_Force_Shoot>0.0</Ragdoll_Force_Shoot>
        <Muzzle_Effect>VFX_PlasmaRPG_Muzzle</Muzzle_Effect>
        <Ammo_Regeneration>5</Ammo_Regeneration>
        <Riot_Shield_Damage_Multiplier>1.0</Riot_Shield_Damage_Multiplier>
        <Diversion_Kill_Multiplier>1.0</Diversion_Kill_Multiplier>
        <NPC_Explosion>Plasma_RPG_NPC</NPC_Explosion>
        <Blood_Decal_Scale>1.0</Blood_Decal_Scale>
        <vehicle_damage_scale>3.2</vehicle_damage_scale>
        <NPC_Aim_Drift>RPG</NPC_Aim_Drift>
        <Info_Slot_Index>0</Info_Slot_Index>
        <Ammo_Regeneration_Depleted>5</Ammo_Regeneration_Depleted>
        <player_vehicle_damage_scale>1.5</player_vehicle_damage_scale>
        <Burst_Fire_Info>
            <Shots>6</Shots>
            <Burst_Delay_ms>1000</Burst_Delay_ms>
        </Burst_Fire_Info>
        <Dual_Wield_Damage_Multiplier>1.0</Dual_Wield_Damage_Multiplier>
    </Weapon>
A lot of this is probably redundant since I mcguyvered it from existing code, but I don't think any of that should break things.

weapon_costumes.xtbl
Code:
  <Costume>
     <Name>Explosive-PlasmaCannon-Custom</Name>
     <_Editor>
       <Category>Entries:weapon_radial:explosive</Category>
     </_Editor>
     <Animation_Group>RPG</Animation_Group>
     <Audio>
       <Weapon_Model>EXPLOSIVE_PLASMACANNON</Weapon_Model>
       <Hit_Wall_Sound>IMP_METAL_HIT</Hit_Wall_Sound>
       <Spinning_Snd_Pitch_End>1</Spinning_Snd_Pitch_End>
       <looping>False</looping>
       <Sound_Radius>150</Sound_Radius>
       <Soundbank_Name>Wep_Alien_Explosive</Soundbank_Name>
       <alt_looping>False</alt_looping>
     </Audio>
     <Constant_Effects>
       <Constant_Effect>
         <Effect>vfx_screen_rpg</Effect>
         <Weapon_Prop_Point>vfx2</Weapon_Prop_Point>
         <Condition>always on</Condition>
       </Constant_Effect>
     </Constant_Effects>
     <Effect_Situations>
       <Effect_Situation>
         <Situation>muzzle flash</Situation>
         <Effect>VFX_PlasmaRPG_Muzzle</Effect>
       </Effect_Situation>
       <Effect_Situation>
         <Situation>alt muzzle flash</Situation>
         <Effect>VFX_PlasmaRPG_Muzzle</Effect>
       </Effect_Situation>
     </Effect_Situations>
     <Costume_Slot_Index>0</Costume_Slot_Index>
     <Weapon_Entry>Explosive-PlasmaCannon-Custom</Weapon_Entry>
     <Item_Entry>Explosive-PlasmaCannon-Custom</Item_Entry>
     <Inventory_Entry>Explosive-PlasmaCannon-Custom</Inventory_Entry>
     <Misc_Effects></Misc_Effects>
     <Underslung_Fine_Aim>False</Underslung_Fine_Aim>
   </Costume>
Pretty much a copy of Explosive-PlasmaCannon-Zinyak, which works.

items_inventory.xtbl
Code:
  <Inventory_Item>
     <Name>Explosive-PlasmaCannon-Custom</Name>
     <DisplayName>EXPLOSIVE_PLASMALAUNCHER</DisplayName>
     <Bitmap>ui_hud_inv_35_plasma</Bitmap>
     <Cost>15000</Cost>
     <Default_Count>1</Default_Count>
     <Max_Inventory>1</Max_Inventory>
     <Description>WPN_PLASMACANNON_DESCRIPT</Description>
     <_Editor>
       <Category>Explosive</Category>
       </_Editor>
     <Info_Slot_Index>0</Info_Slot_Index>
     </Inventory_Item>
Unsure if I even need this since it will be NPC-only.

items_3d.xtbl
Code:
  <Item>
     <Name>Explosive-PlasmaCannon-Custom</Name>
     <Touch_Script>give_item</Touch_Script>
     <Respawn_Delay>45000</Respawn_Delay>
     <_Editor>
       <Category>Weapons:Radial:Explosive</Category>
     </_Editor>
     <DisplayName>EXPLOSIVE_PLASMALAUNCHER</DisplayName>
     <Item_Flags>
       <Flag>high_res_map</Flag>
     </Item_Flags>
     <Glow_Type>Weapons</Glow_Type>
     <FoleyTouch>PICKUP_WEAPON</FoleyTouch>
     <Color_Variants></Color_Variants>
     <streaming_category>Permanent</streaming_category>
     <Props></Props>
     <character_mesh>
       <character_mesh>
         <Filename>Plasmacannon.cmeshx</Filename>
       </character_mesh>
       <rig>
         <Filename>plasmacannon.rigx</Filename>
       </rig>
       <Anim_set>Weap_PlasmaCannon</Anim_set>
     </character_mesh>
   </Item>
I thought this would give it the plasma cannon model. I was wrong.

I did not add an entry to weapon_skins.xtbl because it only seems to contain alternate skins, not default ones.

The NPC has the Alien Plasma Launcher behavior override, which works with Explosive-PlasmaCannon-Zinyak.

I would be grateful for some pointers in the right direction. My fumbling in the dark stopped being fun about 5 hours ago.

Edit:
Clearly I made a mistake posting this thread in this subforum. Could a mod kindly move it to Ask Volition for me?
 
Last edited:
Back
Top