|
2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: remove decals from entity ?
[Re: Reconnoiter]
#461673
08/17/16 04:29
08/17/16 04:29
|
Malice
Unregistered
|
Malice
Unregistered
|
http://www.conitec.net/beta/ent_getdecal.htmhttp://www.conitec.net/beta/ent_decal.htmThe thing that comes to mind is using an array. If Particle* p = ent_decal Then maybe
particle* p[2000];
Int part_count =-1;
Int part_max =1999;
Function
{
Part_count +=1;
P[part_count] =ent_decal.....;
/// remove all
For (i=part_count;i>-1; i--)
{
P[i].lifespan =0;
P[i] = NULL;
}
You could use p=ent_getdecal Then use the *p pointer to set the lifespan to 0 P.lifespan =0; Something like
For(i=1;i<50;i++)
{Particle* p=ent_getdecal(Ent,0,i);
P.lifespan=0;
If(p==null)
Break;}
Unless there a system type link for particles like ent_next
Last edited by Malice; 08/17/16 04:55.
|
|
|
Re: remove decals from entity ?
[Re: Reconnoiter]
#461680
08/17/16 09:36
08/17/16 09:36
|
Malice
Unregistered
|
Malice
Unregistered
|
Well maybe ask jcl how ent_getdecal links the Ent and particles. The you could just check -- is decal linked to This ENT then kill it. Also i guess you could cycle a link list of all particles then test If the decal.xyz is inside the ent bbox.. Then kill it. Superku posted about a particles linked-list in ask the devs
|
|
|
Re: remove decals from entity ?
[Re: ]
#461681
08/17/16 10:03
08/17/16 10:03
|
Malice
Unregistered
|
Malice
Unregistered
|
The decal particles would need to hold the ent pointer.The manual says not to change the particles skill_x-z I'd bet one is the Ent pointer. You did say you wanted to kill all the dexals. So it should just be a matter of running a clink looking for the ent pointer. But i see no reason this is better then using the ent pointer in ent_getdecal to kill all of them.
Or why not just limit the lifespan upon creation.
Last edited by Malice; 08/17/16 10:07.
|
|
|
Re: remove decals from entity ?
[Re: ]
#461682
08/17/16 10:14
08/17/16 10:14
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Or why not just limit the lifespan upon creation. , already do that , but I have some fast-firing weaponry/guns in my game, so the decals can increase alot very fast. But good idea about ent pointer connection and jcl.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|