Jump to content
Sign in to follow this  
cervantes

Custom scoped weapon.

Recommended Posts

hi here 🙂

 

i actualy work on a custom Sharps buffalo with scope attachement.

 

i follow a basic tutorial and sa80ris tutorial and generaly animate my weapons eazly 🙂

 

but i encoutering a strange issue with this Sharps model.

 

all animations working fine into buldozer but ingame only animations used isselected and hasOptics animations source working.

 

 

 

that is my model.cfg

 

Spoiler

 
class CfgSkeletons 
{
    class Default
    {
        isDiscrete=1;
        skeletonInherit="";
        skeletonBones[]={};
    };

    class Sharps_skeleton: Default
    {
        skeletonBones[]={"armement","","detente","","marteau","","sight1","","sight2","","switch","","block",""};
    };
};
 
class CfgModels
{
    class Default
    {
        sectionsInherit="";
        sections[]={};
        skeletonName="";
    };

    class Sharps_Buffalo_base: Default
    {
        skeletonName="Sharps_skeleton";
                sections[]= {"armement","detente","marteau","sight1","sight2","switch","block","camo1"};
        class Animations
        {
        };
    };
    class Sharps_Buffalo: Sharps_Buffalo_base
    {
        class Animations
        {
            class marteau_init
            {    
                    type="rotationZ"; // The type of animation.
                    source="isSelected";   // The controller that provides input.
                    selection="marteau"; // The name of the skeleton bone used.
                        axis="marteau_axis";
            minValue = 0.5;
            maxValue = 1;
            angle0 = 0;
            angle1 = rad 25;
                        //memory=1;
            };

            class marteau_r
            {    
                    type="rotationZ"; // The type of animation.
                    source="reload";   // The controller that provides input.
                    selection="marteau"; // The name of the skeleton bone used.
                        axis="marteau_axis";
            minValue = 0.5;
            maxValue = 1;
            angle0 = 0;
            angle1 = rad - 25;
                        //memory=1;
            };

            class detente_r
            {    
                    type="rotationZ"; // The type of animation.
                    source="reload";   // The controller that provides input.
                    selection="detente"; // The name of the skeleton bone used.
                        axis="detente_axis";
            minValue = 0.5;
            maxValue = 1;
            angle0 = 0;
            angle1 = rad -10;
                        //memory=1;
            };

            class armement_r
            {    
                    type="rotationZ"; // The type of animation.
                    source="isEmpty";   // The controller that provides input.
                    selection="armement"; // The name of the skeleton bone used.
                        axis="armement_axis";
                        minValue= "0.5";
                    maxValue="1";
            angle0= rad 0;
            angle1= rad 80;
                        //memory=1;
            };

            class sight1
            {    
                    type="rotationZ"; // The type of animation.
                    source="isSelected";   // The controller that provides input.
                    selection="sight1"; // The name of the skeleton bone used.
                        axis="sight1_axis";
                        sourceAddress = "clamp";
                        minValue= "0";
                    maxValue="1";
                    initPhase = rad 0;
            angle0= rad 0;
            angle1= rad 90;
                        };

            class viseur1
            {    
                    type="rotationZ"; // The type of animation.
                    source="hasOptics";   // The controller that provides input.
                    selection="sight1"; // The name of the skeleton bone used.
                        axis="sight1_axis";
                        sourceAddress = "clamp";
                        minValue= "0";
                    maxValue="1";
            angle0= rad 0;
            angle1= rad - 90;
                        };

            class viseur2
            {    
                    type="rotationZ"; // The type of animation.
                    source="hasOptics";   // The controller that provides input.
                    selection="sight2"; // The name of the skeleton bone used.
                        axis="sight2_axis";
                        sourceAddress = "clamp";
                        minValue= "0";
                    maxValue="1";
            angle0= rad 0;
            angle1= rad - 65;
                        };

                class block_t
            {
            type="translation";
            source="isEmpty";
            sourceAddress="clamp";
            selection="block";
                        axis="block_axis";
                        begin="block_beg";
                        end="block_end";
                        minPhase=0.38;
                        maxPhase=0.4;
                        minValue=0.38;
                        maxValue=1.1;
                        offset0=0;
                        offset1= 0.8;
            memory=1;
            animPeriod = 0.0;
            initPhase = 0.0;
            };

};
};
};

 

and my config cpp

 

Spoiler

