So basically I am creating a mod based of the WC3 map Warlocks and want to implement a mouse control system similar Alienswarm. My mod is based off the 2007 HL2MP engine and up until now I’ve managed to lock the camera to a top down view and make it so you can't look up or down. However no matter what I try (been at it for like 15 hours ) I cannot 'free' the cursor up from being the central crosshair. (Although I did manage once by commenting out the code below, but that let me move the mouse (i think) but had no cursor so I’m not sure)
- Code: Select all
void CInput::ControllerMove( float frametime, CUserCmd *cmd )
{
if ( IsPC() )
{
if ( !m_fCameraInterceptingMouse && m_fMouseActive )
{
MouseMove( cmd);
}
}
JoyStickMove( frametime, cmd);
}
Ultimately i plan to replace above code with code similar to this:
- Code: Select all
Pseudo code:
QAngle angFaceThisWay;
float yawFacethisWay = tan( yGetMousePos() / xGetMousePos() );
angFaceThisWay = QAngle(yawFaceThisWay,0,0);
engine->SetViewAngles( angFaceThisWay );
NOTE: the GetMousePos returns the cursor position relative to the centre of screen in this case.
Anyways, if i could get hints / help / mini-tutorials on how to achieve this 'freeing' of the cursor I would be very grateful as it is a make or break for my mod