# help! how to making blood splater that sticks to the normal of a face ?

or better raps around/gets cut if it hits an edge

ps it is for a paint ball fps so by blood i mean paint

Goran made a tutorial for this.

I think this would be of your interest:
Ball Splat

thanks that is cool but i am looking for something ezyer
or/also it would be good if i can just download the py cos my net is slow and i cant see much at 200p or what ever

Iām almost sure that is the easiest way to do it

i dont know anything about programing but something like a ray? that makes a plane with it as a texture to the normal of the face it hits and if part of the face in near a edge than it will be cut and repeat the first part (moving the same way as the shot maybe with less speed so it falls) and maybe smuggling around the edge so there is not a seam or something
at least that is how i would do it if i could

for now i would just be happy for it to stick to the normal of the face

Goran also has done a Ray Sensor tutorial. I think this is what you are looking for. Just add a paint texture to the plane.

cool thanks but is there any way i can download the py

Could I help you with posting a blend with a similar exercise?

ok thanks

Hi red566,

I give you two examples of how you could do it, depending on what is required. In the first blend a Ray Sensor is used on the āBulletā object to get the position where the Ray hits the face of the wall and to get the orientation of that face. But this will only check faces of objects in one direction, in this case the local Y-axis, the same direction of the bullet.

To make it more accurate Goran suggested in his Ball Splatt Tutorial to use the ārayCastā method in 6 directions: x, y, z, -x, -y, and -z. Whenever a face is hit, a āSplatā object is added and it will inherit the position and the orientation of that face.

To make it more interesting Iāve added a sequence of āPopā objects, which represent the braking apart of the āBulletā object. One foot-note though: as the bullet pops the fragments may interfere with the rays, causing the splat to inherit their positions and orientations. There may be another way around this, but for now Iāve just set the lifetime of the fragments to 5, so they virtually donāt have a chance to be detected by the rays.

I strongly recommend you to learn Python for the Blender Game Engine. Itās not so complicated as it might seem. A year ago I didnāt know anything, but now I can manage, especially thanks to the Blender community. Hope this could help you a bit. Donāt forget to read the Comments.txt in Text Editor.

PS:

I donāt know how to remove overlapping texture yet so Iāve requested Goran to do his next tutorial on this.

### Attachments

Paintball0.blend (85.7 KB)Paintball1.blend (91.7 KB)

cool thanks
if you want you can help with the game it is a PG MP FPS sort of like Quake but with paint ball guns and robotic cubes as the players

I can help you to a certain degree, making exercises like this, so you could implement it in your game and also learn how to do it yourself. Iām a beginner myself, so It will be good to keep posting your questions on the forum. :yes:

Okay, so here is the next step. Iāve made a setup for the player with grip and resistance control. On ice you can go a little faster, but itās very slippy. In snow you will go slower as normal but itās slippier than dirt. Dirt is a little slippier than normal, but you can go a bit faster as well. And grass is grippier as normal.

Every āfloorā object has to have a property named after the items in āfloorPropā. If not, it will considered to be normal. The āfloorGripā values resemble the friction levels of the āfloorā objects multiplied by ten. So the friction level of objects with no āfloorPropā should be set to 1.0 to get the wanted result. Also beware to always arange the āfloorPropā list so that it is ascending in the right order. Else the player will choose ice over snow when detecting both properties at the same time (on transitions). This causes problems on transition because of friction with the colliding āfloorā object. This is also why I chose a radar sensor and not a ray sensor (collision child works also). This way Iām able to select the one over the other.

Iāve added joystick controls and to the keyboard controls Iāve added a āwall jumpā and āfast motionā, as well as left and right movement and mouse turn. The wall jump is not optimal yet. It works only on planes. When wall jumping on solid meshes āalignAxisToVectā seems to lack, messing up the playerās orientation. I donāt know why, so if anyone knows how to fix this Iāll appreciate it.

The splatter images are random and randomly oriented. They are stacked on top of eachother so thereās no overlapping texture. But no fix on overlaps on edges though.

Of course this is just a basic setup without actions so the code must be clear to some extent. I hope Iāve documented it well.

Feedback is more than welcome, especially when the code could be better. Enjoy and try to shoot the boxes.

EDIT: wall jump is fixed, movement fix, replaced the blend

### Attachments

Paintball2.blend (151 KB)

YOU ARE THE MAN
what v of blender are you useing ? i when ever i move the mouse or something you spin around on a angle

Okay, it might had to do with some excessive tabbing in the script. Iāve replaced the blend again. :o It works on the official 2.63a release, the second 2.64 test build and the latest build on BuildBot.org. By the way, I would recommend you to use the one on BuildBot to make your game because you also have the option to use Sun lamp Buffer Shadows. This is ideal for outdoor scenes. When (vertex) parented to the player, youāll only need one lamp for everything within a radius from the player. When the Buffer Size set to 10240 and the Frustum Size between 100 and 200 you donāt really notice the shadows emerging in the distance. Hereās the same blend for the BuildBot build.

PS: I guess the structure of the code could be better. So beware that this is not the best way to do it. But Iāve failed to rewrite it with a better structure. Problems occur with the wall jump, so for now Iām leaving it as it is.

### Attachments

Paintball3.blend (152 KB)

Hi red566,

I donāt know if this is the kind of walljumping you had in mind. Rays are cast in all four directions locally. Iāve added a parameter āwJmpā, a list of three values. With the first two you can change the lengths of the rays on the left/right and the front/back, the third value determines the speed of the turning of the forward walljump. I also quickly set up a camera. If you need any changes then I suggest you make a design of the Player Mesh or write out a description. Then I get a better idea what you want exactly. As you can see there are no actions for the front and back walljumps. I donāt even know if you will be using them.

Have fun

### Attachments

Paintball4.blend (156 KB)

Is it possible to make blood splat in uv image?
not just put other object on top but paint in texture of object that get blood splat on.

It may be possible, I donāt know. But I guess not. Maybe someone else can tell you for sure.

I think it would also be to hard. I think, to accomplish something like that you need to generate an UV map for every single object you hit, and in some way you need to determine the UVās vertex coordinates in relation to the point of impact.

But there is some good news. When using planes it should be possible to fit the vertexes of the plane to the geometry beneath and than also changing the UV vertex coordinates accordingly, so you get rid of that overlapping texture. But I didnāt find the right components for that script yet. And as Iām working on it Iām getting help from an experienced Blender user. I Hope to finish something within a couple of weeks.

It is possible. You would need to use the bge.texture module to change the texture of the object, replacing it with data from the blood texture.