Home   Help Search Login Register  

Author Topic: Cfg for fire  (Read 1997 times)

0 Members and 1 Guest are viewing this topic.

marcus3

  • Guest
Cfg for fire
« on: 17 Nov 2005, 06:44:15 »
i need a small cfg file for a fire addon i am makeing...i dont know where to look.
thanks

Offline Pilot

  • Contributing Member
  • **
Re:Cfg for fire
« Reply #1 on: 17 Nov 2005, 15:05:22 »
Look at the commented configs

It will look something like this:
#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

#define private 0
#define protected 1
#define public 2

class CfgPatches
{
  class nameofPBOwhichyourmodelisin
  {
      units[] = {YourCfgVehiclesclassname};
      requiredVersion = 1.46
  };
};

class CfgModels
{
  class Default {};
  class modelnamewithouttheP3Dextension : Default
  {
      sections[] = {};
      sectionsInherit="";
  };
};

class CfgVehicles
{
  class All {};
  class Static: All {};
  class Building: Static {};
  class NonStrategic : Building {};
  class Fire: NonStrategic {};
  class YourCfgVehiclesclassname: Fire
  {      
      scope = public;
      simulation="fire";
      sound = "Fire";
      vehicleClass="Objects";
      icon="Unknown_object";
      model = "\PBOname\modelname";
      displayName="SomeName";
      mapSize = 1.2;
      cost=0;
      armor=20;
      class Smoke : FlameSpectrum
      {
         interval = 0.01;
         cloudletDuration = 0.9;                                        
         cloudletAnimPeriod = 1.0;
         cloudletSize = 0.1;
         cloudletAlpha = 0.8;
         cloudletGrowUp = 0.4;
         cloudletFadeIn = 0.0;
         cloudletFadeOut = 5.0;
         cloudletAccY = -0.1;
         cloudletMinYSpeed = 0.3;
         cloudletMaxYSpeed = 1.5;
         cloudletShape = "cl_basic";
         cloudletColor[] = {1, 1, 1, 0};
         initT = 1000;
         deltaT = -500;
         class Table
         {
            class T1 {maxT = 0; color[] = {0.8, 0.8, 0.8, 1};}
            class T2 {maxT = 900; color[] = {0.3, 0.3, 0.3, 1};}
            class T3 {maxT = 1000; color[] = {1, 0.5, 0, 0.5};}
         };
         initT = 2200;
         deltaT = -4000;
         density = 0.5;
         size = 0.1;
         initYSpeed = 1.7;
         timeToLive = 1e20;
         in = 0.0;
         out = 0.0;
      };

      class Light
      {
         color[] = {1.0, 0.5, 0.0, 1.0};
         ambient[] = {0.3, 0.15, 0.0, 1.0};
         brightness = 0.08;
         shape = "koulesvetlo";
         size = 0.3;
         position = "ohniste";
      };
   };
};

I am pretty sure this needs a CfgPatches section, I will add it when I remember how to do it ::)

There also might need to be something entered for CfgModels SectionsInherit.

-Pilot

EDIT:
Ok, CfgPatches added.  Simply replace the "class YourFire" with the name of your fire.  Make sure the name of the class is also the name of the pbo.  For example, if you chose "MarcusFire" as the name, you would name the pbo file MarcusFire.pbo and you would use class MarcusFire.

EDIT EDIT:
Btw, this config isn't tested and is not guarenteed to work.  You will most likely have some problem with it as I probably forgot something. ::)
« Last Edit: 17 Nov 2005, 15:46:34 by Pilot »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cfg for fire
« Reply #2 on: 17 Nov 2005, 15:29:33 »
Pilots example is fine, however one or two things to add:

Code: [Select]
class CfgPatches
{
  class nameofPBOwhichyourmodelisin
  {
      units[] = {YourCfgVehiclesclassname};
      requiredVersion = 1.46
  };
};

Also:

Code: [Select]
class CfgModels
{
  class Default {};
  class modelnamewithouttheP3Dextension : Default
  {
      sections[] = {};
      sectionsInherit="";
  };
};

