Jump to content
Sign in to follow this  
major woody

Mortar addon won't move!

Recommended Posts

I'm trying to convert this mortar from OFP into ArmA in order to gain knowlegde how to create my own static weapons. So far it has all gone smoothe so far - but I ran into some trouble in the end. (Of course wink_o.gif)

1. When I try to load it in the editor I get an error saying:

Error: creating weapon 2S12 whith scope=private

error.jpg

2. The weapon containes no ammo so I'm unable the fire it.

ammo.jpg

3. The weapon won't move AT ALL. All annimations are locked so my only option are to stare through the gun sight and nothing else  sad_o.gif

Somewhere I hope the errors are caused by the config.

Quote[/b] ]

class CfgPatches

{

class 2S12

{

units[] = {2S12};

weapons[] = {2S12};

requiredVersion = 0.1;

               requiredAddons[] = {};

};

};

class CfgAmmo

{

class Sh_122_HE;

class Ammo_120_HE:Sh_122_HE

{

        timeToLive = 120;

hit=500;

indirectHit=500;

indirectHitRange=7.0;

minRange=75;

minRangeProbab=0.500000;

midRange=500;

midRangeProbab=0.950000;

maxRange=1000;

maxRangeProbab=0.500000;

CloudletsMissile=0;

cloudletColor[]={1,1,1,0};

explosive=1;

simulationStep=0.05;

cost=800;

soundHit[]={\2S12\exp.ogg,db60,1};

soundFly[]={"objects\bulletnoise",0.251189,0.700000};

visibleFire=16; // how much is visible when this weapon is fired

audibleFire=16;

visibleFireTime=5; // how long is it visible

manualControl=0;

maxControlRange=0;

maneuvrability=0.000000;

initTime=0;

thrustTime=0;

thrust=0;

};

};

class CfgMagazines

       {

       class 30Rnd_122mmHE_D30;

       class 120mmHEFRAG_2S12: 30Rnd_122mmHE_D30

               {

               displayName = "FRAG-HE 120 mm";

               ammo = "Ammo_120_HE";

        };

       };

class CfgWeapons

{

/*extern*/ class CannonCore;

class 2S12: CannonCore

{

scopeWeapon = public;

scopeMagazine = public;

reloadTime=2.500000;

displayName = "FRAG-HE 120 mm";

magazines[] = {"120mmHEFRAG_2S12"};

displayNameMagazine = FRAG-HE 120 mm;

shortNameMagazine = FRAG-HE 120 mm;

sound[]={\2S12\mortar_fire.ogg,db70,1};

reloadSound[]={\2S12\mortar_reload.ogg,0.0316,1};

soundContinuous=0;

ammo=Ammo_120_HE;

count=40;

canLock=0;

irLock=0;

autoReload=1;

autoFire = 1;

enableAttack=1;

ffMagnitude=0;

ffFrequency=1;

airLock=0;

primary=10;

aiRateOfFire=0.7;

aiRateOfFireDistance=2000;

opticsFlare=0;

initspeed=110;

};

};

class CfgVehicles

{

class Land;

class LandVehicle: Land

{

/*extern*/ class NewTurret;

};

class StaticWeapon: LandVehicle

{

vehicleClass = "Static";

class Turrets {

class MainTurret: NewTurret {

memoryPointsGetInGunner = "pos_gunner";

memoryPointsGetInGunnerDir = "pos_gunner_dir";

memoryPointGunnerOptics = "gunnerview";

memoryPointGun = "usti hlavne";

outGunnerMayFire = 1;

gunnerOpticsModel = "\ca\Weapons\optika_empty";

minTurn = -180;

maxTurn = 180;

initTurn = 0;

minElev = -15;

maxElev = 90;

initElev = 0;

castGunnerShadow = 1;

ejectDeadGunner = 1;

      turretAxis="OsaVeze";

      soundServo[]={\2S12\mortar_move.ogg,0.3,0.7};

      body="OtocVez";

