Home   Help Search Login Register  

Author Topic: Custom AT mines not possible?  (Read 2298 times)

0 Members and 1 Guest are viewing this topic.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Custom AT mines not possible?
« on: 31 Mar 2008, 20:26:38 »
Ran into this weird problem recently when I was trying to create me own AT mine (custom model).

If I understand correctly the editor placeable mine base is the MineGeneric and the child of it, MineMine, is the actual mine you see in the editor list.
If I'm wrong then the rest is not relevant... :P

Now, if I try to inherit from either one of those in my own config I get a ton of errors, what I see in-game (right when the UI loads up) is "no entry 'bin\config.bin/CfgVehicles/MineGeneric.model'" and the rpt lists the rest; every single config token used in the CfgVehicles class as deemed missing by the game from the MineGeneric or the MineMine class (depending on from which I inherit my mine from).
Also if I try to replace those by using the same classname(s) it still happens.

And obviously the custom mine class doesn't work.

All I would do is to change the mine model, so a config would look something like this (only the relevant bit):
Code: [Select]
class CfgVehicles
{
class MineGeneric;

class myMine: MineGeneric
{
scope=2;
displayName = "My New Glorious Mine";
model = "\mymine\newmine";
};
};

 ???
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Custom AT mines not possible?
« Reply #1 on: 31 Mar 2008, 22:54:33 »
It's a little more complex than that.

I think you will need to define your new mine magazine via cfgMagazines, possibly using the cfgAmmo definition for the ammo used.

Then define the weapon in cfgWeapons using your new magazine for it.


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Custom AT mines not possible?
« Reply #2 on: 01 Apr 2008, 00:14:58 »
Forgot to mention that I already tried that as well, with no luck.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Custom AT mines not possible?
« Reply #3 on: 01 Apr 2008, 00:45:22 »
Like this:

Code: [Select]
//Usual standard definitions here;

class CfgPatches
{
class HMine
{
units[] = {};
weapons[] = {"MineH"};
requiredVersion = 0.10;
requiredAddons[] = {"CAData","CAWeapons"};
};
};

class CfgAmmo
{
class MineCore;
class h_Mine : MineCore
{
hit=1200;indirectHit=1100;indirectHitRange=2;
model= \ca\Weapons\hmine;
defaultMagazine = "HMineMag";
};
};

class CfgMagazines
{
class TimeBomb;
class HMineMag : TimeBomb
{
scope = public;
displayName="Mine belonging to h-";
picture="\CA\weapons\data\equip\HMineMag_ca.paa";
ammo=h_Mine;
nameSoundWeapon="mine";
};
};

class cfgWeapons
{
class Default;
class TimeBomb;
class Put: Default
{
class PutMuzzle;
};

class Put2: Put
{
displayName="MyPutWeapon";
muzzles[] = {HMineMuzzle};

class HMineMuzzle : PutMuzzle
{
displayName="H- MineMuzzle;
magazines[] = {HMineMag};
};
};

class MineH : TimeBomb
{
enableAttack = false;
ammo=h_Mine;
displayName="H Mine";
nameSound="mine";
sound[]={\ca\Weapons\Data\Sound\explosion_big_01_A,db30,1};
class Library {libTextDesc = $STR_LIB_HMINE;};
};
};

class cfgVehicles
{
class MineGeneric;

class H_MineMine : MineGeneric
{
scope = public;
displayName = "Beautiful Mine";
ammo = h_Mine;
};
};


I haven't checked it or anything, will leave that to you..........also you could put in your relevant details where needed.
Not having my own machine to use I am limited in any testing I can do.


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Custom AT mines not possible?
« Reply #4 on: 01 Apr 2008, 09:51:41 »
Thanks.  :clap:

Doesn't work completely though, no error messages at all (which is weird because I did it just like that when I tested it myself back in the day :dunno:) but the mine doesn't show up in the game..

EDIT:
Right, scope has to be 2, not public..

Still wondering why my version didn't work.. Ah well, nothing that I do does so no surprise there  ::)

