Removing controls

Grab your favourite IDE and tinker with the innards of game engines

Removing controls

Postby Kretus on Thu Sep 06, 2012 10:00 pm

This might be a bit of a noob question, but I haven't found anything (suprisingly) about this.

I'm just trying to remove the control entries (like "Flashlight - F") from my mod. And then maybe implement another type of control. How exactly do I define a control? I would like to map "F" to a control like "G" is mapped to the grav gun but for a flashlight. The flashlight would become a view model.

I have some c++ experience, and coded some mechanics already, but I couldn't find anything about the controls.

Any help would be appreciated :D
Kretus
Dumpling
Dumpling
 
Joined: Wed Jul 07, 2010 11:06 pm

Re: Removing controls

Postby fishshapedfish on Thu Sep 06, 2012 10:25 pm

It's all about keybinds. For example if you wanted to make f no longer turn the flashlight on you would type: unbind f into the console. You an also makes keys do things, for example I like to make the x key cause the player to die. To make this happen you would type: bind x "kill" into the console. The way to think of this is that all keys are set to trigger console commands and that these binds are recorded in .cfg files (you can find these in the cfg folder of your mod). You can always edit the .cfg files out of the game as well by opening them with notepad.
I hope I helped!
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Re: Removing controls

Postby stoopdapoop on Thu Sep 06, 2012 10:54 pm

Buttons to be used in code are defined in "in_buttons.h"

Buttons displayed in the options menu are defined in "kb_act.lst" found in your mod's scripts folder.

The very beginning of this tutorial might help you a little more.

http://www.interlopers.net/tutorials/29305
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Removing controls

Postby Kretus on Fri Sep 07, 2012 5:55 am

Thanks, this is exactly what I was looking for! :D


Edit: Hmm, if I implement the code from the tutorials, the solutions build fine, but the game crashes without error after the intro movie.

Edit2: Oh boy, I removed the code and the game still crashes. I'm in trouble now :shock:

Edit3 (sorry for all the edits) : Now the "setupArrayProps_R: array prop (null) is at index zero." error is back. Damn it Valve, release the source for 2009 or fix the current situation!
Kretus
Dumpling
Dumpling
 
Joined: Wed Jul 07, 2010 11:06 pm

Re: Removing controls

Postby Gary on Fri Sep 07, 2012 2:38 pm

It's probably your steamappid. Change it to the 2007 base.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Removing controls

Postby Kretus on Sat Sep 08, 2012 1:15 pm

It doesn't work anymore. I tried 218, 420, without AdditionalContentId and with AdditionalContentId...

They all crash without error or with the "setupArrayProps_R: array prop (null) is at index zero." error..

I also implemented the code to mount multiple games, and after that i could work with SteamAppId 420, but now it's giving me nothing but problems.

This gameinfo is correct, right?

Code: Select all
"GameInfo"
{
   game       ""
   title       ""
   title2      ""

   type      singleplayer_only

   FileSystem
   {
      SteamAppId            218   // GCF for Episode 2
      ToolsAppId            211   // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
      AdditionalContentId         420   // Ep2      

      SearchPaths
      {
         Game            |gameinfo_path|.
         Game            |all_source_engine_paths|ep2
         Game            |all_source_engine_paths|episodic
         Game            |all_source_engine_paths|sourcetest
         Game            |all_source_engine_paths|hl2
      }
   }
}


The game does work without any custom code, but doesn't work in any other way with custom code...
Kretus
Dumpling
Dumpling
 
Joined: Wed Jul 07, 2010 11:06 pm

Return to Programming

Who is online

Users browsing this forum: No registered users