Jump to content
Bonezz

fire after vehicle is destroyed !

Recommended Posts

hey guys i looked around before i came here to ask , i couldnt find anything what is the way to make the vehicle go on fire after its damaged do i have to add something in OB , or its in the config can some one explain please . and happy new year for u all.

Share this post


Link to post
Share on other sites

I'm not 100% sure, but I think it's automatic if you inherit from an appropriate BIS vehicle, like "car_f" in config.cpp.

 

Edit: probably the contents of this class...?

class DestructionEffects {}
 

 

 

Share this post


Link to post
Share on other sites
6 hours ago, UK_Apollo said:

I'm not 100% sure, but I think it's automatic if you inherit from an appropriate BIS vehicle, like "car_f" in config.cpp.

 

Edit: probably the contents of this class...?

class DestructionEffects {}
 

 

 

thats what i thought too but its just getting damaged no blow up or smoke and fire , and that class i cant find no where  class DestructionEffects {}

Share this post


Link to post
Share on other sites

class DestructionEffects{} can be found in all the cfgVehicles.

 

Can you show the config.cpp lines relating to your class inheritance?

Share this post


Link to post
Share on other sites
6 hours ago, UK_Apollo said:

class DestructionEffects{} can be found in all the cfgVehicles.

 

Can you show the config.cpp lines relating to your class inheritance?

Spoiler

#include "basicdefines_A3.hpp"
class DefaultEventhandlers;

class CfgPatches {

    class ford_e350 {
        units[] = {"ford_e350"};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Soft_F","ym_data"};
    };
};

class WeaponFireGun;
class WeaponCloudsGun;
class WeaponFireMGun;
class WeaponCloudsMGun;

class CfgVehicles
{
    class Car;
    class Car_F: Car
    {
        class HitPoints /// we want to use hitpoints predefined for all cars
        {
            class HitLFWheel;
            class HitLF2Wheel;
            class HitRFWheel;
            class HitRF2Wheel;
            class HitBody;
            class HitGlass1;
            class HitGlass2;
            class HitGlass3;
            class HitGlass4;
        };
        class EventHandlers;
   class AnimationSources;
    };

