NO

Transparência

Por nociam, 09 de jun. de 2015 em Tutoriais de Clients

57
15.4k
nociamN
09 de junho de 2015 às 21:09

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.

Editado Junho 9 por nociam

11 de junho de 2015 às 01:25

Tipo, e quando eu for adicionar mais items para ficar com transparencia, como faço ?

AvronexA
11 de junho de 2015 às 08:05

Boa maninho, vai ajudar bastante gente! Eu atualmente uso esse sistema kk

nociamN
11 de junho de 2015 às 12:34

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

MudrockM
11 de junho de 2015 às 12:44

Muito bom obg por compartilhar conosco !

reputado

SoulvilingS
13 de junho de 2015 às 04:24

 

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

 

nociamN
14 de junho de 2015 às 15:09

 

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

 

SoulvilingS
14 de junho de 2015 às 16:02

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
14 de junho de 2015 às 18:11

EDIT:

Fixed!

Editado Junho 15 por Elwthz

HeelNoxH
14 de junho de 2015 às 18:58

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.

14 de junho de 2015 às 20:37
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

Editado Junho 15 por Elwthz

nociamN
14 de junho de 2015 às 22:01

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

14 de junho de 2015 às 23:22

EDIT:

 

Fixed!

Editado Junho 15 por Elwthz

xSONYxX
14 de junho de 2015 às 23:29

Qual a diferença desse pro que eu postei? Daquele jeito eu consegui transparencia tb, será que tem alguma diferença?

SoulvilingS
15 de junho de 2015 às 00:03

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.