Data Realms Fan Forums
http://868000.nnhp.asia/

[SOLVED - DELETE ME!] Custom Key Bindings?
http://868000.nnhp.asia/viewtopic.php?f=72&t=15496
Page 1 of 1

Author:  superking208 [ Mon Jun 22, 2009 10:22 pm ]
Post subject:  [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.

Author:  ProjektTHOR [ Mon Jun 22, 2009 10:25 pm ]
Post subject:  Re: Custom Key Bindings?

You realize you can set the key bindings in the Options menu when you load the game, right?

Just askin'

Author:  superking208 [ Mon Jun 22, 2009 10:48 pm ]
Post subject:  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.

Author:  mail2345 [ Mon Jun 22, 2009 10:54 pm ]
Post subject:  Re: Custom Key Bindings?

Oh, just poll UInput and run a command.

Run in something invincible.

Author:  superking208 [ Tue Jun 23, 2009 1:43 am ]
Post subject:  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.

Author:  mail2345 [ Tue Jun 23, 2009 1:45 am ]
Post subject:  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.

Author:  superking208 [ Tue Jun 23, 2009 1:48 am ]
Post subject:  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?

Author:  mail2345 [ Tue Jun 23, 2009 2:18 am ]
Post subject:  Re: Custom Key Bindings?

Add to a .lua file, add the line ScriptPath = whereveryouputthefile and repalce the things.

Author:  superking208 [ Tue Jun 23, 2009 2:39 am ]
Post subject:  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.

Author:  mail2345 [ Tue Jun 23, 2009 2:48 am ]
Post subject:  Re: Custom Key Bindings?

The script path line is added to an object.

Author:  superking208 [ Tue Jun 23, 2009 2:53 am ]
Post subject:  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...

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/