Finally:

Code: [Select]
class CfgVehicles
{
  class All {};
  class Static: All {};
  class Building: Static {};
  class NonStrategic : Building {};
  class Fire: NonStrategic {};
  class YourCfgVehiclesclassname: Fire
  {      
      scope = public;
      simulation="fire";
      sound = "Fire";
      vehicleClass="Objects";
      icon="Unknown_object";
      model = "\PBOname\modelname";
      displayName="SomeName";
      mapSize = 1.2;
      cost=0;
      armor=20;

Ok, so I lied it was three things.   ;D ;D


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

Offline Pilot

  • Contributing Member
  • **
Re:Cfg for fire
« Reply #3 on: 17 Nov 2005, 15:39:23 »
Somehow I knew Planck would show up. ;D ;D

Actually, that clears up a few things for me.  I never was too sure of the reationship of the model name, pbo name, and cfgvehicles name with the various config sections (no idea if that made any sense ::))  To get around it I just gave the PBO, model, and CfgVehicles class names the same name.

That isn't incorrect practice, is it?

-Pilot

EDIT:
I modified my original post to take Planck's fixes into account
« Last Edit: 17 Nov 2005, 15:52:33 by Pilot »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cfg for fire
« Reply #4 on: 17 Nov 2005, 15:47:55 »
No, if you want everything to have the same name, that is fine.

However it might not make sense if you have more than one model in your PBO.
Especially if you come back to work on your project after a few weeks of R&R.


EDIT:  I must also mention that it is wise to use an OFPEC tag for your pbo, model, etc.
Find out about Tags < -- there


Planck
« Last Edit: 17 Nov 2005, 15:51:40 by Planck »
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:Cfg for fire
« Reply #5 on: 17 Nov 2005, 15:55:09 »
Fortunately, there is only 1 model in the addon.  Like it matters, I will probably never finish it... ::)

Yes, do look into tags, they go a long way to eliminating addon conflict issues.

-Pilot

marcus3

  • Guest
Re:Cfg for fire
« Reply #6 on: 17 Nov 2005, 19:32:52 »
i get this error msg when i start ofp
Cfgvehicles/marcus_fire.smoke: undefind class base "Flamespectrum"
i have no idea what the problem is, i took the cfg from pilots post, word for word, put my names in. anways, thanks for the help so far.


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cfg for fire
« Reply #7 on: 17 Nov 2005, 19:43:25 »
Replace the class Smoke section with this one:

Code: [Select]
class Smoke
      {
         interval=0.01;
         cloudletDuration=0.9;
         cloudletAnimPeriod=1.0;
         cloudletSize=0.1;
         cloudletAlpha=0.8;
         cloudletGrowUp=0.4;
         cloudletFadeIn=0.0;
         cloudletFadeOut=5.0;
         cloudletAccY=-0.1;
         cloudletMinYSpeed=0.3;
         cloudletMaxYSpeed=1.5;
         cloudletShape="cl_basic";
         cloudletColor[]={1,1,1,0};
         initT=1000;
         deltaT=-500;
         density=0.5;
         size=0.1;
         initYSpeed=1.7;
         timeToLive=1.00000002004088E+20;
         in=0.0;
         out=0.0;

         class Table
         {
            class T1
            {
               maxT=0;
               color[]={0.8,0.8,0.8,1};
            };

            class T2
            {
               maxT=900;
               color[]={0.3,0.3,0.3,1};
            };

            class T3
            {
               maxT=1000;
               color[]={1,0.5,0,0.5};
            };
         };
    };

Next time I'll need to check more thoroughly.   ::)


Planck
« Last Edit: 17 Nov 2005, 19:44:34 by Planck »
I know a little about a lot, and a lot about a little.

marcus3

  • Guest
Re:Cfg for fire
« Reply #8 on: 17 Nov 2005, 19:52:57 »
thanks mate! works  ;D
(clicks solve)