• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

New movements

Radseq

New Member
Joined
Sep 7, 2014
Messages
13
Reaction score
1
Hello again
I just change default movements to better one (in my opinion)
i mean enable default WDSA, so its simple now you can rotate by left shift+W or shift+a etc.
and if you want to message somethink you must press enter (chat is enable),
when you press enter again to send message chat is disabled(to enable WDSA)
in npc chat this doesn't work, so you can easly write everythink without pressing enter every time
I Suggest to press tab when you end talking with npc

THIS CHANGES GIVE YOU PLAY WITHOUT USING ARROWS!!

so, to change movement to better one(again in my opinion)
go to \modules\game_console\console.lua
change
Code:
g_keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel)
to
Code:
g_keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() disableChat() end, consolePanel)
and replace old function enableChat()
to
Code:
function enableChat()
  local gameInterface = modules.game_interface

  consoleTextEdit:setVisible(true)
  consoleTextEdit:setText("")

  g_keyboard.unbindKeyUp("Space")
  g_keyboard.unbindKeyUp("Enter")
  g_keyboard.unbindKeyUp("Escape")

  gameInterface.unbindWalkKey("W")
  gameInterface.unbindWalkKey("D")
  gameInterface.unbindWalkKey("S")
  gameInterface.unbindWalkKey("A")

  gameInterface.unbindWalkKey("E")
  gameInterface.unbindWalkKey("Q")
  gameInterface.unbindWalkKey("C")
  gameInterface.unbindWalkKey("Z")

  local quickFunc = function()
  local npcTab = consoleTabBar:getTab('NPCs')
  local message = consoleTextEdit:getText()

  local curTab = consoleTabBar:getCurrentTab()
    if npcTab and curTab == npcTab then
      --if #message == 0 or #message == 'bye' then
         --g_game.closeNpcChannel()
      --end
       return
    end
    consoleToggleChat:setChecked(true)
    disableChat()
  end

  g_keyboard.bindKeyUp("Enter", quickFunc)

  consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
end
then replace default function disableChat()
to
Code:
function disableChat()
  local gameInterface = modules.game_interface

  consoleTextEdit:setVisible(false)
  consoleTextEdit:setText("")

  gameInterface.bindWalkKey("W", North)
  gameInterface.bindWalkKey("D", East)
  gameInterface.bindWalkKey("S", South)
  gameInterface.bindWalkKey("A", West)

  gameInterface.bindWalkKey("E", NorthEast)
  gameInterface.bindWalkKey("Q", NorthWest)
  gameInterface.bindWalkKey("C", SouthEast)
  gameInterface.bindWalkKey("Z", SouthWest)

  local quickFunc = function()
    if consoleToggleChat:isChecked() then
      consoleToggleChat:setChecked(false)
    end
    enableChat()
  end
  --g_keyboard.bindKeyUp("Space", quickFunc)
  g_keyboard.bindKeyUp("Enter", quickFunc)
  --g_keyboard.bindKeyUp("Escape", quickFunc)

  consoleToggleChat:setTooltip(tr("Enable chat mode"))
end
then in function addTab(name, focus)
add
Code:
enableChat(false)
after
Code:
consoleTabBar:selectTab(tab)
then go to function addPrivateText(text, speaktype, name, isPrivateCommand, creatureName)
add
Code:
enableChat()
after
Code:
focus = true

next go to file \modules\game_interface\gameinterface.lua
add
Code:
  g_keyboard.bindKeyPress('Shift+W', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel)
  g_keyboard.bindKeyPress('Shift+D', function() g_game.turn(East) changeWalkDir(East) end, gameRootPanel)
  g_keyboard.bindKeyPress('Shift+S', function() g_game.turn(South) changeWalkDir(South) end, gameRootPanel)
  g_keyboard.bindKeyPress('Shift+A', function() g_game.turn(West) changeWalkDir(West) end, gameRootPanel)
before
Code:
g_keyboard.bindKeyPress('Ctrl+Up', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel)

this is it, now you can play using WDSA thats makes easy using macros F1,F2....
and easy rotate character when press shift by left little finger.

I belive this changes make you better life!!!
 
Last edited:
To have it disabled by default just edit in function addTab(name, focus)
From:
Code:
enableChat()
To:
Code:
enableChat(false)
 
cant players choose whatever hotkeys they want for movement in otc?
 
Yes, you can use encryption like pxg or Necronia ;)
 
look this maybe work is wasd and arrow sry
Sorry for PL
Code:
Witam.

Chciałbym wam przedstawić Moduł do OTClienta, który pozwoli nam chodzić nie tylko strzałkami ale także klawiszami WASD.

1.Wchodzimy w \modules\game_console i otwieramy plik console.lua:
1a. Znajdź :

Kod:

    channels = {}

I nad tym daj:

Kod:

    consoleWalk = consolePanel:getChildById('walk')

A na samym dole pliku dodajemy:

Kod:

    function Walk()
    if consoleWalk:isChecked() then
    consoleTextEdit:setVisible(false)
    consoleTextEdit:setText("")

    g_keyboard.bindKeyPress("W", function() g_game.walk(North) end)
    g_keyboard.bindKeyPress("D", function() g_game.walk(East) end)
    g_keyboard.bindKeyPress("S", function() g_game.walk(South) end)
    g_keyboard.bindKeyPress("A", function() g_game.walk(West) end)
    else
    consoleTextEdit:setVisible(true)
    consoleTextEdit:setText("")

    g_keyboard.unbindKeyPress("W")
    g_keyboard.unbindKeyPress("D")
    g_keyboard.unbindKeyPress("S")
    g_keyboard.unbindKeyPress("A")
    end
    end


2. Następnie w pliku console.otui znajdź:

Kod:

    Panel
    id: consolePanel
    anchors.fill: parent

I daj pod tym:

Kod:

    CheckBox
    id: walk
    anchors.left: parent.left
    anchors.top: parent.top
    margin-left: 13
    margin-top: 8
    @onCheckChange: Walk()

Następnie zastąpić to:

Kod:

    TabButton
    id: prevChannelButton
    icon: icons/leftarrow.png
    anchors.left: parent.left
    anchors.top: parent.top
    margin-left: 6
    margin-top: 6

Tym:

Kod:

    TabButton
    id: prevChannelButton
    icon: /images/game/console/leftarrow
    anchors.left: walk.right
    anchors.top: parent.top
    margin-left: 3
    margin-top: 6


Gotowe, powinno wszystko działać.

Pozdrawiam.
 
His script work, but when u log in the chat is activated, then need press enter . I want to when u enter game ghe chat is already blocked and walking by wasd.
 
Back
Top