Swarm FirstPersonView

From Valve Developer Community
Revision as of 03:14, 3 July 2011 by Prize (talk | contribs) (Created page with "== How to Create First Person View in a Alien Swarm Modification. == See Swarm SDK Create a Mod first. == Code: == ;Changing asw_controls Open this file: ::src\game\shar...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to Create First Person View in a Alien Swarm Modification.

See Swarm SDK Create a Mod first.

Code:

Changing asw_controls

Open this file:

src\game\shared\swarm\asw_player_shared.cpp

First we change the value "1" to "0" in asw_controls otherwise the angle of the mouse will be wrong. (NOTICE: the panels and stuff will NOT work anymore, you have to fix that in asw_in_mouse reset and apply functions)

ConVar asw_controls("asw_controls", "1", FCVAR_REPLICATED | FCVAR_CHEAT, "Disable to get normal FPS controls (affects all players on the server)");
Set the Camera in the First Person View

Open this file:

src\game\client\swarm\clientmode_asw.cpp

search for:

		::input->CAM_ToThirdPerson();

replace with:

		::input->CAM_ToFirstPerson();//	::input->CAM_ToThirdPerson();
Changing the Crosshair to look like a Shooter one.

Open this file:

src\game\client\swarm\vgui\asw_hud_crosshair.cpp

and change the number in this entry to 0

ConVar asw_crosshair_use_perspective("asw_crosshair_use_perspective", "1", FCVAR_CHEAT, "Show the crosshair that has perspective or the old version?");


Fixing Shootposition
src\game\shared\swarm\asw_marine_shared.cpp

search for

Vector CASW_Marine::Weapon_ShootPosition( )

and replace the whole function with this:

	return EyePosition();


Fixing Shootposition
src\game\shared\swarm\asw_marine_shared.cpp

search for

Vector CASW_Marine::Weapon_ShootPosition( )

and replace the whole function with this:

	return EyePosition();



Thats it :-)

(NOTICE:You just have to fix the Shootpositions in some weapons!)

More information