      gun="OtocHlaven";

class ViewOptics {

initAngleX=+15;

minAngleX=-20;

maxAngleX=+30;

initAngleY=0;

minAngleY=-70;

maxAngleY=+70;

initFov=0.5;

minFov=0.5;

maxFov=0.5;

};

};

};

};

class 2S12: StaticWeapon

{

scope = 2;

side = 0;

crew = "SoldierEB";

displayName = "2S12";

model="\2S12\mortar";

picture="\2S12\mortar.paa";

icon = "\CA\weapons\Data\map_ico\icomap_d30_CA.paa";

mapSize = 7;

nameSound = "cannon";

gunnerHasFlares = 1;

class Turrets: Turrets {

class MainTurret: MainTurret {

weapons = {"2S12"};

magazines = {"120mmHEFRAG_2S12"};

gunnerAction = "D30_Gunner";

gunnerOpticsModel = "\ca\weapons\optika_D30";

};

};

forceHideGunner = 1;

  hasDriver=0;

  hasGunner=1;

      hasCommander=0;

  castGunnerShadow=1;

  unitInfoType="UnitInfoSoldier";

threat[]={1,0.5,0};

hideUnitInfo=1;

gunnerAction="D30_Gunner";

gunnerCanSee="16+4+8";

extCameraPosition[]={0,0.800000,-5};

  cost=10000;

irScanRange=800;

irScanGround=true;

getInAction="ManActGetInCar";

getOutAction="ManActGetOutCar";

armor=60;

armorStructural=10.000000;

type=0;

weapons[]={"2S12"};

magazines[]={"120mmHEFRAG_2S12"};

transportAmmo=0;

accuracy=0.700000;

       };

};

Share this post


Link to post
Share on other sites

wrong forum, this should be in the addon/mod making forum at the bottom of the forums front page.

for a start you need to start using tags on your classnames, even if SH is your tag, you've ommitted it from the cfgpatches section.

I'll have a look through the config, but #3 is likely to be caused by a wrong or missing model.cfg file.

Share this post


Link to post
Share on other sites
Quote[/b] ]

for a start you need to start using tags on your classnames, even if SH is your tag, you've ommitted it from the cfgpatches section.

Please explain that in an idiotproof way  huh.gif

Share this post


Link to post
Share on other sites

tags are an OFPEC initiative that were started to prevent conflicts between addons. It is supported by BIS who registered the BIS tag as theres. Call it your addon signature if you will. All Project UKF addons use the addon tag (or preffix if you will) of UKF_

basically you need to head over to OFPEC and register your tag there (assuming it's hosted there - if not, I think we need to badger BIS to allow us to host a register on the biki or something)

your tag distuingishes your addon as being yours, and because no one else can use your tag, then there is no chance of conflicts. In lames take this for an example:

Addon maker 1 wants to make an M1A2, and so calles his pbo, his class name and his patch name M1A2. Now, Addon maker 2 thinks he can do better, so makes his M1A2 addon, and also decides to use those class names. If someone decides to download both addons, the two addons will conflict and cause each other not to work properly. If they both used the tag system, this would be impossible. Addon maker 1 would use the tag abc_m1a2 and addon maker 2 would use the xyz_m1a2 tag - thus both addons will no longer conflict with each other.

I'm no good at explaning things half the time, but I'd suggest taking a peek at the old ofp addons which uses the tags, and see how it works - if you have any other questions I'll do my best to try and explain them a little better

[edit]

http://community.bistudio.com/wiki/OFPEC_tags

the biki explains it better than me smile_o.gif

Share this post


Link to post
Share on other sites

Oh - now I get it! Sure I will registrer my tag - but first priority is to make the addon work - and then I'll iron out such details  smile_o.gif

Share this post


Link to post
Share on other sites

hehe, of course - just something that you need to get into the habit of, thats all smile_o.gif

Share this post


Link to post
Share on other sites

I'm no expert, but if you take a quick look at Arma's Weapons.cpp, you find ScopeWeapon & ScopeAmmo are no longer used.

Also check out any other Arma cfgWeapons entry, that inherits from class CannonCore. Each one now appears to use just scope:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class M168 : CannonCore {

scope = 1;

cursorAim = "\ca\Weapons\Data\clear_empty";

multiplier = 6;

autoFire = 1;

flashSize = 1.2;

reloadTime = 0.06;

displayName = $STR_DN_M61;

dispersion = 0.0015;

minRange = 1;

minRangeProbab = 0.1;

midRange = 1200;

midRangeProbab = 0.7;

maxRange = 2500;

maxRangeProbab = 0.1;

sound[] = {"\ca\Weapons\Data\Sound\M197_5shots_rotation_end", 17.7828, 1};

aiRateOfFire = 0.3;

aiRateOfFireDistance = 3000;

magazines[] = {"2100Rnd_20mm_M168"};

maxLeadSpeed = 600;

};

It's worth taking a look at Armas configs first, to get a feel for how it's done. It might even be a good idea to use the default configs for the M119, then add your changes one by one. At least you can work out whats causing the problem, if you make changes to a working config, one at a time.

Share this post


Link to post
Share on other sites
Quote[/b] ]