    class ford_e350_base: Car_F
    {
        model     = "\ford_e350\ford_e350";  /// simple path to model
        picture    = "\YM_data\UI\map_car_E30.paa"; /// icon in map
        Icon    = "\YM_data\UI\map_car_E30.paa"; /// icon in map
        displayName = "1990 Ford E350"; /// displayed in Editor
        hiddenSelections[] = {"camo1","license1","license2","license3","license4","license5","license6"}; ///we want to allow changing the color of this selection
        hiddenSelectionsTextures[] = {"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""};
        author = "Mado S.Yaghi";
        terrainCoef     = 2;     /// different surface affects this car more, stick to tarmac
        turnCoef         = 3;     /// should match the wheel turn radius
        precision = 10;
        brakeDistance = 3;
        fireResistance     = 5;     /// lesser protection against fire than tanks
        armor             = 65;     /// just some protection against missiles, collisions and explosions
        cost = 50000;
        transportMaxBackpacks     = 3; /// just some backpacks fit the trunk by default
        transportSoldier         = 7; /// number of cargo except driver
        weapons[]=
        {
            "TruckHorn3"
        };
        /// some values from parent class to show how to set them up
        wheelDamageRadiusCoef     = 1;             /// for precision tweaking of damaged wheel size
        wheelDestroyRadiusCoef     = 0.4;            /// for tweaking of rims size to fit ground
        maxFordingDepth         = 0.5;            /// how high water would damage the engine of the car
        waterResistance         = 1;            /// if the depth of water is bigger than maxFordingDepth it starts to damage the engine after this time
        crewCrashProtection        = 0.25;            /// multiplier of damage to crew of the vehicle => low number means better protection
        driverLeftHandAnimName     = "drivewheel"; /// according to what bone in model of car does hand move
        driverRightHandAnimName = "drivewheel";    /// beware, non-existent bones may cause game crashes (even if the bones are hidden during play)
        class Library
        {
            year="1990";
            manufacturer="Ford";
            model="E350";
            engineLayout="S6";
            country="USA";
            libTextDesc="";
        };

        class eventhandlers
        {};
        class AnimationSources: AnimationSources
        {};

        class TransportItems /// some first aid kits in trunk according to safety regulations
        {
        };
        class UserActions {};
        class Turrets {}; /// doesn't have any gunner nor commander
        class HitPoints: HitPoints
        {
            class HitLFWheel: HitLFWheel    {armor=0.125; passThrough=0;}; /// it is easier to destroy wheels than hull of the vehicle
            class HitLF2Wheel: HitLF2Wheel    {armor=0.125; passThrough=0;};

            class HitRFWheel: HitRFWheel    {armor=0.125; passThrough=0;};
            class HitRF2Wheel: HitRF2Wheel     {armor=0.125; passThrough=0;};

            class HitFuel             {armor=0.50; material=-1; name="fueltank"; visual=""; passThrough=0.2;}; /// correct points for fuel tank, some of the damage is aFRLied to the whole
            class HitEngine         {armor=0.50; material=-1; name="engine"; visual=""; passThrough=0.2;};
            class HitBody: HitBody     {name = "body"; visual="camo1"; passThrough=1;}; /// all damage to the hull is aFRLied to total damage

            class HitGlass1: HitGlass1 {armor=0.25;}; /// it is pretty easy to puncture the glass but not so easy to remove it
            class HitGlass2: HitGlass2 {armor=0.25;};
            class HitGlass3: HitGlass3 {armor=0.25;};
            class HitGlass4: HitGlass4 {armor=0.25;};
        };

        driverAction         = driver_Van_01; /// what action is going the driver take inside the vehicle. Non-existent action makes the vehicle inaccessible
        cargoAction[]=
        {
            "passenger_low01",
            "passenger_flatground_crosslegs",
            "passenger_flatground_crosslegs",
            "passenger_flatground_crosslegs",
            "passenger_flatground_crosslegs",
            "passenger_flatground_crosslegs",
            "passenger_flatground_crosslegs"
        };
        hideWeaponsDriver = true;
        hideWeaponsCargo = true;
        getInAction         = GetInLow;         /// how does driver look while getting in
        getOutAction         = GetOutLow;         /// and out
        cargoGetInAction[]     = {"GetInLow"};     /// and the same for the rest, if the array has fewer members than the count of crew, the last one is used for the rest
        cargoGetOutAction[] = {"GetOutLow"};     /// that means all use the same in this case
        memoryPointsGetInCargo[] = 
        {
            "pos_cargo_1",
            "pos_cargo_2",
            "pos_cargo_3"
        }; 
        memoryPointsGetInCargoDir[] = 
        {
            "pos_cargo_dir_1",
            "pos_cargo_dir_2",
            "pos_cargo_dir_3"
        };

        #include "sounds.hpp"    /// sounds are in a separate file to make this one simple
        #include "pip.hpp"        /// PiPs are in a separate file to make this one simple
        #include "physx.hpp"    /// PhysX settings are in a separate file to make this one simple

        /// memory points where do tracks of the wheel appear
        // front left track, left offset
        memoryPointTrackFLL = "TrackFLL";
        // front left track, right offset
        memoryPointTrackFLR = "TrackFLR";
        // back left track, left offset
        memoryPointTrackBLL = "TrackBLL";
        // back left track, right offset
        memoryPointTrackBLR = "TrackBLR";
        // front right track, left offset
        memoryPointTrackFRL = "TrackFRL";
        // front right track, right offset
        memoryPointTrackFRR = "TrackFRR";
        // back right track, left offset
        memoryPointTrackBRL = "TrackBRL";
        // back right track, right offset
        memoryPointTrackBRR = "TrackBRR";

        class Damage
            {
                tex[]={};
                mat[]=
                {                    
                 "ym_data\common\metallic_co.rvmat",
                 "ym_data\common\metallic_damage.rvmat",
                 "ym_data\common\metallic_destruct.rvmat",
                 
                 "ym_data\common\glass_veh.rvmat",
                 "ym_data\common\glass_veh_damage.rvmat",
                 "ym_data\common\glass_veh_damage.rvmat"
                };
            };

        class Exhausts /// specific exhaust effects for the car
        {
            class Exhaust1 /// the car has two exhausts - each on one side
            {
                position     = "exhaust1_pos";          /// name of initial memory point
                direction     = "exhaust1_dir";    /// name of memory point for exhaust direction
                effect         = "ExhaustEffectOffroad";    /// what particle effect is it going to use
            };

            class Exhaust2
            {
                position     = "exhaust2_pos";
                direction     = "exhaust2_dir";
                effect         = "ExhaustEffectOffroad";
            };
        };

        class Reflectors    /// only front lights are considered to be reflectors to save CPU
        {
            class LightCarHeadL01     /// lights on each side consist of two bulbs with different flares
            {
                color[]         = {1900, 1800, 1700};        /// approximate colour of standard lights
                ambient[]        = {5, 5, 5};                /// nearly a white one
                position         = "LightCarHeadL01";        /// memory point for start of the light and flare
                direction         = "LightCarHeadL01_end";    /// memory point for the light direction
                hitpoint         = "Light_L";                /// point(s) in hitpoint lod for the light (hitPoints are created by engine)
                selection         = "Light_L";                /// selection for artificial glow around the bulb, not much used any more
                size             = 1;                        /// size of the light point seen from distance
                innerAngle         = 100;                        /// angle of full light
                outerAngle         = 179;                        /// angle of some light
                coneFadeCoef     = 10;                        /// attenuation of light between the above angles
                intensity         = 1;                        /// strength of the light
                useFlare         = true;                        /// does the light use flare?
                dayLight         = false;                    /// switching light off during day saves CPU a lot
                flareSize         = 1.0;                        /// how big is the flare

                class Attenuation
                {
                    start             = 1.0;
                    constant         = 0;
                    linear             = 0;
                    quadratic         = 0.25;
                    hardLimitStart     = 30;        /// it is good to have some limit otherwise the light would shine to infinite distance
                    hardLimitEnd     = 60;        /// this allows adding more lights into scene
                };
            };

            class LightCarHeadL02: LightCarHeadL01
            {
                position     = "LightCarHeadL02";
                direction     = "LightCarHeadL02_end";
                FlareSize     = 0.5;                        /// side bulbs aren't that strong
            };

            class LightCarHeadR01: LightCarHeadL01
            {
                position     = "LightCarHeadR01";
                direction     = "LightCarHeadR01_end";
                hitpoint     = "Light_R";
                selection     = "Light_R";
            };

            class LightCarHeadR02: LightCarHeadR01
            {
                position     = "LightCarHeadR02";
                direction     = "LightCarHeadR02_end";
                FlareSize     = 0.5;
            };
        };
        aggregateReflectors[] = {{"LightCarHeadL01", "LightCarHeadL02"}, {"LightCarHeadR01", "LightCarHeadR02"}}; /// aggregating reflectors helps the engine a lot
    };
    class ford_e350_stock : ford_e350_base
    {
        scope    = 2;             /// makes the car visible in editor
        scopeCurator=2;            // scope 2 means it's available in Zeus mode (0 means hidden)
        crew     = "C_man_1";     /// we need someone to fit into the car
        side    = 3;             /// civilian car should be on civilian side
        faction    = CIV_F;        /// and with civilian faction
        displayName = "1990 Ford E350 ";
        hiddenSelectionsTextures[] = {"Ford_E350\data\skins\skin1.paa"};
        class EventHandlers
        {
            init="(_this select 0) execVM ""\Ford_E350\scripts\license.sqf"";";
        };
    };
    class ford_e350_red : ford_e350_base
    {
        scope    = 2;             /// makes the car visible in editor
        scopeCurator=2;            // scope 2 means it's available in Zeus mode (0 means hidden)
        crew     = "C_man_1";     /// we need someone to fit into the car
        side    = 3;             /// civilian car should be on civilian side
        faction    = CIV_F;        /// and with civilian faction
        displayName = "1990 Ford E350 (Red) ";
        hiddenSelectionsTextures[] = {"Ford_E350\data\skins\skin2.paa"};
        class EventHandlers
        {
            init="(_this select 0) execVM ""\Ford_E350\scripts\license.sqf"";";
        };
    };
};
 

here is my config

Share this post


Link to post
Share on other sites
On 03/01/2017 at 6:42 PM, Bonezz said:

