Thromp
Jan 11 2012, 19:25
THIS example is an OTT example and should not be seen as a good end product use section counts sparingly , many of these can cause lag , pls be sensible and create strategic damage like holes in tunnel roofs for rescues etc
It will also work on vehicles to a degree too , but better use deform animation instead
I wont have much time now or as much as i would like to play and mess with this game ,this is a brief example of something i made when i read about destruction in some other thread and i leave here for others to maybe learn from it.
Tools i Used
BI tools http://community.bistudio.com/wiki/BI_Tools_2
C4D (demo 40 days)http://www.maxon.net/downloads/demo-version.html
Nitroman4d xbreaker scripts http://nitro4d.com/blog/freebie/xbreaker/
Overview of the download
In the downlaod there is a Binarised PBO and a folder containing the unbinarised model and textures, the idea of the example is to show how you can Hide damage on a part of the model and how you can (A) script a particle effect to the effected area and or (B) config an engine based particle effect to the area affected.
Media/B]
A small video follows to show (badly) a use for such an addon
5_YRFLGbd7c
for visitor please use the LAND_ prefix in usual way and remember script wont init from that model make a module to define the handle your calling there
HOW WHAT WHERE Model
I presume you already know how to make addons altho with this downlaod and this description you can at least make walls for yourself.
So make a box object in C4D and run the xbreaker script , ideally you probably only want the center to break so maybe choose 5 pieces for the script to break it into
then only name and config the sections you want to be destroyed.
Export the model as 3ds and import to the o2 , if you keep the name properties Piece_0-_x in the model then you can recycle my configs and cpp
most of the breaks will allow you to create your geometry very easy bu copy and paste and component convex hull .
finish in the normal way ( see whats in the download mlod) and your done.you could always use this on an existing wall in your own house model and not create a box.
The Example is an OTT example you would never need 40 +pieces in such an object , i did it to create a template more than anything.
HOW WHAT WHERE CPPand cfg
in the Model.cfg we define the Hide animation like this
first we define the bone
"piece_1","",
then we define what we want to do with the bone , in this case Hide it.
class Animations
{
class hit1
{
type="hide";
source="hit1";
selection="piece_1";
minValue = 0;
maxValue = 1;
minphase = 0;
maxphase =1;
hideValue = 0.9;
};
this tells the engine to Hide piece_1 when the value of Hit1 is at 0.9
the way we define Hit1 THE SOURCE is in the CPP like so :
class Hitpoints {
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
The armor = 0.05 is a refference to the Hipotint being .05% of the total armor of the class
The convex component will also hide the Geometry (may not be necessary to name it as the geo lod has it name same anyway)
Visual is old way when Material had a number in 02 on texture and then texture will change so obsolete for this.
Mess with the armor to suit you , geometry weight of model is also another factor here, however the biggest thing when defining here is to remember BIS use a Hit factor radius including an indirect hit radisu , this may affect your results if you set things too light or too heavy , it will certainly effect the precision in many cases i believe
We can add aditonal Config Particles by adding the following to the hipoint
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
[B]class DestructionEffects {
class Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 5;
};
class Dust2 : Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 3;
};
class Dust3 : Dust {
simulation = "particles";
type = "ExploRocksDark";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 1;
};
};
};
Now the model will have particle effect at the point described in position = "piece_1";
to achieve this perfect copy and paste the Piece_1 from the geo lod and place it in the Memory lod and press Shift + D , this will create
one point at the center , sometimes because we have hiddeln Piece_1 the particle can fail so maybe rename this point in memory lod and CPP to piece_1D and position = "piece_1D";
you can also make a ruin model for each piece if you wish by adding the following ( i have no time to show how to config the class ruin sorry, however to config in hitpoint
its like this :
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
class DestructionEffects {
[B]class Ruin1
{
simulation = "ruin";
type = "thromp_example\Ruins\thromp_example_piece_1_Ruins";
position = "dampiece_1";
intensity = 1;
interval = 1;
lifeTime = 1;
};
class Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 5;
};
class Dust2 : Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 3;
};
class Dust3 : Dust {
simulation = "particles";
type = "ExploRocksDark";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 1;
};
};
HOW WHAT WHERE Scripted Damage
As well as cpp effect there are many ways to script it , for normal use or cutscene
For adding particles to the model when its damaged (becareful remember this is no matter what damage , not when damaged to 0.9 of 0.05% like defined in the model.cfg and the CPP)
add an eventhandler that is called when damaged simple as so ( shown in example download)
class Eventhandlers {
init = "_scr = _this execVM ""\thromp_example\scripts\init.sqf"";";
dammaged = "_this call thromp_exampledebris;";
};
Init could simply define the thromp_exampledebris and this isnt efficient to init same for every model , pls make a module or something for many models
you can just use a format script for cutscene and use for TOH selectionposdamage .
well i hope you have fun and pls leave any questions , i may have time to come here to answer them but until then :
I hope you have fun and i hope i haven't made your life worse ;)
Thromp
the download is in the spoiler
http://www.mediafire.com/?6eywe9c4ysvag64
Pls feel free to use the Unbinarised things in Any Bis Engine Game only .
there is no permission to use the model scripts and Textures outside of CO A2 and TOH games any sharing of this link without this read me will result in copyright issues and the poster could become liable to any legal issues persued as a result .similarly do not host the download for the same reasons
IMPORTANT
Please make sure if you do make something change folder names and paths and especially dont use Thromp_ anywhere make a TAG for you ;)
IMPORTANT
Please make sure if you do make something change folder names and paths and especially dont use Thromp_ anywhere make a TAG for you ;)
It will also work on vehicles to a degree too , but better use deform animation instead
I wont have much time now or as much as i would like to play and mess with this game ,this is a brief example of something i made when i read about destruction in some other thread and i leave here for others to maybe learn from it.
Tools i Used
BI tools http://community.bistudio.com/wiki/BI_Tools_2
C4D (demo 40 days)http://www.maxon.net/downloads/demo-version.html
Nitroman4d xbreaker scripts http://nitro4d.com/blog/freebie/xbreaker/
Overview of the download
In the downlaod there is a Binarised PBO and a folder containing the unbinarised model and textures, the idea of the example is to show how you can Hide damage on a part of the model and how you can (A) script a particle effect to the effected area and or (B) config an engine based particle effect to the area affected.
Media/B]
A small video follows to show (badly) a use for such an addon
5_YRFLGbd7c
for visitor please use the LAND_ prefix in usual way and remember script wont init from that model make a module to define the handle your calling there
HOW WHAT WHERE Model
I presume you already know how to make addons altho with this downlaod and this description you can at least make walls for yourself.
So make a box object in C4D and run the xbreaker script , ideally you probably only want the center to break so maybe choose 5 pieces for the script to break it into
then only name and config the sections you want to be destroyed.
Export the model as 3ds and import to the o2 , if you keep the name properties Piece_0-_x in the model then you can recycle my configs and cpp
most of the breaks will allow you to create your geometry very easy bu copy and paste and component convex hull .
finish in the normal way ( see whats in the download mlod) and your done.you could always use this on an existing wall in your own house model and not create a box.
The Example is an OTT example you would never need 40 +pieces in such an object , i did it to create a template more than anything.
HOW WHAT WHERE CPPand cfg
in the Model.cfg we define the Hide animation like this
first we define the bone
"piece_1","",
then we define what we want to do with the bone , in this case Hide it.
class Animations
{
class hit1
{
type="hide";
source="hit1";
selection="piece_1";
minValue = 0;
maxValue = 1;
minphase = 0;
maxphase =1;
hideValue = 0.9;
};
this tells the engine to Hide piece_1 when the value of Hit1 is at 0.9
the way we define Hit1 THE SOURCE is in the CPP like so :
class Hitpoints {
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
The armor = 0.05 is a refference to the Hipotint being .05% of the total armor of the class
The convex component will also hide the Geometry (may not be necessary to name it as the geo lod has it name same anyway)
Visual is old way when Material had a number in 02 on texture and then texture will change so obsolete for this.
Mess with the armor to suit you , geometry weight of model is also another factor here, however the biggest thing when defining here is to remember BIS use a Hit factor radius including an indirect hit radisu , this may affect your results if you set things too light or too heavy , it will certainly effect the precision in many cases i believe
We can add aditonal Config Particles by adding the following to the hipoint
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
[B]class DestructionEffects {
class Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 5;
};
class Dust2 : Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 3;
};
class Dust3 : Dust {
simulation = "particles";
type = "ExploRocksDark";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 1;
};
};
};
Now the model will have particle effect at the point described in position = "piece_1";
to achieve this perfect copy and paste the Piece_1 from the geo lod and place it in the Memory lod and press Shift + D , this will create
one point at the center , sometimes because we have hiddeln Piece_1 the particle can fail so maybe rename this point in memory lod and CPP to piece_1D and position = "piece_1D";
you can also make a ruin model for each piece if you wish by adding the following ( i have no time to show how to config the class ruin sorry, however to config in hitpoint
its like this :
class Hit1 {
armor = 0.05;
material = -1;
name = "piece_1";
visual = "";
passThrough = 0.1;
convexComponent = "piece_1";
class DestructionEffects {
[B]class Ruin1
{
simulation = "ruin";
type = "thromp_example\Ruins\thromp_example_piece_1_Ruins";
position = "dampiece_1";
intensity = 1;
interval = 1;
lifeTime = 1;
};
class Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 5;
};
class Dust2 : Dust {
simulation = "particles";
type = "ExploRocks";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 3;
};
class Dust3 : Dust {
simulation = "particles";
type = "ExploRocksDark";
position = "piece_1";
intensity = 0.1;
interval = 0.01;
lifeTime = 0.01;
size = 1;
};
};
HOW WHAT WHERE Scripted Damage
As well as cpp effect there are many ways to script it , for normal use or cutscene
For adding particles to the model when its damaged (becareful remember this is no matter what damage , not when damaged to 0.9 of 0.05% like defined in the model.cfg and the CPP)
add an eventhandler that is called when damaged simple as so ( shown in example download)
class Eventhandlers {
init = "_scr = _this execVM ""\thromp_example\scripts\init.sqf"";";
dammaged = "_this call thromp_exampledebris;";
};
Init could simply define the thromp_exampledebris and this isnt efficient to init same for every model , pls make a module or something for many models
you can just use a format script for cutscene and use for TOH selectionposdamage .
well i hope you have fun and pls leave any questions , i may have time to come here to answer them but until then :
I hope you have fun and i hope i haven't made your life worse ;)
Thromp
the download is in the spoiler
http://www.mediafire.com/?6eywe9c4ysvag64
Pls feel free to use the Unbinarised things in Any Bis Engine Game only .
there is no permission to use the model scripts and Textures outside of CO A2 and TOH games any sharing of this link without this read me will result in copyright issues and the poster could become liable to any legal issues persued as a result .similarly do not host the download for the same reasons
IMPORTANT
Please make sure if you do make something change folder names and paths and especially dont use Thromp_ anywhere make a TAG for you ;)
IMPORTANT
Please make sure if you do make something change folder names and paths and especially dont use Thromp_ anywhere make a TAG for you ;)