Jump to content

Recommended Posts

Bom ta ai o melhor jeito de se usar a transparência.

 

Crie um arquivo things.otml na pasta OTClient\data\things ai se coloca nesse arquivo

 

 

 

items:
622:
opacity:0.7
full-ground: false

 

 

 

Agora em OTClient\modules\game_things abre o seu arquivo things.lua e add essa função acima de function load()

 

 

function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end

 

 

logo acima na parte function init() add essa parte nela

 

connect(g_game, {onClientVersionChange = onClientVersionChange})

 

 

ficando assim

 

function init()
connect(g_game, { onClientVersionChange = load })
connect(g_game, {onClientVersionChange = onClientVersionChange})
end

 

 

Atençao: observe que vc tem que pegar o id do spr e não o id do jogo olhe o exemplo de item

 

5QhD74u.png

items:
12007:
opacity:0.7
Pronto agora se tem a transparência que muitos desejavam.
10msmpz.png
srdPgMs.png
kONvG7u.png
Créditos: baxnie.
Edited by nociam
Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/
Share on other sites

 

Bom ta ai o melhor jeito de se usar a transparência.

 

Crie um arquivo things.otml na pasta OTClient\data\things ai se coloca nesse arquivo

 

 

 

items:

622:

opacity:0.7

full-ground: false

 

 

 

Agora em OTClient\modules\game_things abre o seu arquivo things.lua e add essa função acima de function load()

 

 

function onClientVersionChange(version)

g_things.loadOtml('/things/things.otml')

end

 

 

logo acima na parte function init() add essa parte nela

 

connect(g_game, {onClientVersionChange = onClientVersionChange})

 

 

ficando assim

 

function init()

connect(g_game, { onClientVersionChange = load })

connect(g_game, {onClientVersionChange = onClientVersionChange})

end

 

 

 

Atençao: observe que vc tem que pegar o id do spr e não o id do jogo olhe o exemplo de item

 

5QhD74u.png

items:
12007:
opacity:0.7
Pronto agora se tem a transparência que muitos desejavam.
10msmpz.png
srdPgMs.png
kONvG7u.png
Créditos: baxnie.

 

 

Fica dando esse erro:

ERROR: invalid thing type client id 116 in category 2

ERROR: invalid thing type client id 258 in category 2

ERROR: invalid thing type client id 38 in category 2

 

Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655716
Share on other sites

 

Fica dando esse erro:

ERROR: invalid thing type client id 116 in category 2

ERROR: invalid thing type client id 258 in category 2

ERROR: invalid thing type client id 38 in category 2

 

Ai e algo errado no seu things.lua muda por esse

 

 

filename = nil

loaded = false

 

function init()

connect(g_game, { onProtocolVersionChange = load })

connect(g_game, {onClientVersionChange = onClientVersionChange})

end

 

function terminate()

disconnect(g_game, { onProtocolVersionChange = load })

end

 

function setFileName(name)

filename = name

end

 

function onClientVersionChange(version)

g_things.loadOtml('/things/things.otml')

end

 

function isLoaded()

return loaded

end

 

function load()

local version = g_game.getProtocolVersion()

 

g_game.enableFeature(GameSpritesU32)

 

local datPath, sprPath

if filename then

datPath = resolvepath('/things/' .. filename)

sprPath = resolvepath('/things/' .. filename)

else

datPath = resolvepath('/things/' .. version .. '/Tibia')

sprPath = resolvepath('/things/' .. version .. '/Tibia')

end

 

local errorMessage = ''

if not g_things.loadDat(datPath) then

errorMessage = errorMessage .. tr("Unable to load dat file, please place a valid dat in '%s'", datPath) .. '\n'

end

if not g_sprites.loadSpr(sprPath) then

errorMessage = errorMessage .. tr("Unable to load spr file, please place a valid spr in '%s'", sprPath)

end

 

loaded = (errorMessage:len() == 0)

g_game.enableFeature(GameDiagonalAnimatedText)

if errorMessage:len() > 0 then

local messageBox = displayErrorBox(tr('Error'), errorMessage)

addEvent(function() messageBox:raise() messageBox:focus() end)

 

disconnect(g_game, { onProtocolVersionChange = load })

g_game.setProtocolVersion(0)

connect(g_game, { onProtocolVersionChange = load })

end

g_game.enableFeature(GameBlueNpcNameColor)

end

 

Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655823
Share on other sites

Continua com mesmo erro:

ERROR: invalid thing type client id 1019 in category 1
ERROR: invalid thing type client id 2714 in category 1
ERROR: invalid thing type client id 1484 in category 1
ERROR: invalid thing type client id 666 in category 1
ERROR: invalid thing type client id 1487 in category 1
ERROR: invalid thing type client id 1489 in category 1
Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655831
Share on other sites

Oi,

 

Eu fiz seu tutorial, usando um sprite com 50% de opacidade (fiz no photoshop)

 

Acontece o siguente:

(Pode ajudar pf?)

 

attachicon.giferror.jpg

 

Deixa ela normal é configura 0.5 no otc.

Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655844
Share on other sites

EDIT:
so preciso arrumar isso...
ERROR: Unable to send extended opcode 1, extended opcodes are not enabled
ERROR: Unable to send extended opcode 4, extended opcodes are not enabled

tenho esse report no module Terminal em OT Client
:c
Edited by Elwthz
Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655849
Share on other sites

1 vc tem um arquivo thing.otml na pasta correta ? depois troque o thing.lua pelo meu.

 

filename = nil
loaded = false

function init()
connect(g_game, { onClientVersionChange = load })
connect(g_game, {onClientVersionChange = onClientVersionChange})
end

function terminate()
disconnect(g_game, { onClientVersionChange = load })
end

function setFileName(name)
filename = name
end

function isLoaded()
return loaded
end

function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end

function load()
local version = g_game.getClientVersion()


local datPath, sprPath
if filename then
datPath = resolvepath('/things/' .. filename)
sprPath = resolvepath('/things/' .. filename)
else
datPath = resolvepath('/things/' .. version .. '/Tibia')
sprPath = resolvepath('/things/' .. version .. '/Tibia')
end

local errorMessage = ''
if not g_things.loadDat(datPath) then
errorMessage = errorMessage .. tr("Unable to load dat file, please place a valid dat in '%s'", datPath) .. '\n'
end
if not g_sprites.loadSpr(sprPath) then
errorMessage = errorMessage .. tr("Unable to load spr file, please place a valid spr in '%s'", sprPath)
end

loaded = (errorMessage:len() == 0)

if errorMessage:len() > 0 then
local messageBox = displayErrorBox(tr('Error'), errorMessage)
addEvent(function() messageBox:raise() messageBox:focus() end)

disconnect(g_game, { onClientVersionChange = load })
g_game.setClientVersion(0)
g_game.setProtocolVersion(0)
connect(g_game, { onClientVersionChange = load })
end
end

 

 

Edited by nociam
Link to comment
https://xtibia.com/forum/topic/234621-transpar%C3%AAncia/#findComment-1655855
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...