Ent_Decal on bone animated models, leaving non-updated decals

Posted By: jumpman

Ent_Decal on bone animated models, leaving non-updated decals - 10/22/16 22:31

Hi, I am using A8 Pro 8.47. I have a youtube video on the bottom as well.

I am placing a blood TGA file onto an animated model entity using the ent_decal code from the manual, but I am running into a glitch. Once in a while, part of the decal will not update, which makes decal polygons float in the air, while the model is animated.

here is the ent_decal code:
Code:
particle_mode = 4;

...

result=c_trace(camera.x,cam_mouse_screen.x,IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT|IGNORE_CONTENT|SCAN_TEXTURE|USE_POLYGON); 	
	

 if (HIT_TARGET) // target hit?
{
         	
if(you==NULL)
{

         	
PARTICLE* p = ent_decal(NULL,test_decal,217+random(3),random(360)); // place a random sized decal at the hit entity 
            p.lifespan = 160;   // remove decal after 100 seconds
            	
}


else

{
				 
PARTICLE* p = ent_decal(you,test_decal,217+random(3),random(360)); // place a random sized decal at the hit entity 
            p.lifespan = 160;   // remove decal after 100 seconds	
				}
 
            
             
         }




Here is the animated entity code:
Code:
action test_animate_simple()
 {
 	
 
 var animsa;
 	
 	while(1)
 	{
 		
 		
 	ent_animate(me,"run",animsa, ANM_CYCLE);
 		animsa+=5*time_step;
 		animsa%=100;
 		
 		
 		wait(1);
 	}
 	
 	
 	
 	
}



Video Example
[video:youtube]https://www.youtube.com/watch?v=0_kLlK1RXFo[/video]
Posted By: 3run

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 09:34

Well, it works perfectly fine for me (with both bone/vertex animated models).
Here is an example for you:
Download link

Best regards.
Posted By: rayp

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 11:34

It does not work if you use different meshes with entaninatefrom.

But without entanimatefrom and one mesh it works correct like 3run said

This bug is known by jcl. I found it. But it seams to complex to remove.

Here u can read more
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=446611#Post446611

Greets
Posted By: jumpman

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 19:47

Hi friends!

@Rayp, Im not using entanimatefrom, but thank you!

@3run Ive played your test level, and ran it with my own model, and it works on your level!

After some tinkering, Ive noticed that if I set the decal to a very large size, say 500, it will cause parts of the decal to float. If I set it to around 150, the decals never glitch. I think it may be an oversize decal problem, if the decal is too big, it exceeds the model bounds(??) and doesnt update these decal polygons. I am not sure though.

" PARTICLE* p = ent_decal(you,test_decal,150,random(360));"

that seems to work!

3run, you can replicate this effect in your test level, by setting the decal size to 800! Then youll see an albiet cool effect, but glitch nontheless!
Posted By: 3run

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 20:00

Yep, it looks like some sort of oversizing glitch, but it only happens with one of the models. Here how it looks like:


Greets.
Posted By: jumpman

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 22:11

hmmm, it does it for both models in my copy of your test level.....
Posted By: 3run

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 22:22

Well, the screen above says opposite grin Anyway, I would recommend you to avoid using such huge numbers like 800 etc for setting sizes... Setting size to 1 means it's actual size 1:1 (as far as I understood), so it's better to have sprites with good resolution and avoid using huge numbers to scale them up. Don't provoke Acknex, you'll end up with unexplainable errors and bugs grin

Greets!
Posted By: jumpman

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/23/16 23:50

LOL will do 3run, thank you friend!
Posted By: jcl

Re: Ent_Decal on bone animated models, leaving non-updated decals - 10/31/16 11:01

I suppose that it is a rounding error due to the extremely large scale. Avoid large scale factors.
© 2024 lite-C Forums