2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
splat on player skin
#155737
09/20/07 17:41
09/20/07 17:41
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
Hi, The gun below shoot paint balls using c_move in a multiplayer environment. When the ball collides with level geometry or static entities (using precise collision detection - my.polygon = on) then ceates a splat in that place and it works all fine. Code:
if (event_type == event_block || event_type == event_entity) { VEC_ADD (TARGET.X, normal.X); you = ent_create ("splat.tga", target.x, PAINT_createSplat); you.scale_x = 0.15; you.scale_y = you.scale_x; you.oriented = on; you.facing = off; you.passable = on; you.flare = on; you.ambient = 50; you.transparent = on; you.alpha = 100; VEC_TO_ANGLE (you.PAN, normal.x); my.passable = on; my.invisible = on; }
Well, the problem is that i want to create the splats also on the moving players models when they are shot, and i cant use my.polygon = on because they will stuck on others entities at movement. What is the best way to this? I´ve searched for pixel_to_bmap and the possibility to write on the players skin, but didnt found a good conclusion yet. Thanks for your time. Cheers
|
|
|
Re: splat on player skin
[Re: demiGod]
#155738
09/21/07 19:48
09/21/07 19:48
|
Joined: Jan 2007
Posts: 110 USA East Coast
KojaK
Member
|
Member
Joined: Jan 2007
Posts: 110
USA East Coast
|
What if you were to tell the splatter the position relative to the target? So that when it hits, it has a position and angle, then all you have to do is make the splatter compute where it should be based on the position and pan of the target entity?
However, you may want to use c_trace with USE_POLYGON, so that you can get an accurate placing.
Last edited by KojaK; 09/21/07 19:52.
Lead programmer for Two Screws Loose
Click here for our forums, and downloads for our games
|
|
|
Re: splat on player skin
[Re: KojaK]
#155739
09/22/07 09:27
09/22/07 09:27
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
The first part you said that´s what i am doing in above code. About use_polygon i allready tried it, but i cant place the splat correctly in the player´s body. Dont think its a good solution, it never assumes the right position and direction. I think it will be needed some write stuff in the skin but my tests didnt work yet. Code:
if(you) { result = c_trace( my.x, you.x, ignore_me + get_hitvertex); ent_bmap = bmap_for_entity(you,0); ent_format = bmap_lock(ent_bmap,0); // get hitvertex UV coord vec_for_uv( uvSkin_vec, you, hitvertex ); // convert to bmap coord uvSkin_vec.x *= bmap_width(ent_bmap); uvSkin_vec.y *= bmap_height(ent_bmap); // just a test here tempSplat = ent_create ("splat.tga", uvSkin_vec.x, PAINT_createSplat); bmap_unlock(ent_bmap); }
But the splat isnt created in the right place.....
|
|
|
Re: splat on player skin
[Re: Helghast]
#155741
09/22/07 13:11
09/22/07 13:11
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
Still doesnt work with splat creation at nearest vertex, its very difficult to place the splat with correct position and orientation, and it never seems to be a splat in the skin, but a sprite attached.. Code:
c_trace( my.x, you.x, ignore_me + get_hitvertex); vec_for_vertex(uvSkin_vec, you, hitvertex); tempSplat = ent_create ("splat.tga", uvSkin_vec.x, PAINT_createSplat);
Still need a solution... Thanks
|
|
|
Re: splat on player skin
[Re: demiGod]
#155742
09/22/07 14:34
09/22/07 14:34
|
Joined: Jan 2007
Posts: 110 USA East Coast
KojaK
Member
|
Member
Joined: Jan 2007
Posts: 110
USA East Coast
|
I saw a thread on this a while back, but it was for arrows sticking out of a person. You have to use ent_rotate to rotate the splatter around the target, and you have to save the position relative to the player. That way you're not using textures and uv's, just some simple number calcluations.
Lead programmer for Two Screws Loose
Click here for our forums, and downloads for our games
|
|
|
|