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

Transparent water once again

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
Hello guys!

I searched before and i made things.otml:

Code:
items
  23726
    opacity: 0.5
    full-ground: false
in \modules\game_things

Also:
Code:
  g_things.loadOtml('/things/things.otml')
in \modules\game_things\things.lua

Have I compile a client or it's all? 'Cause it's not working. I want to have a transparent water which shows a lower floor. I'm using TFS 1.2

Help guys, thanks!
 
if you do it on 7 floor ( in RME) it wont show lower floor. Needs deeper changes.

And add this in things.lua
Lua:
g_game.enableFeature(GameSpritesAlphaChannel)
under load() function
 
if you do it on 7 floor ( in RME) it wont show lower floor. Needs deeper changes.

And add this in things.lua
Lua:
g_game.enableFeature(GameSpritesAlphaChannel)
under load() function
Have I complie otclient after these changes?
Cause now i have:
292d0c6e15ad2eabmed.png

After these changes. My things.lua code at the bottom is:

Code:
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 })
    g_game.enableFeature(GameSpritesAlphaChannel)
    g_things.loadOtml('/things/things.otml')
   

  end
end
 
you need to compil your .dat and .spr file in object builder with transparency option.
 
This: g_things.loadOtml('/things/things.otml')

Should be:
Lua:
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end

If you have compiled your dat/spr with transparency option it should work.

You can also try to add that in things.lua
Lua:
g_game.enableFeature(GameSpritesU32)
 
This: g_things.loadOtml('/things/things.otml')

Should be:
Lua:
function onClientVersionChange(version)
g_things.loadOtml('/things/things.otml')
end

If you have compiled your dat/spr with transparency option it should work.

You can also try to add that in things.lua
Lua:
g_game.enableFeature(GameSpritesU32)

Now, I got my things.lua:

Code:
 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 })
   
    g_game.enableFeature(GameSpritesAlphaChannel)

    g_game.enableFeature(GameSpritesU32)

   

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

Transparency checked in spr and dat.
This is how that look:

520cc153f2a0454dmed.png
 
that function which Ive got should be out of the load function
 
No.

You either use the spr way or the OTClient way, but not both.


Place things.otml in modules/game_things

in modules/game_things/things.lua

before the closing end of function load() add

g_game.enableFeature(GameSpritesAlphaChannel)

Then at the end of the file before last end.

g_things.loadOtml('things.otml')

Edited as I made a mistake.
 
Last edited:
No.

You either use the spr way or the OTClient way, but not both.


Place things.otml in modules/game_things

in modules/game_things/things.lua

before the closing end of function load() add

g_game.enableFeature(GameSpritesAlphaChannel)

Then at the end of the file before last end.

g_things.loadOtml('things.otml')

Edited as I made a mistake.

So i got now:
Code:
  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 })
g_game.enableFeature(GameSpritesAlphaChannel)

  end
  g_things.loadOtml('things.otml')

end

It's not working. On admina i don't have light, when I'm moving the graphics is fck up and only 'not possible'. The graphic with that id don't appear. Have to compile something in otclient too?
 
So i got now:
Code:
  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 })
g_game.enableFeature(GameSpritesAlphaChannel)

  end
  g_things.loadOtml('things.otml')

end

It's not working. On admina i don't have light, when I'm moving the graphics is fck up and only 'not possible'. The graphic with that id don't appear. Have to compile something in otclient too?

You should be using a recent build, not sure when exactly got implemented.
 
I suggest you start with a clean version, I'm afraid that you have old code from other methods there..

Also, the solution is here anyway

How i can active Transparence
Works! Thanks!

BTW i got this:
Code:
items
  4610
  4611
  4612
  4613
  4614
    opacity: 0.8
    full-ground: false

And only 4610 item is transparent, how to make this table to work all IDs? I don't want to make 50 files like things.otml :D
 
Works! Thanks!

BTW i got this:
Code:
items
  4610
  4611
  4612
  4613
  4614
    opacity: 0.8
    full-ground: false

And only 4610 item is transparent, how to make this table to work all IDs? I don't want to make 50 files like things.otml :D

One at a time like this

Code:
items
  629
    opacity: 0.5
    full-ground: false
items
  1716
    opacity: 0.7
    full-ground: false
items
  1717
    opacity: 0.7
    full-ground: false
items
  1718
    opacity: 0.7
    full-ground: false
items
  1719
    opacity: 0.7
    full-ground: false
items
  1720
    opacity: 0.7
    full-ground: false
items
  1721
    opacity: 0.7
    full-ground: false
items
  21488
    opacity: 0.4
    full-ground: false
 
One at a time like this

Code:
items
  629
    opacity: 0.5
    full-ground: false
items
  1716
    opacity: 0.7
    full-ground: false
items
  1717
    opacity: 0.7
    full-ground: false
items
  1718
    opacity: 0.7
    full-ground: false
items
  1719
    opacity: 0.7
    full-ground: false
items
  1720
    opacity: 0.7
    full-ground: false
items
  1721
    opacity: 0.7
    full-ground: false
items
  21488
    opacity: 0.4
    full-ground: false
Not works

#EDIT

Works, thanks
 
Last edited:
Back
Top