Home   Help Search Login Register  

Author Topic: Ammo Doesn't Exist Ingame  (Read 1193 times)

0 Members and 1 Guest are viewing this topic.

imemyself

  • Guest
Ammo Doesn't Exist Ingame
« on: 27 Oct 2003, 01:33:12 »
OK, the ammo from my config, just doesn't show up in game.  It gives me the error message like you get when you misspell the name of a magazine, when you put
Code: [Select]
this addmagazine "edcFLASHRocketHE" in someone's init field and start the mission.
I'm sure I'm not misspelling it.

Also, I get a no entry modelSpecial error when I try to start a mission w/ the M-202 guy defined in the config.
Here's my cpp:
Code: [Select]
//M202 FLASH
//By edc-From OFP Forums imemyself-From OFPEC
//olrbengax@cox.net


// Basic def.
#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


class CfgPatches
{
   class edcFLASH
   {
      units[]={edcFLASHSoldier};
      weapons[]={edcFLASHLauncher};
      requiredVersion=1.91000;
   };
};

class CfgModels
{
   class Default{};
 Â Â Â class Weapon: Default{};
 Â Â Â class edcFLASHLauncher: Weapon{};

};

class CfgAmmo
{
   class Default {};
   class AT3: Default {};
   class LAW: AT3 {};
   class edcFLASHRocketHE: LAW
  {
   hit=200;
   indirectHit=125;
   indirectHitRange=10;
   minRange=30;
   midRange=100;
   maxRange=150;
   simulation="shotRocket";
   simulationStep=0.050000;
   };
};


class CfgWeapons
{
   class Default {};
   class LAWLauncher: Default {};
   class edcFLASHLauncher: LAWLauncher
   {  
       modelOptics="optika_LAW";
       weaponType=16;
       modelSpecial = "";
      model="\edcFLASH\m202";
      displayName="M-202 FLASH";
      displayNameMagazine="M-202 Flash Rocket";
      shortNameMagazine="FLASH Round";
      ammo="edcFLASHRocketHE";
      picture="\edcFLASH\black.paa";
        magazineType="4 *          256";
        count=4;
        reloadTime=0.7500000;
      
   };

};



class CfgVehicles
{
   class All{};
   class AllVehicles: All{};
   class Land: AllVehicles{};
   class Man: Land{};
   class Soldier: Man{};
   class SoldierWB: Soldier{};
   class SoldierWLAW: SoldierWB{};
   class edcFLASHSoldier: SoldierWLAW
   {
       access=2;
      displayName="M202 Soldier";
      weapons[]={"Throw","Put","edcFLASHLauncher","M16"};
      magazines[]={"M16","M16","M16","M16","M16","edcFLASHRocketHE"};
      reloadTime=1.000000;
      type=0;
      vehicleClass = "Men";
   };   
};

class CfgNonAIVehicles
{
   class ProxySecWeapon {};
   class ProxyedcFLASHSoldier : ProxySecWeapon {};

};
BTW, I get no errors when starting OFP, and when I add the launcher to someone, there are no errors.
« Last Edit: 27 Oct 2003, 01:52:30 by imemyself »

KyleSarnik

  • Guest
Re:Ammo Doesn't Exist Ingame
« Reply #1 on: 27 Oct 2003, 02:53:40 »
You need a seprate calss for your weapon and the magazine. The ammo is defined in the mags classname. Then in the weapon classname put the line:

Code: [Select]
magazines[]={"magclassname"};
The way you did it only works for vehicle mounted weapons.

imemyself

  • Guest
Re:Ammo Doesn't Exist Ingame
« Reply #2 on: 27 Oct 2003, 03:51:21 »
I don't think I understand when you mean.  What do I do before putting the magazines[] thing in?

Offline SelectThis

  • Former Staff
  • ****
  • .
Re:Ammo Doesn't Exist Ingame
« Reply #3 on: 27 Oct 2003, 04:37:19 »
Have a look at the AT4 or RP7 coding in JAM for a sample on how it's done.

SelectThis

imemyself

  • Guest
Re:Ammo Doesn't Exist Ingame
« Reply #4 on: 27 Oct 2003, 08:17:52 »
Oooohhhh, OK, after looking @ JAM's stuff, I get it.  Thanks for the help, guys, I never woulda figured that out on my own. :-*  :cheers: