Dear Everyone,
First of all I want to thank:
Spoof - for recommending modifying existing destructible component in apex class
Daimaku - for starting thread that I was also working on and discovering to use only Asset= in the extended version of the apex destructible.
My own contributions to this research were:
1. figuring out how to set the collision on the apex destructible pieces once you shoot the destructible
2. figuring out how to set the exterior and interior materials of the apex to anything you want WHILE in-game.
~~~
What This Code Can Do For You
Using the code I am presenting here, I have succeeded in (with the help of Spoof and Daimaku)
1. Spawning Apex Mesh in Level
2. Shooting mesh with custom class or regular projectiles
3. Having the pieces of apex mesh rebound off of level geometry properly
4. Enabling player to click on a mesh in my level, and then setting the Apex mesh to that new material.
In other words, enabling you to dynamically set the Apex Mesh's materials to anything you want while in-game!
Including the inside parts of the destructible pieces!
5. Ability to set the inside materials of fracture pieces to a DIFFERENT material than the main mesh
~~~
Custom Apex Destructible Class
Again, this class was created with wonderful assistance from Spoof and Daimaku
~~~
Spawning the Apex Destructible
~~~
Dynamically Loading Materials to Set to Apex Mesh
Please see this tutorial of mine as to how you can dynamically load different materials.
http://forums.epicgames.com/threads/...While-In-Level
This is how I enable player to click on one mesh with one material and set the apex mesh to that material.
~~~
Using Custom Projectiles to Shoot Apex Mesh
You have to tell the Apex engine to recognize your custom class projectiles as able to do damage and impart momentum to ALL apex destructibles, this is not specific to any 1 apex destructible
1. Go into UDK
2. click All Assets
3. do a filter for apex
4. Find the Apex Destructible Damage Parameters
5. Double click on it and add a new element (green + sign)
6. set the Name to be the name of your class, just the name itself
7. set the values, make sure the momentum is something like 2000 or so
8. Set base damage to something like 100 and radius to something like 50
9. SAVE THE APEX PACKAGE by right clicking on the thing you just edited and click save
~~~
Have fun spawning apex meshes in your level and setting the materials any time you want!
♥
Rama
PS: Please post if you find this code useful so others find it easily too!
First of all I want to thank:
Spoof - for recommending modifying existing destructible component in apex class
Daimaku - for starting thread that I was also working on and discovering to use only Asset= in the extended version of the apex destructible.
My own contributions to this research were:
1. figuring out how to set the collision on the apex destructible pieces once you shoot the destructible
2. figuring out how to set the exterior and interior materials of the apex to anything you want WHILE in-game.
~~~
What This Code Can Do For You
Using the code I am presenting here, I have succeeded in (with the help of Spoof and Daimaku)
1. Spawning Apex Mesh in Level
2. Shooting mesh with custom class or regular projectiles
3. Having the pieces of apex mesh rebound off of level geometry properly
4. Enabling player to click on a mesh in my level, and then setting the Apex mesh to that new material.
In other words, enabling you to dynamically set the Apex Mesh's materials to anything you want while in-game!
Including the inside parts of the destructible pieces!
5. Ability to set the inside materials of fracture pieces to a DIFFERENT material than the main mesh
~~~
Custom Apex Destructible Class
Again, this class was created with wonderful assistance from Spoof and Daimaku
Code:
class JoyfulDestruction extends ApexDestructibleActorSpawnable placeable; //Call this after you have created the Apex Destructible function joyfulSetMaterial(Material outside, Material inside) { if (outside == None || inside == None) { `log("joyfulSetMaterial: sent invalid materials"); return; } StaticDestructibleComponent.SetMaterial(0, outside); StaticDestructibleComponent.SetMaterial(1, inside); } defaultproperties { //thank you Spoof! Begin Object name=DestructibleComponent0 //change to your asset, look up entire path of your APEX by going into UDK //right click on your APEX and get the full name, copy into your code Asset = ApexDestructibleAsset'JoyfulPackage.Destruction.CubeCutOut256' //sets collison/colliding on fracture pieces of Apex mesh //I looked this up in Engine/ActorFactoryApexDestructible.uc //and added "RB" to front of "CollideWithChannels" RBChannel=RBCC_EffectPhysics RBCollideWithChannels={( Default=TRUE, BlockingVolume=TRUE, GameplayPhysics=TRUE, EffectPhysics=TRUE )} End Object }
Spawning the Apex Destructible
Code:
local JoyfulDestruction d; local Material m; //replace with your material, look up full path in UDK //same way as above for Apex mesh m = Material'JoyfulPackage.DestructionMaterials.Blackrock02_destructionmat'; //be sure to replace the your. with whatever //vectors or Actor you want to use d = Spawn(class'JoyfulDestruction',,, your.Location,your.Rotation); //change second m to something else to have different inside //fracture material d.joyfulSetMaterial(m, m); //yay! //debug info `log("apex mesh created and materials set");
Dynamically Loading Materials to Set to Apex Mesh
Please see this tutorial of mine as to how you can dynamically load different materials.
http://forums.epicgames.com/threads/...While-In-Level
This is how I enable player to click on one mesh with one material and set the apex mesh to that material.
~~~
Using Custom Projectiles to Shoot Apex Mesh
You have to tell the Apex engine to recognize your custom class projectiles as able to do damage and impart momentum to ALL apex destructibles, this is not specific to any 1 apex destructible
1. Go into UDK
2. click All Assets
3. do a filter for apex
4. Find the Apex Destructible Damage Parameters
5. Double click on it and add a new element (green + sign)
6. set the Name to be the name of your class, just the name itself
7. set the values, make sure the momentum is something like 2000 or so
8. Set base damage to something like 100 and radius to something like 50
9. SAVE THE APEX PACKAGE by right clicking on the thing you just edited and click save
~~~
Have fun spawning apex meshes in your level and setting the materials any time you want!
♥
Rama
PS: Please post if you find this code useful so others find it easily too!
Comment