It might even be a good idea to use the default configs for the M119

Allready done that - execpt I used the D30 instead.

Share this post


Link to post
Share on other sites

You need a model config for any animated parts (ex: a turret) to work. Right now you have to just add the CfgModels & CfgSkeletons sections to your regular config, as explainedhere.

Share this post


Link to post
Share on other sites
Quote[/b] ]Allready done that - execpt I used the D30 instead.

So did it object to:  

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">scopeWeapon = public;

When you modified your inherited config? I've yet to find any mention of scopeWeapon in the Arma configs.

Edit:

It sounds like it's not even getting as far as creating the weapon:

Quote[/b] ]Error: creating weapon 2S12 whith scope=private

In OFP at least, a turret without a weapon would never move.

Share this post


Link to post
Share on other sites

Felt like I was reinventing the wheel  mad_o.gif

So now I've started from ground zero and converted the original config. However now the vehicle totally acts like its a D30 but still does'nt move. At least it fires its weapon now, but even though I've set the "Time to live" to 240 the shell still disapears loong before impact *sight*

Config

Quote[/b] ]

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

#define CanSeeRadar 1

#define CanSeeRye 2

#define CanSeeOptics 4

#define CanSeeEar 8

#define CanSeeCompass 16

#define CanSeeRadarC CanSeeRadar+CanSeeCompass

#define CanSeeAll 31

class CfgPatches

{

class 2S12

{

units[] = {2S12};

weapons[] = {mortar};

requiredVersion = 0.1;

};

};

class CfgModels

{

class Default{};

class Vehicle: Default{};

class 2S12: Vehicle

{

       sectionsInherit="Vehicle";

       sections[]={"mortar","OtocHlaven","OtocVez"};

       };

}

class CfgVehicleActions

{

UpAction="CrouchToWeapon";

}

class CfgAmmo

{

class ShellCore;

class ShellBase: ShellCore{};

class Sh_105_HE:ShellBase{};

class Sh_122_HE:Sh_105_HE{};

class Ammo_120_HE:Sh_122_HE

{

           timeToLive = 240; <-------------------

hit=500;

indirectHit=500;

indirectHitRange=7.0;

minRange=75;

minRangeProbab=0.500000;

midRange=500;

midRangeProbab=0.950000;

maxRange=1000;

maxRangeProbab=0.500000;

model = "\ca\Weapons\shell";

CloudletsMissile=0;

cloudletColor[]={1,1,1,0};

explosive=1;

simulation=shotShell;

simulationStep=0.05;

cost=800;

soundHit[]={\2S12\exp.ogg,db60,1};

visibleFire=16;

            audibleFire=16;

visibleFireTime=5;

manualControl=0;

maxControlRange=0;

maneuvrability=0.000000;

initTime=0;

thrustTime=0;

thrust=0;

};

};

class CfgMagazines

       {

       class 30Rnd_105mmHE_M119;

class 30Rnd_122mmHE_D30:30Rnd_105mmHE_M119{};

       class 120mmHEFRAG_2S12: 30Rnd_122mmHE_D30

               {

               displayName = "FRAG-HE 120 mm";

               ammo = "Ammo_120_HE";

        };

       };

class CfgWeapons

