I am trying to creat a player for my MP game. I have several problems. The one I am trying to fix has to do with tracing.

I want the players to only spawn at certain areas (not in the trench or on top of the hill). To do this, I created several invisible and passable blocks and applied the earthtile texture to them. I do a trace, and it doesn't work. The game gets stuck in an endless loop.

When I use breakpoint, it tells me that it never finds this: if(str_stri(tex_name,"earthtile") != FALSE). Any help would be greatly appriciated. I have the same problem when I try to spawn ammo, because it uses similar coding.

function create_player()
{
var position_found = FALSE;

while (position_found == FALSE)
{
// get random start vector around center of level
vecFrom.x = -3900 + random(7800);
vecFrom.y = -4000 + random(8000);
vecFrom.z = 200;

vec_set(vecTo,VecFrom);
vecTo.z = -200;

trace_mode = USE_BOX + SCAN_TEXTURE;
TRACE(vecFrom,vecTo);

// check for floor texture, if floor create entity
if(str_stri(tex_name,"earthtile") != FALSE)
{

vec_set(temp_loc,vecTo);
temp_loc.z = target.z + 35;

// create player's entity depending on profession
if (profession_ID == PROF_BAD_USA)
{
player = ent_create(str_BAD_USA,temp_loc,move_USA);
}

if (profession_ID == PROF_BAD_UK)
{
player = ent_create(str_BAD_UK,temp_loc,move_UK);
}

if (profession_ID == PROF_BAD_CHINA)
{
player = ent_create(str_BAD_China,temp_loc,move_China);
}
position_found = TRUE; // found floor to create player on
}
wait(1);
}
}

Last edited by khanoftruth; 10/28/06 20:54.

The Galvanic Productions Hompage: www.GalvanicProductions.tk For our current project, click on the Nirvana link.