c_trace with USE_BOX and SCAN_TEXTURE?

Posted By: Ch40zzC0d3r

c_trace with USE_BOX and SCAN_TEXTURE? - 09/23/13 16:02

Hey guys!
For my game I have to scan the texture my soldier is standing on with his bbox, so I have to use USE_BOX together with SCAN_TEXTURE which doesnt work (Manual says that). Thats the reason why I tried to perfom 2 traces, but my second trace doesnt always hit because its near an edge...
Code:
if(c_trace(vector(pLocal.x, pLocal.y, pLocal.z+50), vector(pLocal.x, pLocal.y, pLocal.z-50), USE_BOX|IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_PASSENTS))
{
	if(c_trace(vector(hit.x, hit.y, hit.z+10), vector(hit.x, hit.y, hit.z-10), IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_PASSENTS|SCAN_TEXTURE))
	{
		//Do some code
	}
}



Does someone have an Idea how to rotate the second trace vector so I will hit the edge of the object?
Posted By: 3run

Re: c_trace with USE_BOX and SCAN_TEXTURE? - 09/23/13 18:14

Originally Posted By: Ch40zzC0d3r
I have to use USE_BOX together with SCAN_TEXTURE which doesnt work
Why it doesn't work?? It always used to work for me.
Posted By: Ch40zzC0d3r

Re: c_trace with USE_BOX and SCAN_TEXTURE? - 09/23/13 18:18

Extract from my german manual:
Quote:
Fragt Texturnamen, Vertexnummer, Flags, Helligkeit und Lichtfarbe der getroffenen Oberfläche ab. Kann nicht gleichzeitig mit USE_BOX verwendet werden. Der vordefinierte String tex_name und die Variablen hitvertex, tex_flag1..tex_flag8, tex_light, tex_color und tex_fog werden in Abhängigkeit vom getroffenen Objekt modifiziert (s.u.). Wurde nichts getroffen, werden tex_name und die anderen Parameter nicht gesetzt. Der Texturname lässt sich zum Prüfen der Bodenbeschaffenheit unter einer Entity verwenden.


The problem ingame is that it returns for my models (with POLYGON flag) always the same texturename and not the one Im standing on, but it works fine for blocks.
Posted By: 3run

Re: c_trace with USE_BOX and SCAN_TEXTURE? - 09/23/13 18:41

Well, as I've said before, it works for me, but it doesn't return the second skin of the model (always the first one), here is a demo:
Download link

Screenshot:





Edit: plus, the name of the texture, is returned with capital letters for level blocks, and lowercase for models...
And maybe not returning the second skin of the model is a bug, let's hope it's not grin


Greets
Posted By: Ch40zzC0d3r

Re: c_trace with USE_BOX and SCAN_TEXTURE? - 09/23/13 19:56

Thanks for the demo this is what I exactly meant!
I was under pressure before and couldnt write that much.
The problem is that my model consists out of 3 or more different parts and I would like to hear wooden footsteps when Im walking on wood etc.
Would be awesome if it would return the actual texturename like with a single c_trace laugh
Thanks for your time again!
© 2024 lite-C Forums