1 registered members (AndrewAMD),
946
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
c_trace with USE_BOX and SCAN_TEXTURE?
#430081
09/23/13 16:02
09/23/13 16:02
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
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...
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?
|
|
|
Re: c_trace with USE_BOX and SCAN_TEXTURE?
[Re: Ch40zzC0d3r]
#430087
09/23/13 18:14
09/23/13 18:14
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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.
|
|
|
Re: c_trace with USE_BOX and SCAN_TEXTURE?
[Re: 3run]
#430088
09/23/13 18:18
09/23/13 18:18
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Extract from my german manual: 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.
|
|
|
Re: c_trace with USE_BOX and SCAN_TEXTURE?
[Re: Ch40zzC0d3r]
#430090
09/23/13 18:41
09/23/13 18:41
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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 Greets
|
|
|
Re: c_trace with USE_BOX and SCAN_TEXTURE?
[Re: 3run]
#430092
09/23/13 19:56
09/23/13 19:56
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
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 Thanks for your time again!
|
|
|
|