Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
splat on player skin #155737
09/20/07 17:41
09/20/07 17:41
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline 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
K
KojaK Offline
Member
KojaK  Offline
Member
K

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 Offline OP
User
demiGod  Offline 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: demiGod] #155740
09/22/07 09:48
09/22/07 09:48
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
you could get the nearest vertex, and attach the splat to that in a while loop.
in a c_trace, the manual says this about it:

GET_HITVERTEX When a model is hit, the number of the hit vertex will be returned in the hitvertex variable. Mutually exclusive with USE_AABB.

guess you need to set USE_AABB, instead of USE_POLYGON.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline OP
User
demiGod  Offline 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
K
KojaK Offline
Member
KojaK  Offline
Member
K

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
Re: splat on player skin [Re: KojaK] #155743
09/22/07 14:55
09/22/07 14:55
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Thanks KojaK, i see what you mean, but this is a multiplayer game and when you see other players being shoot you will see the splatter sprite attached but without accuracy, i mean, the effect to be convincent, the splat must adapt to player´s mesh / polygons.

I only can thing of some way to write / PASTE the splat sprite / form into the players skin, at target collision or nearest vertex to the trace ray......




Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1