Tipo, e quando eu for adicionar mais items para ficar com transparencia, como faço ?
- Fórum
- OTServ
- Tutoriais
- Tutoriais de Clients
- Transparência
info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino

info
Grupo: Visconde
Registrado: 19/11/08
Posts: 364
Reputação: +104
Gênero: Masculino
Char no Tibia: Avronex Shiolalon

Boa maninho, vai ajudar bastante gente! Eu atualmente uso esse sistema kk
Tipo, e quando eu for adicionar mais items para ficar com transparencia, como faço ?
items:
622:
opacity:0.7
items:
1623:
opacity:0.7
items:
1624:
opacity:0.7
info
Grupo: Marquês
Registrado: 24/12/09
Posts: 1k
Reputação: +326
Gênero: Masculino
Char no Tibia: Necromanser

Muito bom obg por compartilhar conosco !
reputado
info
Grupo: Visconde
Registrado: 18/01/13
Posts: 319
Reputação: +66
Gênero: Masculino

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
items:12007:opacity:0.7Pronto agora se tem a transparência que muitos desejavam.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
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
info
Grupo: Visconde
Registrado: 18/01/13
Posts: 319
Reputação: +66
Gênero: Masculino

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
info
Grupo: Campones
Registrado: 13/06/15
Posts: 13
Reputação: 0

EDIT:
Fixed!
Editado Junho 15 por Elwthz
info
Grupo: Visconde
Registrado: 08/10/11
Posts: 444
Reputação: +71
Gênero: Feminino
Char no Tibia: No Have.

Oi,
Eu fiz seu tutorial, usando um sprite com 50% de opacidade (fiz no photoshop)
Acontece o siguente:
(Pode ajudar pf?)
Deixa ela normal é configura 0.5 no otc.
info
Grupo: Campones
Registrado: 13/06/15
Posts: 13
Reputação: 0

tenho esse report no module Terminal em OT Client
Editado Junho 15 por Elwthz
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
Editado Junho 14 por nociam
info
Grupo: Campones
Registrado: 13/06/15
Posts: 13
Reputação: 0

EDIT:
Fixed!
Editado Junho 15 por Elwthz
info
Grupo: Visconde
Registrado: 26/12/07
Posts: 272
Reputação: +31
Char no Tibia: [ADM]Sony

Qual a diferença desse pro que eu postei? Daquele jeito eu consegui transparencia tb, será que tem alguma diferença?
info
Grupo: Visconde
Registrado: 18/01/13
Posts: 319
Reputação: +66
Gênero: Masculino

Qual a diferença desse pro que eu postei? Daquele jeito eu consegui transparencia tb, será que tem alguma diferença?
Desse jeito não precisa editar no photoshop, imagem por imagem.









info
Grupo: Conde
Registrado: 04/02/13
Posts: 541
Reputação: +90
Gênero: Masculino
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
Editado Junho 9 por nociam