PDA

View Full Version : ?! build ur own ammunition !?



shortylaforge
Jan 18 2003, 15:15
I have built a Tie Fighter up to 99%, but I need some help to configure my new Bullet Model in the Config.CPP.

Here's the Weapons Part of my CPP:

/////////////////////////////////////////////////////////////////////////////////

class CfgPatches
{
class Tie_Fighter
{
units[] = {Tie_Fighter};
weapons[] = {};
requiredVersion = 1.40;
};

class lasergun
{
units[] = {};
weapons[] = {lasergun};
requiredVersion = 1.40;
};



};

class CfgAmmo
{
class Default {};
class BulletSingle: default {
model = "\Tie_Fighter\laser_ammo";
   };
class ExplosiveBullet: BulletSingle {};
class Bullet30: ExplosiveBullet {};
class laserbullet: Bullet30 {

hit=30;
indirectHit=10;
explosive=0;
soundFly[]={\Tie_Fighter\blaster.wav,1,1};
soundEngine[]={\Tie_Fighter\blaster.wav,1,1};
soundHit[]={};

};
};


class CfgWeapons
{
class Default {};
class MGun: Default {};
class MachineGun7_6: MGun {};
class MachineGun30: MachineGun7_6 {};

class lasergun: MachineGun30
{
proxyShape="\Tie_Fighter\laser_ammo";
displayName="Laser Gun";
displayNameMagazine="20mm canon";
shortNameMagazine="20mm mag";
ammo=laserbullet;
count=3000;
reloadTime=0.090000;
initSpeed=700;
sound[]={"\Tie_Fighter\blaster.wav",3.162278,1};
soundContinuous=0;
flashSize=0.000000;
maxLeadSpeed=450;
optics=1;
// model = "\Tie_Fighter\laser_ammo";
};
};

////////////////////////////////////////////////////////////////////////////////

If i define a Weapon proxy (Look @<hidden> Bold text) for my Laser Cannon OFP searches the modell in /data3d/... and not in my Addon Folder http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif&#33;&#33;&#33;
==> OFP crashes....
If i define a known proxy in O˛ and config.cpp like proxy:Mav.1 it works fine, but not with my 3D Model.... ***AAaaarrrgghhh***

Is this really normal in OFP ??
How should i define my own Weapon Proxy with its own model ?

PS: The Config in O˛ isn&#39;t my Problem i think.

Can U help me??

AXE
Jan 18 2003, 19:46
the proxy is supposed to be loaded in the cfg ammo
section, not the cfgweapons section. Also, you need
to remove the // from the line:
// model = "&#92;Tie_Fighter&#92;laser_ammo";
because this defines the FIRED ammunition. Proxies aren&#39;t
the fired ammuntion, they actually just disappear and are
replaced with the fired ammunition model when the weapon
is fired. Hope this helps http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

Rastavovich
Jan 18 2003, 22:04
BTW: take out the model = ... of the class BulletSingle. Those classes are the original ones and they are read only, so you cannot change them. Plcae the model line in your Laserammo class instead.

shortylaforge
Jan 19 2003, 07:32
Now Ive changed the entry like this:

////////////////////////////////////////////////////////////////////

class CfgAmmo
{
class Default {};
class BulletSingle: default {};
class ExplosiveBullet: BulletSingle {};
class Bullet30: ExplosiveBullet {};
class laserbullet: Bullet30 {

hit=30;
indirectHit=10;
proxyShape="&#92;Tie_Fighter&#92;LaserAmmo";
explosive=0;
soundFly[]={&#92;Tie_Fighter&#92;blaster.wav,1,1};
soundEngine[]={&#92;Tie_Fighter&#92;blaster.wav,1,1};
soundHit[]={};

};
};


class CfgWeapons
{
class Default {};
class MGun: Default {};
class MachineGun7_6: MGun {};
class MachineGun30: MachineGun7_6 {};

class lasergun: MachineGun30
{
displayName="Laser Gun";
displayNameMagazine="20mm canon";
shortNameMagazine="20mm mag";
ammo=laserbullet;
count=3000;
reloadTime=0.120000;
initSpeed=700;
sound[]={"&#92;Tie_Fighter&#92;blaster.wav",3.162278,1};
soundContinuous=0;
flashSize=0.000000;
maxLeadSpeed=450;
optics=1;
model="&#92;Tie_Fighter&#92;LaserAmmo";
};
};
////////////////////////////////////////////////////////////////////


And the OFP Engine told me this:

Cannot open object: data3d&#92;laserammo.p3d

Whats the Problem?
PS: I don&#39;t find any Addon that uses its own Proxys. Nothing like proxyshape=myproxy &#33;&#33;&#33;&#33; Only the naming BIS use &#33;&#33;


http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/sad.gif

Rastavovich
Jan 19 2003, 08:46
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Code from official commented config&#58;

class Maverick&#58; Hellfire // A10 AT
{
hit=1900;indirectHit=800;indirectHitRange=2.5;
model = Maverik;
minRange=200;minRangeProbab=0.30;
midRange=600;midRangeProbab=0.80;
maxRange=2000;maxRangeProbab=0.50;
thrust=700;
laserLock=false;
proxyShape = Maverik_proxy;

};[/QUOTE]<span id='postcolor'>
the model needs to be defined in the cfgammo, not in the cfgweapon.

der bastler
Jan 19 2003, 09:12
Perhaps you should remove the model-entry in class lasergun:
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">
class lasergun: MachineGun30
{
  displayName = "Laser Gun";
  displayNameMagazine = "20mm canon";
  shortNameMagazine = "20mm mag";
  ammo = laserbullet;
  count = 3000;
  reloadTime = 0.120000;
  initSpeed = 700;
  sound[] = {"&#92;Tie_Fighter&#92;blaster.wav",3.162278,1};
  soundContinuous = 0;
  flashSize = 0.000000;
  maxLeadSpeed = 450;
  optics = 1;
  <s>model = "&#92;Tie_Fighter&#92;LaserAmmo";</s>
};
[/QUOTE]<span id='postcolor'>

Or does the laser cannon look like the ammo? http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wink.gif

shortylaforge
Jan 19 2003, 09:50
Ive got the solution for this mess:

/////////////////////////////////////////////////////////////////////


class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyLaserAmmo : ProxyWeapon {model = "&#92;Tie_Fighter&#92;LaserAmmo.p3d"; simulation = "alwaysshow";}
};


/////////////////////////////////////////////////////////////////

after Class CfgVehicles

and it works fine..

Thx for all help...

shortylaforge
Jan 20 2003, 19:46
If i changed the Class from bullet to rocket thy fly backwards out of my vehicle (center).

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif LOL http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif

I define a proxyshape for my Quanten-Torpedos.. and the first one looks fine. But if i press the Fire Button they come out of my back ;p==))

