Home Technical Talk

[CryEngine2] Importing Weapon with Assets

So... really really stuck with this (spend like 60 hours on it already and just blind for what is wrong):

I imported a Latern to Crysis with a few simple animations and like three dummy bones for Attachments. The Latern should not do anything special but just be able to use the LAM Flashlight or any Flashlight-Effect at all in order to light things up (obviously).

untitled-1bep0.jpg
setup in max

lantern.xml in crysis\Game\Scripts\Entities\Items\XML\Weapons
<item name="Lantern" class="Weapon" category="small" priority="11">
     <params>
         <param name="giveable"         value="1" />
         <param name="selectable"     value="1" />
         <param name="pose"                 value="pistol" />
         <param name="mass"                value="8" />
         <param name="two_hand"                value="2" />
         <param name="melee_attack_firemode"        value="melee" />
         <param name="raiseable"        value="true" />
         <param name="raise_distance" value="0.80" />
         <param name="attach_to_back" value="1" />
         <param name="bone_attachment_01" value="pistol_attachment_right" />
         <param name="bone_attachment_02" value="pistol_attachment_left" />
     </params>
     <ai_descriptor handler="instant" burstBulletCountMin="1" burstBulletCountMax="10"
         draw_time="1.0" sweep_width="1.5" sweep_frequency="2.5"
         burstPauseTimeMin="0.8" burstPauseTimeMax="3.5" singleFireTriggerTime="0.4" />    
     <ammos>
         <ammo name="lightbullet" extra="0" amount="8" minAmmo="0"/>
     </ammos>
     <geometry>
         <firstperson name="objects/weapons/us/lantern/lantern_fp.chr" angles="0,0,0"/>
         <thirdperson name="objects/weapons/us/lantern/lantern.cgf" />
         <boneAttachments>
            <attachment target="firstperson" name="muzzle_flash_effect" bone="weapon_term" />
            <attachment target="firstperson" name="muzzle_flash_light" bone="weapon_term" />
            <attachment target="firstperson" name="attachment_bottom_LAM" bone="attachment_bottom" />
            <attachment target="firstperson" name="attachment_bottom_LAM_light" bone="attachment_bottom" />
            <attachment target="firstperson" name="attachment_bottom_LAM_Laser" bone="attachment_bottom" />
        </boneAttachments>
     </geometry>
     <actions>
         <action name="select">
             <animation target="firstperson" name="select_01" speed="-1.0"/>
             <animation target="owner" name="select" />
             <sound target="thirdperson" name="sounds/weapons:shotgun:select" radius="2" />
         </action>
         <action name="deselect">
             <animation target="firstperson" name="select_01" />
             <animation target="owner" name="deselect" />
             <sound target="firstperson" name="sounds/weapons:shotgun:deselect" radius="2" />
             <sound target="thirdperson" name="sounds/weapons:shotgun:deselect" radius="2" />
         </action>
         <action name="idle">
             <animation target="firstperson" name="idle_01"/>
             <animation target="owner" name="idle" />
         </action>
         <action name="pickedup">
             <sound target="firstperson" name="Sounds/weapons:weapon_accessories:pickup_weapon_fp"
                        radius="2" />
             <sound target="thirdperson" name="Sounds/weapons:weapon_accessories:pickup_weapon"
                        radius="2" />
         </action>        
     </actions>
     <firemodes>

        <firemode name="punch" type="Melee">
            <melee>
                <param name="helper" value="Collision" />
                <param name="damage" value="80" />
                <param name="impulse" value="60" />
                <param name="delay" value="0.15" />
                <param name="duration" value="0.055" />
            </melee>
<muzzleflash>
                <firstperson effect="muzzleflash.Shotgun.Shotgun" helper="muzzle_flash_effect" light_helper="muzzle_flash_light" light_radius="2" time="0.500" light_color="1,1,0.8" light_diffuse_mult="8" />
                <thirdperson effect="muzzleflash.Shotgun.Shotgun_tp" helper="weapon_term" light_helper="weapon_term" light_radius="2.3" time="0.500" light_color="1,1,0.8" light_diffuse_mult="8" />
            </muzzleflash>
            <actions>
                <param name="attack" value="idle" />
            </actions>
        </firemode>
     </firemodes>

<accessories>
        <initialsetup>
            <accessory name="torch_wide" />
            <accessory name="torch_narrow" />
        </initialsetup>
        
    

        <accessory name="torch_wide">
            <attach helper="attachment_bottom_LAM" layer="LAM_layer" />
            <detach />
        </accessory>

        <accessory name="torch_narrow">
            <attach helper="attachment_bottom_LAM" layer="LAM_layer" />
            <detach />
        </accessory>
    
    
    </accessories>
 </item>

torch_wide.xml in crysis\Game\Scripts\Entities\Items\XML\Accessories
<item name="torch_wide" class="LAM" priority="112">
    <params>
        <param name="giveable" value="1" />
        <param name="selectable" value="0" />
        <param name="droppable" value="0" />
    </params>
    <lam>      
   <firstperson light_range="16" light_fov="85" light_color="1.93,1.86,1.53" light_diffuse_mul="1" light_texture="textures/lights/flashlight3.dds" light_material="" light_hdr_dyn="1.5"/>
    <thirdperson light_range="10" light_fov="50" light_color="1,1,1" light_diffuse_mul="1" light_texture="textures/lights/flashlight3.dds" light_material="materials/lightbeams/lightbeam_floodlight.mtl" light_hdr_dyn="1"/>
        <special         isLaser="0" isFlashLight="1" isLamRifle="0" giveExtraAccessory="0" extraAccessoryName="" />
    </lam>
    <geometry>
  <firstperson name="Objects/weapons/US/torch/flashlightattachmentdummycube.cgf" /> 
  <thirdperson name="Objects/weapons/US/torch/flashlightattachmentdummycube.cgf" /> 
  </geometry>
</item>

Thanks in advance for anyone with an idea or input on this! (i know lantern is spelled wrong and should be latern but that is consistent and doesn't link wrong anywhere)...

Replies

Sign In or Register to comment.