--
[ 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, i already tried programming a
functino but somehow it doesn't seem to work and im wondering if i can get any
help from you guys. below will be the list of the codes i've used.
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;
}
}
__________________________________________________________________
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