   class eventhandlers
        {};

this breaks all the eventhandlers on your car

those are needed to make the killed fx work

Share this post


Link to post
Share on other sites
4 hours ago, eggbeast said:

this breaks all the eventhandlers on your car

those are needed to make the killed fx work

so i should remove it ?

Share this post


Link to post
Share on other sites

well you add an EH later so maybe better to learn inheritance

you did the same with that class animationsources {}; earlier - basically wiping all of BI's animationsources and eventhandlers is not a good start for your project.


 

class car_F
{
	//etc etc
	class eventhandlers; 
//this just declares the class within the BI "parent" class, so you can inherit from it in your "child" project car
// class eventhandlers {}; would break every car in your game, as it's in the base class, and the empty {} is not inheriting anything to begin with, unlike my example below.
};
class mycar: car_F 
{
	//etc etc
	class eventhandlers: eventhandlers  //my EH goes here but will be added to the BI ones instead of replacing them
	{
		class mymodname_whatever_i_like_EH_subclass //doing it in your own subclass prevents conflicts

		{
			init = "call my init EH"; //etc w/e you decide to use for your EH's could be fired, or getin or w/e, note this is pseudocode, not real syntax
		};
	};
};

 

  • Like 1

Share this post


Link to post
Share on other sites

bump anyone can help with this still ?

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

×