{

class CannonCore{};

class M119:CannonCore{};

class D30:M119{};

class wmortar:D30

{

reloadTime=2.500000;

displayName = 120mmHEFRAG_2S12;

displayNameMagazine = 120mmHEFRAG_2S12;

shortNameMagazine = 120mmHEFRAG_2S12;

sound[]={\2S12\mortar_fire.ogg,db70,1};

reloadSound[]={\2S12\mortar_reload.ogg,0.0316,1};

soundContinuous=0;

ammo=Ammo_120_HE;

count=40;

canLock=0;

irLock=0;

autoReload=1;

autoFire = 1;

enableAttack=1;

ffMagnitude=0;

ffFrequency=1;

airLock=0;

primary=10;

aiRateOfFire=0.7;

aiRateOfFireDistance=2000;

opticsFlare=0;

initspeed=110;

};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land: AllVehicles{};

class LandVehicle: Land{};

class StaticWeapon: LandVehicle

{

        class TurretBase {};

};  

class M119: StaticWeapon {};

class D30: M119 {};

class mortar: D30

{

vehicleClass="Static";

hideProxyInCombat=0;

forceHideGunner = 1;

  hasDriver=0;

  hasGunner=1;

      hasCommander=0;

  castGunnerShadow=1;

crew="SoldierEB";

  side=0;

  unitInfoType="UnitInfoSoldier";

threat[]={1,0.5,0};

hideUnitInfo=1;

optics=1;

maxSpeed=0;

fuelCapacity=0;

transportSolider=0;

gunnerAction="ManActUpAction";

gunnerInAction="ManActUpAction";

gunnerCanSee="16+4+8";

extCameraPosition[]={0,0.800000,-5};

  cost=10000;

irScanRange=800;

irScanGround=true;

getInAction="ManActGetInCar";

getOutAction="ManActGetOutCar";

  class Turret

  {

     gunAxis="osahlavne";

     turretAxis="osaveze";

     soundServo[]={\2S12\mortar_move.ogg,0.3,0.7};

     gunBeg="Usti hlavne";

     gunEnd="Konec hlavne";

     minElev=-15;

     maxElev=+90;

     minTurn=-70;

     maxTurn=70;

     body="OtocVez";

     gun="OtocHlaven";

  };

armor=60;

armorStructural=10.000000;

type=0;

model="\2S12\mortar";

weapons[]={"wmortar"};

magazines[]={"120mmHEFRAG_2S12"};

picture="\2S12\mortar.paa";

displayName="2S12";

nameSound="cannon";

transportSoldier=0;

transportAmmo=0;

accuracy=0.700000;

gunnerOpticsColor[]= {0.100000,0.100000,0.100000,0.8};

gunnerOpticsModel = "\ca\weapons\optika_D30";

typicalCargo[]={};

class ViewOptics

{

initAngleX=+15; minAngleX=-20; maxAngleX=+30;

initAngleY=0; minAngleY=-70; maxAngleY=+70;

initFov=0.5; minFov=0.5; maxFov=0.5;

};

  };

};

Share this post


Link to post
Share on other sites

perhaps its not a config issue at all - have you altered the memory points at all?

Share this post


Link to post
Share on other sites
Quote[/b] ] I've set the "Time to live" to 240 the shell still disapears loong before impact *sight*

"Time to live" sets the longest possible time for the round to live. It will still explode when it hits the ground. At the velocity your using (110m/s) at an angle of 25 degrees, it will last about 10 seconds before hitting the ground. If you fire the same round at the highest elevation, it will last for about 20 seconds.

How long did you expect it to last?

As Messiah said, you need to make sure the selections are named properly. Perhaps thats whats wrong with your expected Time TO Live?

BTW I use this config to test things like that:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class MYM119 {

               units[] = {"MYM119"};

               weapons[] = {"MYM119"};

               requiredVersion = 0.1;

               requiredAddons[] = {};

               };

       };

class CfgAmmo

       {

       class Sh_105_HE;

       class MySh_105_HE : Sh_105_HE

               {

               timeToLive = 120;

               //timeToLive = 20;

               };

       };

class CfgMagazines

       {

       class 30Rnd_105mmHE_M119;

       class My30Rnd_105mmHE_M119 : 30Rnd_105mmHE_M119

               {

               displayName = "MySh_105_HE";

               initSpeed = 110;

               //initSpeed = 1100;

               ammo = "MySh_105_HE";

               };

       };

class cfgWeapons

       {

       class M119;        

       class MYM119 : M119

               {

               displayName = "MYM119";

               magazines[] = {"My30Rnd_105mmHE_M119"};

               };

       };

