Game Development Community

Create a successful bullet hit bleeding.

by Szzg007 · in Torque 3D Professional · 01/05/2012 (7:53 am) · 43 replies

First one..I need thanks for Frank carney and Michael Hall help me.here.
www.garagegames.com/community/forums/viewthread/129268

make new a Particle..

datablock ParticleData(bloodBulletDirtSpray)
{
   textureName          = "art/shapes/particles/FXpack1/dirt";
   dragCoefficient      = "0.667";
   gravityCoefficient   = "0";
   lifetimeMS           = "250";
   lifetimeVarianceMS   = "0";
   spinRandomMin = -120.0;
   spinRandomMax =  120.0;
   useInvAlpha   = true;
   
   colors[0]     = "0.590551 0 0.00787402 1";
   colors[1]     = "0.992126 0 0.015748 1";
   colors[2]     = "0.322835 0 0.00787402 0.291339";

   sizes[0]      = "0.299091";
   sizes[1]      = "0.799609";
   sizes[2]      = "1.19941";

   times[0]      = 0.0;
   times[1]      = "0.494118";
   times[2]      = 1.0;
   animTexName = "art/shapes/particles/FXpack1/dirt";
   
};
datablock ParticleEmitterData(bloodBulletDirtSprayEmitter)
{
   ejectionPeriodMS = "5";
   periodVarianceMS = "0";
   ejectionVelocity = "5";
   velocityVariance = "5";
   thetaMin         = "0";
   thetaMax         = "360";
   particles = "bloodBulletDirtSpray";
   gravityCoefficient = "3.99756";
   lifetimeMS = "10";
   lifetimeVarianceMS = "0";
   spinRandomMin = "-140";
   spinRandomMax = "140";
   useInvAlpha = "1";
   blendStyle = "NORMAL";

};

and add New decaldata
datablock DecalData(bloodDecalData)
{
   Material = "YoubloodMaterial";
....
};
Find game/scripts/server/player.cs
function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
//add effectFX for here...
//do decals
   %Decalposition = VectorAdd(getRandom(-1, 1) SPC getRandom(-1, 1) SPC "0", %obj.getPosition()); 
   %normal = "0.0 0.0 1.0";
   %decalObj = decalManagerAddDecal(%Decalposition, %normal, getRandom(360), getRandom(2), bloodDecalData, false);
   //do decals
   %particles = new ParticleEmitterNode() 
   {
      position = %position;
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "bloodNodeData";
      emitter = "bloodBulletDirtSprayEmitter";
      velocity = "1";
   };
   MissionCleanup.add(%particles.schedule(1000, "delete"));
   
//..... other code...
Show is here..
i461.photobucket.com/albums/qq338/szzg007/screenshot_001-00002.png
Page«First 1 2 3 Next»
#41
07/11/2013 (5:00 am)
thought you might have, wasn't sure though.

I mainly use AFX for any effects as it seems more flexible and clears down better than stock. So I'll probably investigate that route.

Non AFX .. I guess you could mount them to parts of the body, if you have hit areas, so if they get hit on an arm, leg etc As a trial you could probably mount it to your weapons mounting point and offset it without making too many changes.

Let me know how you get on and I'll see what I can do this end. Unfortunately mine needs to also be networked!
#42
07/11/2013 (9:33 am)
Just to point out about packetSize and the such, it's hardcoded to max out automatically to 32bit 1024 in singleplayer mode.
#43
07/28/2013 (4:45 am)
I ported the 1.2 project to 3.0 and the issues were gone. No clue what caused it really. It became less important... So... thanks @all for your help!
Page«First 1 2 3 Next»