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 :stuck_out_tongue:

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 :stuck_out_tongue:
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 :confused:

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 :smiley: 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 :smiley:
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 :smiley:
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.