Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, howardR, 1 invisible), 777 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
remove decals from entity ? #461664
08/16/16 18:39
08/16/16 18:39
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hello,

Is it possible to remove decals from an entity? It would be nice to have it cause I currently do a check so the decal count doesnt get to high. Being able to remove all current decals would allow me to keep creating new ones when e.g. firing on fairly big targets like walls or floors.

Re: remove decals from entity ? [Re: Reconnoiter] #461673
08/17/16 04:29
08/17/16 04:29

M
Malice
Unregistered
Malice
Unregistered
M



http://www.conitec.net/beta/ent_getdecal.htm

http://www.conitec.net/beta/ent_decal.htm

The thing that comes to mind is using an array.
If Particle* p = ent_decal

Then maybe
Code:
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
Code:
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: ] #461678
08/17/16 09:25
08/17/16 09:25
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Its not perfect since I check max decals per entity but it would be great for a few big models, tnx!

Re: remove decals from entity ? [Re: Reconnoiter] #461680
08/17/16 09:36
08/17/16 09:36

M
Malice
Unregistered
Malice
Unregistered
M



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

M
Malice
Unregistered
Malice
Unregistered
M



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 Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Originally Posted By: Malice
Or why not just limit the lifespan upon creation.
, already do that laugh , 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.


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