• 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!

Importing Tibiando files, tibia.dat and tibia.spr to otclient.

It is possible?


  • Total voters
    7

unixstyle297

~NewPDX U2D Founder~
Joined
Sep 2, 2012
Messages
1,019
Reaction score
12
Location
POLAND
THANKS FOR ALL! AND PLEASE CLOSE THIS THREAD!

Hi everyone! I have a question about otclient: I want to import tibiando files, tibia.dat and tibia.spr, and so: How I can do it, it works. Thanks for quick reply. It be possible I would like to import tibiando files? It is possible I import my tibia.dat and tibia.spr?? Thanks for all ideas.

Regards, ~unix.
 
Last edited:
What is tibiando?
Just use your spr and dat..
 
Hello, if tibiando music files are .ogg files i think you can place them on ...\otclient-master\data\sounds and for the spr and data you only have to create a folder inside ...\otclient-master\data\things\860 <--- (note that my client ver is 8.60 hence the folder name 860), and place the files there, hope it helps.
 
OK, thank you for all bro, I have a question, otclient can be integrated with tibiando (Tibia API music), or not, if it has own music api I see them black. Waiting for yours help.

Main Stream: Could be match Tibiando (Tibia API) with otclient? This client runs as normal tibiaclient or has own structure?
 
tibiando = tibia with music
ot client = too many features also music

so, what you want?
 
Convert your music files to .ogg and you wont need tibiando
 
@up Otclient has own tibia api or what, I want to change my client, I have tibiando instaled in ots, may I try to install tibiando in otclient? If I'm good understanding, It's possible to make own tibiando with otclient?, otclient have this one own music tibia api or what?
 
Reading a little bit, otclient just read music files with extension ".ogg", so change your files to ".ogg" and will work...
 
Yh as above said..

You can configure songs to play at different parts.
E.g. title music that you should hear with the downloaded otclient is done via .ogg.
I can't remember the exact reason edubart gave me but it's all .ogg now.

In your modules > client folder

you'll have a file named "client.lua"
with something like this
Lua:
Client = {}

local musicFilename = "startup.ogg"

function Client.setMusic(filename)
  musicFilename = filename
  g_sounds.stopMusic(0)

  if not g_game.isOnline() then
    g_sounds.playMusic(musicFilename, 3)
  end
end

function Client.reloadScripts()
  g_modules.reloadModules()
  dofile '/otclientrc'
  local message = tr('All modules and scripts were reloaded.')

  modules.game_textmessage.displayGameMessage(message)
  print(message)
end

function Client.startup()
  -- Play startup music (The Silver Tree, by Mattias Westlund)
  g_sounds.playMusic(musicFilename, 3)
  connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end })
  connect(g_game, { onGameEnd = function() g_sounds.playMusic(musicFilename, 3) end })

  -- Check for startup errors
  local errtitle = nil
  local errmsg = nil

  if g_graphics.getRenderer():lower():match('gdi generic') then
    errtitle = tr('Graphics card driver not detected')
    errmsg = tr('No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance.')
  end

  -- Show entergame
  if errmsg or errtitle then
    local msgbox = displayErrorBox(errtitle, errmsg)
    msgbox.onOk = function() EnterGame.firstShow() end
  else
    EnterGame.firstShow()
  end
end

function Client.init()
  g_window.setMinimumSize({ width = 600, height = 480 })
  g_sounds.preload(musicFilename)

  -- initialize in fullscreen mode on mobile devices
  if g_window.getPlatformType() == "X11-EGL" then
    g_window.setFullscreen(true)
  else
    -- window size
    local size = { width = 800, height = 600 }
    size = g_settings.getSize('window-size', size)
    g_window.resize(size)

    -- window position, default is the screen center
    local displaySize = g_window.getDisplaySize()
    local defaultPos = { x = (displaySize.width - size.width)/2,
                         y = (displaySize.height - size.height)/2 }
    local pos = g_settings.getPoint('window-pos', defaultPos)
    g_window.move(pos)

    -- window maximized?
    local maximized = g_settings.getBoolean('window-maximized', false)
    if maximized then g_window.maximize() end
  end

  g_window.setTitle('OTClient')
  g_window.setIcon(resolvepath('clienticon.png'))
  g_keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts)

  connect(g_app, { onRun = Client.startup })
end

function Client.terminate()
  -- save window configs
  g_settings.set('window-size', g_window.getUnmaximizedSize())
  g_settings.set('window-pos', g_window.getUnmaximizedPos())
  g_settings.set('window-maximized', g_window.isMaximized())

  local clientVersion = g_game.getClientVersion()
  if clientVersion ~= 0 then
    g_settings.set('client-version', clientVersion)
  end

  Client = nil
end
This controls the startup music to play so long as you are on the title screen. You can configure more into this however, it is probably best to add your own into the mods or even create a new module and have it access a folder of client_sounds or something like that.

My advice is to convert your files to .ogg - there are plenty of free online convertors, and then to restructure your codes to read where and when they should play. This is pretty good since it stops players having to open tibiando as well as the client.

My knowledge on this isn't too good at the moment as i haven't really played with the sounds. But if you find a easy way to structure it, do post it in this thread for others to use/get inspired.
 
OK, Thanks for all, but I have a one question,

Can I use music as intro music playing, death music playing, combat music playing, login music playing, and weapon attack music playing?

Can you tell me somebody this client has all this functions?
 
It is an open source client. You can do anything you can imagine.
 
And in short yes. Yes you can. Lua is one of the most flexible languages i know. If the rule is in c++ then you can do it in lua
 
In this case I will waste time, if I change that client from my cipsoft client tibiando, because in those both clients I can write script .lua, or cpp, and do that. Thanks for all GHOSTX and SUMM. Maybe I change it in my next project, but tibiando I think it's easier, only importance is that it is opensource client. Ok. Thanks and please moderator close this thread.
 
Back
Top