////////////////////////////////////////////////////////////////////

class CfgAmmo
{
class Default {};
class AT3: Default {};
class CarlGustav: AT3 {};
class AA : CarlGustav {};

class LaserAmmo : AA
{
proxyShape="&#92;Tie_Fighter&#92;LaserAmmo";
reloadTime=0.05;
maneuvrability=15.0;
irLock=false;
airLock=false;
laserLock=false;
initTime=0.05;
maxleadspeed=4000;
ThrustTime=0.01;
visibleFire=0;
audibleFire=0;
visibleFireTime=0;
minRange=1;minRangeProbab=0.30;
midRange=600;midRangeProbab=0.80;
maxRange=2000;maxRangeProbab=0.50;
maxControlRange=2000;
thrust=7000;
maxSpeed=700;
hit=1900;indirectHit=800;indirectHitRange=2.5;
model="&#92;Tie_Fighter&#92;LaserAmmo";


};
};

class CfgWeapons
{
class Default {};
class MGun: Default {};
class MachineGun7_6: MGun {};
class MachineGun30: MachineGun7_6 {};

class lasergun: MachineGun30
{
displayName="Laser Gun";
displayNameMagazine="20mm canon";
shortNameMagazine="20mm mag";
ammo=LaserAmmo;
count=3000;
reloadTime=0.120000;
initSpeed=700;
sound[]={"&#92;Tie_Fighter&#92;blaster.wav",3.162278,1};
soundContinuous=0;
flashSize=0.000000;
maxLeadSpeed=450;
optics=1;
model="&#92;Tie_Fighter&#92;LaserAmmo";
};
};

class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyLaserAmmo : ProxyWeapon {model = "&#92;Tie_Fighter&#92;LaserAmmo.p3d"; simulation = "maverickweapon";}
};

///////////////////////////////////////////////////////////////////7


And the define of weapon and magazines in the vehicle section..

Whats wrong??

shortylaforge
Jan 26 2003, 08:36
No one who can give a sample Config.cpp and simple p3d to see how it works?

I also cannot change the MODEL in any Bullet type ammo, why?
The only class which isn&#39;t Creatable is the Default class in cfgammo section.

I create something like this:

/////////////////////////////////////////////////////////////////////

class CfgAmmo
{
class Default {};
class LaserAmmo: default
{
model=&#92;deltaflyer&#92;deltaflyer;
hit=1600;indirectHit=1000;indirectHitRange=5;
explosive=1;
visibleFire=16;
audibleFire=16;
visibleFireTime=3; // how long is it visible
minRange=10;minRangeProbab=0.10;
midRange=50;midRangeProbab=0.38;
maxRange=200;maxRangeProbab=0.04;
cartridge="FxCartridge";
cost = 0.7;
soundFly[]={&#92;deltaflyer&#92;blaster.wav,1,1};
soundEngine[]={&#92;deltaflyer&#92;blaster.wav,1,1};
soundHit[]={&#92;deltaflyer&#92;blaster.wav,1,1};
simulation=shotBullet;
simulationStep=0.05;
};
};


////

And it works. But i can&#39;t change the ammo Model. The entry model=... doesn&#39;t works here.

SH....

;p(