| Author | Message | 
        
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   [SOLVED - DELETE ME!] Custom Key Bindings?Alas, I come to you for assistance once again, though not for a problem with Cortex Command, but a question for anyone that knows their way around this console:Is there a console command for CC like the Source Engine's [bind <key> "command"]?
 If you don't know what I'm talking about I can get a screenshot from Half-Life 2 or something.
 
 Thanks in advance.
 
 
 
    							Last edited by superking208 on Tue Jun 23, 2009 3:02 am, edited 1 time in total. 
 
 | 
		
			| Mon Jun 22, 2009 10:22 pm | 
					
					       | 
	
	
		|  | 
	
			| ProjektTHOR Banned 
					Joined: Tue Feb 27, 2007 4:05 pm
 Posts: 2527
   |   Re: Custom Key Bindings?You realize you can set the key bindings in the Options menu when you load the game, right?
 Just askin'
 
 
 | 
		
			| Mon Jun 22, 2009 10:25 pm | 
					
					     | 
	
	
		|  | 
	
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   Re: Custom Key Bindings?Yes, but I'm not talking about movement keys and such; I was hoping to bind a console command to a key. 
 
 | 
		
			| Mon Jun 22, 2009 10:48 pm | 
					
					       | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: Custom Key Bindings?Oh, just poll UInput and run a command.
 Run in something invincible.
 
 
 | 
		
			| Mon Jun 22, 2009 10:54 pm | 
					
					   | 
	
	
		|  | 
	
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   Re: Custom Key Bindings?mail2345 wrote: ...poll UInput...Run in something invincible...While I thank you for saving my newbie hide again, I have absolutely no idea what you are talking about.
 
 | 
		
			| Tue Jun 23, 2009 1:43 am | 
					
					       | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: Custom Key Bindings?Code: function Update(self)if UInput:KeyHeld(<repalcewithnumberofkey>) then
 <insertcodehere>
 end
 end
Should do the trick. Key numbers are A = 1, B = 2, Z =26, ect.
 
 | 
		
			| Tue Jun 23, 2009 1:45 am | 
					
					   | 
	
	
		|  | 
	
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   Re: Custom Key Bindings?I'm sorry, I am a complete novice to Lua. How do I use this?EDIT: To clarify, are these console commands, or do I need to save it as an .rte?
 
 
 | 
		
			| Tue Jun 23, 2009 1:48 am | 
					
					       | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: Custom Key Bindings?Add to a .lua file, add the line ScriptPath = whereveryouputthefile and repalce the things. 
 
 | 
		
			| Tue Jun 23, 2009 2:18 am | 
					
					   | 
	
	
		|  | 
	
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   Re: Custom Key Bindings?Now, I'm sure I did it wrong, because it didn't work. I saved 0keys.lua to #Cortex Command#/Base.rte/Scenes/Scripts, just because there are other scripts here.  The contents are as follows: Code: ScriptPath = /Base.rte/Scenes/Scriptsfunction Update(self)
 if UInput:KeyHeld(14) then
 ActivityMan:GetActivity():SetTeamFunds(1000000000,0)
 end
 end
I'm trying to bind that command I asked you about in the other thread to the N key, by the way.
 
 | 
		
			| Tue Jun 23, 2009 2:39 am | 
					
					       | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: Custom Key Bindings?The script path line is added to an object. 
 
 | 
		
			| Tue Jun 23, 2009 2:48 am | 
					
					   | 
	
	
		|  | 
	
			| superking208 
					Joined: Mon Jun 22, 2009 3:16 am
 Posts: 43
   |   Re: Custom Key Bindings?Oh. Wow. I am an idiot. Thank you, I think I've got it now.EDIT: It worked, and though I realized I could just make that object cost negative gold, that doesn't seem to work in multiplayer anyway, so once again: thank you. If a mod reads this, delete this thread! It's an obvious thing that anyone could figure out, and it probably doesn't need to be here...
 
 
 | 
		
			| Tue Jun 23, 2009 2:53 am | 
					
					       | 
	
	
		|  | 
	
	
		|  |