okay so i did a little test , i created a block ,set it passable , applied a texture "grey" to it
then i assigned the test action script to a object (dont have time to create a player) and used
the camera to trace from.

now here comes the catch with that c_trace approach , the trace hits the surface and when
the surface is hit , the tex name is retrieved , if you are inside of the block there will be NO HIT
and it wil not help .

like i suggested , use a region or min max sizes ,so that you can detect when the player ,like its
center point or something is INSIDE the area ,or whatever other event detection /code/flags stuff you think up .

here is the code i used to test it , now fly around and see for yourseld that , the trace will work
only when you are above the surface of the block because i you are tracing down against the surface here

Code:
#include <acknex.h>
#include <default.c>

action test()
{
	while(1)
	{
		if(c_trace(camera.x,vector(camera.x,camera.y,camera.z-1000),IGNORE_ME | SCAN_TEXTURE))
		{
			if(str_cmpi(hit.texname,"grey"))
			{
				DEBUG_VAR(1,100);
			}
			else DEBUG_VAR(0,100);
		}
		
		wait(1);
	}
}

function main()
{
	warn_level = 4;	
	def_move();
	level_load("1.wmb");
}



for example try a c_intersect approach

Last edited by Wjbender; 07/01/15 11:47.

Compulsive compiler