EDIT part deux:
Found out a bit interesting (and relevant) stuff while I was assing about with this..

Apparently the vehicleClass has to be the default Mines otherwise the mines don't work.  :blink:
Was tearing hair out when a config with exactly the same way about it as the example you gave with just the vehicleClass as difference wouldn't work..
« Last Edit: 03 Apr 2008, 18:55:20 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Custom AT mines not possible?
« Reply #5 on: 04 Apr 2008, 00:43:37 »
So, you have it working yet?


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Custom AT mines not possible?
« Reply #6 on: 04 Apr 2008, 07:28:02 »
Yes, it's working.
That vehicleClass thing just kept me guessing for some time.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline zandhaas

  • Members
  • *
Re: Custom AT mines not possible?
« Reply #7 on: 04 Apr 2008, 10:48:05 »
Hi,

As I have been trying to get a custom AT mine to work too, but unfortunately failing, I would appreciate it if you could post the entire cfgVehicles definition of the working custom AT mine so I can learn from your example.

Regards,

Sander

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Custom AT mines not possible?
« Reply #8 on: 04 Apr 2008, 11:12:18 »
I can't post mine as it is as I'm not allowed to show the actual config (bound by NDA ;) ) even if it has nothing special in it.

There really is nothing wrong with Plancks example but here's a modified version of mine (for two different mines), no guarantees it will work 'out of the box' though:
Code: [Select]
class CfgPatches
{
class my_mines
{
units[]={};
weapons[]={"My_mine1","My_mine2"};
requiredAddons[] = {"CAData","CAWeapons"};
requiredVersion=1.07;
};
};

class CfgAmmo
{
class MineCore;

class My_Mine1Ammo: MineCore
{
hit=1200;
indirectHit=1100;
indirectHitRange=2;
model= "\path\model";
defaultMagazine = "My_Mine1Mag";
};
class My_Mine2Ammo: My_Mine1Ammo
{
hit=800;
indirectHit = 500;
model="\path\model";
defaultMagazine = "My_Mine2Mag";
};
};

class CfgMagazines
{
class TimeBomb;

class My_Mine1Mag: TimeBomb
{
scope=2;
displayName="My Mine 1";
picture="\CA\weapons\data\equip\HMineMag_ca.paa";
ammo = "My_Mine1Ammo";
};
class My_Mine2Mag: My_Mine1Mag
{
displayName = "My Mine 2";
ammo="My_Mine2Ammo";
};
};

class CfgWeapons
{
class Default;
class TimeBomb;
class Put: Default
{
class PutMuzzle;
};

class My_MinePut: Put
{
displayName="My Put";
muzzles[] = {"My_MinePutMuzzle"};

class My_MinePutMuzzle: PutMuzzle
{
displayName="My Mine Put";
magazines[] = {"My_Mine1Mag","My_Mine2Mag"};
};
};
class My_Mine1: TimeBomb
{
enableAttack = 0;
ammo="My_Mine1Ammo";
displayName="My Mine 1";
nameSound="mine";
sound[]={};
class Library {};
};
class My_Mine2: My_Mine1
{
ammo="My_Mine2Ammo";
displayName="AT Mine m/36";
};
};

class cfgVehicles
{
class MineGeneric;

class My_Mine1Mine: MineGeneric
{
scope = 2;
displayName = "My Mine 1";
ammo = "My_Mine1Ammo";
model= "\path\model";
};
class My_Mine2Mine: My_Mine1Mine
{
displayName="My Mine 2";
ammo = "My_Mine2Ammo";
model="\path\model";
};
};
This of course requires you to make some custom soldier with the My_MinePut in it's weapons array. If you want to have the default soldiers using the mines you need to copy/paste the BIS Put into you config (in place of My_MinePut) and add your mine mags in the mags array.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline zandhaas

  • Members
  • *
Re: Custom AT mines not possible?
« Reply #9 on: 08 Apr 2008, 16:25:07 »
Thanks, this has helped me create a working custom mine.

Regards,

Sander