class CfgPatches 
{    
class Sharps_buffalo 
{        
    units[] = {};
    weapons[]={"Sharps_Buffalo","scoped_Sharps_buffalo","R_scope_Sharps_3D"};        
        requiredVersion = 1.0;
        requiredAddons[]={};
        author = "Morenon Samy";    

  };
};
//------------------------------------------------------------------------------------  
class CfgRecoils {
    access = 1;
    Sharps_recoil[] = {0,0,0, 0.08,0.01,0.04, 0.05,-0.003,-0.01, 0.20,0,0};
};
//------------------------------------------------------------------------------------  
class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;
class SlotInfo;
class MuzzleSlot;
class CowsSlot;
class PointerSlot;
class UnderBarrelSlot;
//------------------------------------------------------------------------------------   

class CfgAmmo
{
class Default;         // External class reference
class BulletBase;      // External class reference
class ShotgunBase;

class Sharps_ammo: BulletBase
{
access = 3;
hit=20;indirectHit=0;indirectHitRange=0;
cost = 10;
deflecting=0;
typicalSpeed = 800;
timeToLive = 20;
model = "\Sharps_Buffalo\shell\bullet.p3d";
simulation = "shotShell";
maxSpeed = 900;
simulationStep = 0.050000;
caliber = 3.6;
cartridge="SharpsFX"; 
};
};

//------------------------------------------------------------------------------------  
class CfgMagazines
{
class Default;                 // External class reference
class CA_Magazine;             // External class reference


class Sharps_mag : CA_Magazine
{
author = "Morenon Samy";
model = "\winchester_1873\box\box";
scope = 2;
displayName="45 Magnum caliber";
picture="\winchester_1873\box_inv.paa";
ammo = "Sharps_ammo";
initSpeed = 930;
count =1;
value = 70;
mass = 0.2;
weight = 0;
reloadAction = "GestureReloadEBR";
magazineReloadTime = 10;
maxLeadSpeed = 100;
descriptionShort = "45 Magnum caliber";
magazineGroup[]    = {"Sharps_mag_group"};
};
}; 

//------------------------------------------------------------------------------------ 

class CfgVehicles
{
      class ThingEffect; // External class reference
      class All{};
      class Logic: All {};
      class AllVehicles:All{};
      class Land:AllVehicles{};
      class house;

class SharpsFX : ThingEffect
{
model = "\Sharps_Buffalo\shell\cart.p3d";
displayName = "Sharps cartridge";
submerged = 0;
submergeSpeed = 0;
timeToLive = 120;
disappearAtContact = 0;
};

//------------------------------------------------------------------------------------  

class Sharps_Cartridge: house 
{
model = "\Sharps_Buffalo\shell\cart.p3d";
displayName = "Cartridge";
nameSound = "";
destrType = "DestructNo";
mapSize = 0.700000;
accuracy = 0.200000;
armor = 5;
scope = 1;
};
};
//------------------------------------------------------------------------------------  
class cfgWeapons 
{
class ItemCore;

class InventoryOpticsItem_Base_F;
    class Rifle_Base_F;
    class Rifle_Long_Base_F: Rifle_Base_F
    {
        class WeaponSlotsInfo;
        class EventHandlers;
    };

    class R_scope_Sharps_3D: ItemCore
    {
        scope = 2;
        displayName="Buffalo Scope";
        author=Morenon Samy;
        picture="\Sharps_Buffalo\scope\scope_ui.paa";
        model = "\Sharps_Buffalo\scope\Sharps_scope_F";
        descriptionShort = "A amazing scope for old rifle";
        weaponInfoType = "RscOptics_sos";
        class ItemInfo: InventoryOpticsItem_Base_F
        {
        mass = 1;
        opticType=1;
        optics=1;
        weaponInfoType="RscOptics_sos";
        modelOptics="\A3\Weapons_F\empty";

        class OpticsModes
        {
        class R_scope_Sharps_3D_01
        {
        opticsID = 1;
        useModelOptics = 0;
        opticsPPEffects[]={"OpticsCHAbera5","OpticsBlur5"};
        opticsFlare = false;
        opticsDisablePeripherialVision = false;
        opticsZoomMin=0.25;
        opticsZoomMax=1.25;
        opticsZoomInit=0.125;
        memoryPointCamera = "opticView";
        visionMode[] = {"Normal"}; /// Can be combined with NVG
        distanceZoomMin=100;
        distanceZoomMax=400;
        cameraDir = "";
         discretefov[]={0.041999999,0.0099999998};
         discreteInitIndex = 0;
        discreteDistance[] = {300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200};
        discreteDistanceInitIndex = 1;

    };
};
};
};
//-----------------------------------------------------------------------------------
class Sharps_Buffalo_base: Rifle_Long_Base_F
{
cameraDir="OP_look";
discreteDistanceCameraPoint[]={"OP_eye"};
class WeaponSlotsInfo: WeaponSlotsInfo
{
mass=220;
class MuzzleSlot
{
};
class CowsSlot
{
};
class PointerSlot
{
};
class UnderBarrelSlot
{
};
};
};
//-----------------------------------------------------------------------------------
class Sharps_Buffalo: Sharps_Buffalo_base
{
  handanim[] = {"OFP2_ManSkeleton", "\Sharps_Buffalo\Anim\Handanim_Sharps.rtm"};
  scope = 2;
  scopeCurator = 2;
  baseWeapon = "Sharps_buffalo";
  //weaponInfoType = "RscWeaponRangeZeroingFOV";
  model = "\Sharps_Buffalo\Sharps_Buffalo.p3d";
  modelOptics = "-";
  picture = "\Sharps_Buffalo\inv_pic.paa";
  modelMagazine = "\winchester_1873\box\box.p3d";
  displayName = "Sharps 1874 buffalo";
  opticsZoomMin = 0.25;
  opticsZoomMax = 0.40;
  soundContinuous = 0;
  reloadMagazineSound[] = {"\winchester_1873\sounds\r700rl.wav",5.000000,1};
  reloadSound[] = {"\winchester_1873\sounds\lever",db20,1,10};
  value = 1000;
  aiRateOfFire = 0.50;
  aiRateOfFireDistance = 50;
  count = 2;
  ffCount=2;
  muzzles[]={"this"};
  modes[]= {"Single"};
  autoFire = false;
  reloadAction = "GestureReloadEBR";
  magazines[] = {"Sharps_mag","Sharps_mag_group"};
  author = "Morenon Samy";
  descriptionShort = "One of the most successful, and certainly one of the most famous Western single shot rifles was the Sharps buffalo 1874.";
  maxZeroing=400;

  class Single: Mode_SemiAuto /// Pew
  {
  minRange = 2;
  minRangeProbab = 0.100000;
  midRange = 50;
  midRangeProbab = 0.650000;
  maxRange = 70;
  maxRangeProbab = 0.050000;
  distanceZoomMin = 200;
  distanceZoomMax = 200;
  dispersion = 0;
  reloadTime = 0.4;
  backgroundReload = 0;
  magazineReloadTime = 10;
  recoil="recoil_single_dmr";
  recoilProne="recoil_single_prone_dmr";

  sounds[] = {"StandardSound"};
  class StandardSound
  {
   begin1[] = {"\winchester_1873\sounds\1866.wav",1,1,100};
   soundBegin[] = {"begin1",1};
   weaponSoundEffect = "DefaultRifle";
  };
};
//-----------------------------------------------------------------------------------
class WeaponSlotsInfo: WeaponSlotsInfo
{
mass = 220;
class CowsSlot : CowsSlot
{
  displayName = "$STR_A3_CowsSlot0";
  compatibleItems[] = {"R_scope_Sharps_3D"};
  linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";
};
};
//-----------------------------------------------------------------------------------
class EventHandlers
{
   Fired = "";
};
//-----------------------------------------------------------------------------------
  class GunParticles
  {
   class Effect1
  {
    effectName="StarterPistolCloud1";
    positionName="usti hlavne";
    directionName="konec hlavne";
  };
  class Effect2
  {
    effectName="StarterPistolCloud2";
    positionName="usti hlavne";
    directionName="usti hlavne";
  };
  class Effect3
  {
    effectName="StarterPistolCloud2";
    positionName="usti hlavne";
    directionName="usti hlavne";
};
};
};
//-----------------------------------------------------------------------------------

class scoped_Sharps_buffalo: Sharps_Buffalo /// standard issue variant with holo optics
{
class LinkedItems
{
class LinkedItemsOptic
{
slot = "CowsSlot";
item = "R_scope_Sharps_3D";
};
};
};
};

 

for information only scope proxy is actualy add but not sure for the placement of this proxy.

 

  • Like 4

Share this post


Link to post
Share on other sites

I looked into your video (0:48) in slowmotion mode few times, i noticed that reload animation of hammer is working. It is only barely noticeable due of animation high speed.

And try to change isEmpty animation values min/maxPhase and min/maxValue to 0/1.

 

 

 

Share this post


Link to post
Share on other sites

Hi Yano ty for your reply 🙂 i have worked diferents weapons and use same model.cfg.

Also i can see circular motion of parts moving and i dont encoutering this issue with others models.

I encoutering this issue also on j.harding with only hamer and trigger animations.

I try your advise from isempty later perhaps that can help.;)

 

Share this post


Link to post
Share on other sites

hummm after testing that not solving this issue 😕

 

the hamer and trigger d'ont move.

 

i encoutering same troubl with j.harding and i only define hamer and trigger animations.

 

my other weapons working perfectly .

 

j.harding do not use attachement that really confuse me 😛

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×