Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

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...
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?

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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
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.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
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.

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 Offline
Senior Expert
3run  Offline
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 grin


Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

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 laugh
Thanks for your time again!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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