class cfgVehicles

       {

      class StaticWeapon;

      class M119 : StaticWeapon  

           {

           class Turrets

                 {

                 class MainTurret;

                 };

           };

       class MYM119 : M119

               {

               displayName = "My M119";

               class Turrets : Turrets

                       {

                       class MainTurret : MainTurret

                               {

                               weapons[] = {MYM119};

                               magazines[] = {"My30Rnd_105mmHE_M119"};

                               };

                       };

               };

       };

Not sure if it's relevant. But I notice you don't have a class for MainTurret?

Share this post


Link to post
Share on other sites
Quote[/b] ]

have you altered the memory points at all

Have'nt touched the model at all - just the config...

memory.jpg

Share this post


Link to post
Share on other sites

Been fooling around whit the MainTurret "thing" only to discover that the addon now shows up in the editor as a D30 *double sight*  goodnight.gif

Quote[/b] ]

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land: AllVehicles{};

class LandVehicle: Land{};

class StaticWeapon: LandVehicle{};

class M119: StaticWeapon{};

class D30: M119

{

       class Turrets

        {

               class MainTurret;

               };

       };

class mortar: D30

{

vehicleClass="Armored";

hideProxyInCombat=0;

forceHideGunner = 1;

  hasDriver=0;

  hasGunner=1;

      hasCommander=0;

  castGunnerShadow=1;

crew="SoldierEB";

  side=0;

  unitInfoType="UnitInfoSoldier";

threat[]={1,0.5,0};

hideUnitInfo=1;

optics=1;

maxSpeed=0;

fuelCapacity=0;

transportSolider=0;

gunnerAction="ManActUpAction";

gunnerInAction="ManActUpAction";

gunnerCanSee="16+4+8";

extCameraPosition[]={0,0.800000,-5};

  cost=10000;

irScanRange=800;

irScanGround=true;

getInAction="ManActGetInCar";

getOutAction="ManActGetOutCar";

  class Turret: Turrets

  {

     gunAxis="osahlavne";

     turretAxis="osaveze";

     soundServo[]={\2S12\mortar_move.ogg,0.3,0.7};

     gunBeg="Usti hlavne";

     gunEnd="Konec hlavne";

     minElev=-15;

     maxElev=+90;

     minTurn=-70;

     maxTurn=70;

     body="OtocVez";

     gun="OtocHlaven";

 

     class MainTurret: MainTurret

{

armor=60;

armorStructural=10.000000;

type=0;

model="\2S12\mortar";

weapons[]={"wmortar"};

magazines[]={"120mmHEFRAG_2S12"};

picture="\2S12\mortar.paa";

icon="\2S12\gun.paa";

displayName="2S12";

nameSound="cannon";

transportSoldier=0;

transportAmmo=0;

accuracy=0.700000;

gunnerOpticsColor[]={0.100000,0.100000,0.100000,0.8};

gunnerOpticsModel = "\ca\weapons\optika_D30";

typicalCargo[]={};

};

};

class ViewOptics

{

initAngleX=+15;

minAngleX=-20;

maxAngleX=+30;

initAngleY=0;

minAngleY=-70;

maxAngleY=+70;

initFov=0.5;

minFov=0.5;

maxFov=0.5;

};

};

};

About the memory points in the model - they are all named like mentioned in  this topic - as it can be seen at the picture above.

Share this post


Link to post
Share on other sites

Why did you ignore my post? Like I said, you need to define your turret animations in the model config. Go back to the first page and read my post.

Share this post


Link to post
Share on other sites

Sorry - kinda missed that somehow  crazy_o.gif

This is a pure shot in the dark

Quote[/b] ]

class cfgModels

{

class Tank;

            class 2B11: Tank

{

sectionsInherit="";<--------?

sections[]= <----------?

{

"mainTurret "

};

skeletonName="";<--------?

class Animations

{

class mainTurret

{

type="rotationY";

source="turretDir";

selection="mainTurret";

axis="";

memory=1;

sourceAddress="loop";

minValue=0;

maxValue=1;

angle0=0;

angle1="rad -360";

};

};

};

};

Is this new in ArmA from OFP? Never seen this before, so I'm kinda stuck in what to write in the marked spot's...

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  

×