View unanswered posts | View active topics It is currently Fri Apr 26, 2024 2:52 pm



Reply to topic  [ 11 posts ] 
 [SOLVED - DELETE ME!] Custom Key Bindings? 
Author Message
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post [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
Profile YIM WWW
Banned
User avatar

Joined: Tue Feb 27, 2007 4:05 pm
Posts: 2527
Reply with quote
Post 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
Profile YIM
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post 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
Profile YIM WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Custom Key Bindings?
Oh, just poll UInput and run a command.

Run in something invincible.


Mon Jun 22, 2009 10:54 pm
Profile
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post 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
Profile YIM WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post 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
Profile YIM WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post 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/Scripts
function 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
Profile YIM WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Custom Key Bindings?
The script path line is added to an object.


Tue Jun 23, 2009 2:48 am
Profile
User avatar

Joined: Mon Jun 22, 2009 3:16 am
Posts: 43
Reply with quote
Post 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
Profile YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.096s | 17 Queries | GZIP : Off ]