2 registered members (TipmyPip, 1 invisible),
18,789
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
bullet hole decals and error
#286107
08/23/09 04:12
08/23/09 04:12
|
Joined: Jul 2009
Posts: 80 Area 51
fangedscorpion
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 80
Area 51
|
Whenever I try to use a bullet hole decal and create it on an object, I receive an error.
Here is my code: (It is similar to an example in the lite-c manual)
// calculate the target vector VECTOR trace_target; vec_set(trace_target,vector(5000,0,0)); // the weapon has a firing range of 5000 quants vec_rotate(trace_target, camera.pan); vec_add(trace_target, camera.x); // display a red spot at the target position if (c_trace(camera.x,trace_target, IGNORE_PASSABLE | USE_POLYGON| SCAN_TEXTURE) > 0) // hit something? draw_point3d(hit.x,vector(50,50,255),100,3);
// fire and then place a decal at the hit position if (key_ctrl) // fire { PARTICLE* p = ent_decal(you,bmMark,you.x, you.y); // place a random sized decal at the hit entity p.lifespan = 80; wait(-0.5); // reload }
What is wrong with the code?
Also, does anyone know how to make a bullet hole decal on the object more easily?
Last edited by fangedscorpion; 08/23/09 17:48.
"Pow! You are dead! Not big suprise!" -Heavy
|
|
|
Re: bullet hole decals and error
[Re: fangedscorpion]
#286438
08/25/09 10:37
08/25/09 10:37
|
Joined: Aug 2008
Posts: 482
bart_the_13th
Senior Member
|
Senior Member
Joined: Aug 2008
Posts: 482
|
Well, I think ent_decal only work on Commercial version and above But that you pointer in
PARTICLE* p = ent_decal(you,bmMark,you.x,you.y);
could be NULL and that will generate error..(No such thing as NULL.x) How about using
PARTICLE* p = ent_decal(you,bmMark,8, random(360));
Last edited by bart_the_13th; 08/25/09 10:39.
|
|
|
Re: bullet hole decals and error
[Re: MMike]
#323510
05/14/10 23:40
05/14/10 23:40
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Setting the material to null is not a good idea. PNG is even not the greatest idea. You should use .bmp, .tga or .dds. What exactly is the error message you're getting?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|