--
[ Picked text/plain from multipart/alternative ]
hey guys, sending my wall run codes through a different email hopefully they 
dont chalk up my codes again. i fixed the error but however i dont seem to be 
able to do a wall run. how am i able to make it such that when i hit the wall 
run button i would run a certain amount of distance lets say 50units before 
falling or i would fall when i release the button? do note that i put this 
chunk of codes in TryPlayerMove function in gamemovement.cpp

Codes:

Vector EndPoint;
trace_t tr;
if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_SPEED && mv->m_nButtons & 
IN_FORWARD )
{

for(i = 0; i < 2; i++)
EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * 24.0f;

UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY, NULL, 
COLLISION_GROUP_NONE, &tr);

if( tr.fraction < 1.0 ) // There is a wall
{

player->SetMoveType( MOVETYPE_WALL );
}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_FORWARD )
{


for(i = 0; i < 2; i++)
EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * 24.0f;

UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY, NULL, 
COLLISION_GROUP_NONE, &tr);

if( tr.fraction < 1.0 ) // There is a wall
{

player->SetMoveType( MOVETYPE_WALL );

}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_SPEED && mv->m_nButtons & 
IN_FORWARD )
{


for(i = 0; i < 2; i++)
EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * -24.0f;

UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY, NULL, 
COLLISION_GROUP_NONE, &tr);

if( tr.fraction < 1.0 ) // There is a wall
{

player->SetMoveType( MOVETYPE_WALL );

}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_FORWARD )
{


for(i = 0; i < 2; i++)
EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * -24.0f;

UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY, NULL, 
COLLISION_GROUP_NONE, &tr);

if( tr.fraction < 1.0 ) // There is a wall
{

player->SetMoveType( MOVETYPE_WALL );

}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}






Real people. Real questions. Real answers. Share what you know.



__________________________________
Yahoo! Movies - Search movie info and celeb profiles and photos.
http://sg.movies.yahoo.com/
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to