Chaosforge Forum

  • June 17, 2024, 19:39
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Add runmode binding to insert (numpad 0)  (Read 4985 times)

tylor

  • Sergeant
  • *
  • Offline Offline
  • Posts: 63
  • Lost Soul
    • View Profile
Add runmode binding to insert (numpad 0)
« on: February 22, 2013, 08:24 »

I know it can be done by adding ["INSERT"] = COMMAND_RUNMODE, to keybindings.lua (and I did), but I think it should be standard feature.
Usually I move by right hand on numpad, left on f/r/tab, and comma is totally out of place for so often used function.

Also, I think TAB should be not used both for switch targets and running. I end up running by mistake too often. And I don't see how it can be altered by config.
Logged

Evilpotatoe

  • Backer
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 316
  • Lost Soul corpse
    • View Profile
Re: Add runmode binding to insert (numpad 0)
« Reply #1 on: February 22, 2013, 09:35 »

I agree that TAB isn't handy at all, but I think the real improvement would be to add some UI in the game, allowing to bind keys without having to play with config files (and tough, without needing a game restart).
Looks like an important, but low priority feature to me.

For target switching, I don't use it, but indeed, it seems to be on the same function.
Maybe it's possible to call it with a function, like this ?

Code: [Select]
["TAB"] = function()
              player.switch_target();
          end,

I think some coders/modders could answer this.

While I'm at it, is it possible to create a binding like the following ?
Code: [Select]
["3"] = function()
            if not command.quick_weapon('ashotgun') then
                if not command.quick_weapon('shotgun') then
                    ui.msg("No cool weapon :(");
                end
            end
        end,

I looked at what I could in the modding sections of the wiki, but I don't thnik I could find such informations.
Logged
Badges - [26/26/26/22/9/2] - 42/43

thelaptop

  • Chaos Fanatic!
  • Grand Inquisitor
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 2530
    • View Profile
Re: Add runmode binding to insert (numpad 0)
« Reply #2 on: February 22, 2013, 09:37 »

Eh, not everyone has a numpad.  Think laptop users.

As for the possibility of the binding, why not just try it out in your keybindings file?  Be sure to make a copy of your current keybindings before doing it though.
Logged
I computed, therefore I was.

Evilpotatoe

  • Backer
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 316
  • Lost Soul corpse
    • View Profile
Re: Add runmode binding to insert (numpad 0)
« Reply #3 on: February 22, 2013, 09:46 »

Thanks for the suggestion, but I already did... all I managed to do is getting warning because I call non-existing functions, and as I said, I have no idea of where to get documentation about this.

Any tip about this would be appreciated.
Logged
Badges - [26/26/26/22/9/2] - 42/43

Motorheadbanger

  • Sergeant
  • *
  • Offline Offline
  • Posts: 92
    • View Profile
Re: Add runmode binding to insert (numpad 0)
« Reply #4 on: February 23, 2013, 05:28 »

important, but low priority

Wat? :-)
Logged

Simon-v

  • Composer
  • Elder Chaos Guard
  • Captain
  • *
  • *
  • Offline Offline
  • Posts: 272
  • Only Human
    • View Profile
    • The Life and Works of One Simon Volpert
Re: Add runmode binding to insert (numpad 0)
« Reply #5 on: February 23, 2013, 11:50 »

While I'm at it, is it possible to create a binding like the following ?
Code: [Select]
["3"] = function()
            if not command.quick_weapon('ashotgun') then
                if not command.quick_weapon('shotgun') then
                    ui.msg("No cool weapon :(");
                end
            end
        end,

Nope. I tried this with the new beta, and it doesn't work.
Code: [Select]
["1"] = function()
for i, item in pairs{"uscythe", "spear ", "ubutcher", "chainsaw", "knife"} do
if command.quick_weapon(item) then
return true
end
end
ui.msg("You don't have a melee weapon!")
return false
end,
It just aborts after the first one in the list fails. Which is strange, because this works:
Code: [Select]
["SHIFT+M"] = function()
for i, item in pairs{"smed", "lmed"} do
if command.use_item(item) then
return true
end
end
ui.msg("No medpacks left!")
return false
end,
["SHIFT+H"] = function()
for i, item in pairs{"hphase", "phase", "umodstaff"} do
if command.use_item(item) then
return true
end
end
ui.msg("No phases left!")
return false
end,
I call bug. Pity, would've been fun.
Logged

shark20061

  • Programmer
  • Elder Chaos Guard
  • Captain
  • *
  • *
  • Offline Offline
  • Posts: 266
    • View Profile
Re: Add runmode binding to insert (numpad 0)
« Reply #6 on: February 23, 2013, 11:57 »

That's because quick_weapon doesn't return whether or not it works like use_item does.
Logged
Hell Knight Warrant Officer (0.9.9.4)  [26!/8/3/1/0]

Mancubus 2nd Lieutenant (0.9.9.6)  [22/12/3/0/0]
M:16 S:43 (126) A:17

Simon-v

  • Composer
  • Elder Chaos Guard
  • Captain
  • *
  • *
  • Offline Offline
  • Posts: 272
  • Only Human
    • View Profile
    • The Life and Works of One Simon Volpert
Re: Add runmode binding to insert (numpad 0)
« Reply #7 on: February 23, 2013, 12:26 »

That's because quick_weapon doesn't return whether or not it works like use_item does.
That's no good! Will it do that?

A way to suppress the failed wield messages would also help, i suppose.
Logged
Pages: [1]