--
[ Picked text/plain from multipart/alternative ]
Hey guys, i'm trying to create a wall run feature in my mod and was wondering
if i can get some help on how to get it done. The problem im getting now is
that when i run across the wall i get stuck at the same level as the level of
the wall is and i move around at that level and i cant drop. its as if i'm
floating around.
below will be the list of the codes i've used. If i could get any help it
would be greatly appreciated since i'm having quite a fair bit of problem with
getting this to work properly...
i defined MOVETYPE_WALL as
case MOVETYPE_WALL:
FullWalkMove();
break;
//--------that chunk of codes below is in the TryPlayerMove function in
gamemovement.cpp---------------//
Vector EndPoint;
trace_t tr;
if( 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
{
//Wall Running
player->SetMoveType( MOVETYPE_WALL );
}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( 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
{
//Wall Running
player->SetMoveType( MOVETYPE_WALL );
}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( 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
{
//Wall Running
player->SetMoveType( MOVETYPE_WALL );
}
else
{
// no wall
mv->m_nOldButtons |= IN_JUMP;
return false;
}
}
if( 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
{
//Wall Running
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! Singapore Answers
Real people. Real questions. Real answers. Share what you know at
http://answers.yahoo.com.sg
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders