Game Development Community

Paintball gun effect?

by Arko · in Torque 3D Beginner · 12/17/2012 (2:16 am) · 10 replies

I am trying to make my guns splatter paint when they hit an opponent. Basically just that if they hit someone, a certain color would appear where the bullet hit (this is for a paintball type game).

I searched around and someone did it once but as far I can see, they didn't make a resource.

Anyone know a simple way to do this?

Thanks

#1
12/17/2012 (4:56 am)
Use decals.
#2
12/17/2012 (6:50 am)
Open the Lurker or Ryder datablocks and look at the projectile data - just replace the decals with your own. You're going to want to look in the art/datablocks/weapons folder for those.
#3
12/17/2012 (11:28 am)
Decals.

Your projectile assigns a decal to display once the projectile hits an ojbect. The projectile also says what explosion to play.

A decal will need a DecalData datablock, which the editor saves to art/decals/managedDecalData.cs. Alternatively you could place the new datablock somewhere of your choosing. Here is an example, note that there are addditional fields depending on whether you use a single image or an image array for multiple decal images chosen at random:
datablock DecalData(GreenSplatDecal)
{
   Material = "DECAL_splat";
   size = "2.0";
   lifeSpan = "50000";
};

A materials.cs script is usualy saved in the directory of your source image, in this case art/decals/materials.cs. The material will define the properties of specular, normal maps, whether it glows, transparency, etc. Here is an example material for the above decal, note that you will have to supply the image:
singleton Material(DECAL_splat)
{
   translucent = true;
   translucentBlendOp = None;
   translucentZWrite = true;
   alphaTest = true;
   alphaRef = 84;
   mapTo = "splat02.png";
   diffuseMap[0] = "art/decals/splat02.png";
   materialTag0 = "Decals";
};

i167.photobucket.com/albums/u143/heretek/torque/screenshot_006-00001-1-1.png
#4
12/17/2012 (12:18 pm)
I think Arko is looking for splat effects on characters, which decal projectors will not provide. I'd suggest a method if I knew of one!
#5
12/17/2012 (12:52 pm)
Szzg007's thread has some discussion on blood splatter that might have a lead or two - haven't read it all.
#6
12/18/2012 (9:26 am)
The Store is offering free Decals, you could look into those. But M.H is spot on.
#7
12/18/2012 (11:32 am)
This also solves the issue if it helps at all.
www.garagegames.com/community/forums/viewthread/129268
#8
12/20/2012 (1:24 am)
Thanks guys, got it working as far as appearing on models, not on other players yet but that's okay, it's pretty good as it is.
#9
12/20/2012 (4:28 pm)
Players are filtered against decals (or I guess NOT filtered FOR decals) so you'll need to track it down and make an engine change for that.
#10
12/21/2012 (2:14 am)
there have been a few threads about this over the years, searching "player decal" brings up at least 5 results.
some have solved it, I would love to know how.