Huntre
Member
- Joined
- Mar 22, 2011
- Messages
- 70
- Solutions
- 1
- Reaction score
- 8
Good wanted to know how do to get transparency without editing the sprites in another website baxnie explain like that more is not going Anyone know why ?
but I want this so the other way to edit sprites I already know but this mode and better and easier and more effective than edit sprite by sprite
Way of baxnie
To achieve this, create a file called things.otml
items
622
opacity: 0.5
full-ground: false
Use it from a module.
connect(g_game, {onClientVersionChange = onClientVersionChange})
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end
then I created the file things.otml
and file things.lua
but what is wrong so this error appears
ERROR: invalid thing type client id 622 in category 0
but I want this so the other way to edit sprites I already know but this mode and better and easier and more effective than edit sprite by sprite
Way of baxnie
To achieve this, create a file called things.otml
items
622
opacity: 0.5
full-ground: false
Use it from a module.
connect(g_game, {onClientVersionChange = onClientVersionChange})
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end
then I created the file things.otml
items
493
opacity: 9.9
full-ground: false
493
opacity: 9.9
full-ground: false
and file things.lua
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 isLoaded()
return loaded
end
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end
function load()
local version = g_game.getClientVersion()
g_game.enableFeature(GameSpritesU32)
g_game.enableFeature(GameSpritesAlphaChannel)
g_game.enableFeature(GameMagicEffectU16)
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, { onProtocolVersionChange = load })
g_game.setProtocolVersion(0)
connect(g_game, { onProtocolVersionChange = load })
end
end
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 isLoaded()
return loaded
end
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end
function load()
local version = g_game.getClientVersion()
g_game.enableFeature(GameSpritesU32)
g_game.enableFeature(GameSpritesAlphaChannel)
g_game.enableFeature(GameMagicEffectU16)
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, { onProtocolVersionChange = load })
g_game.setProtocolVersion(0)
connect(g_game, { onProtocolVersionChange = load })
end
end
but what is wrong so this error appears
ERROR: invalid thing type client id 622 in category 0