• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Item time left/charges

Ciosny

Member
Joined
Aug 16, 2024
Messages
131
Solutions
1
Reaction score
16
Hi! :) I looked on the forum but I don't think there is one for TFS 1.4.2, otc8....

I would like to display the remaining time and charges on my items. I tried to do it myself several times but unfortunately I failed. Has anyone ever done this? :D
 

Attachments

Wow this is great that it shows how much time you have left with it on!

Although I asked more about what's in the backpack, because if you have a lot of e.g. time rings, you don't know which ones are 10 minutes and which are 30 seconds :D
 
Wow this is great that it shows how much time you have left with it on!

Although I asked more about what's in the backpack, because if you have a lot of e.g. time rings, you don't know which ones are 10 minutes and which are 30 seconds :D
i guess they did it this way because i understand that in tibia RL(at least in canary) doesn't show the duration in backpack, only in inventory. but your point is good.
 
i guess they did it this way because i understand that in tibia RL(at least in canary) doesn't show the duration in backpack, only in inventory. but your point is good.
I think this is a nice tidbit :) Basically, you have 10 rings or stone amulets and you see which ones have how much time/use
 
@Gesior.pl @Mateus Robeerto

is there a code for regular otcv8?
Oen included this duration system in OTCv8 about two months ago. You can check it here, or I strongly recommend migrating to Oen's latest and most updated version of OTCv8, which already has all the necessary features and is ready to use. On the server side, your next step is to figure out how to properly send the duration data to the client side in OTCv8.

 
Oen included this duration system in OTCv8 about two months ago. You can check it here, or I strongly recommend migrating to Oen's latest and most updated version of OTCv8, which already has all the necessary features and is ready to use. On the server side, your next step is to figure out how to properly send the duration data to the client side in OTCv8.


Thats not everything though, and I don't know why would you need that graph thing for item duration feature.

To implement this feature the best possivle way go this path for tfs and otc source edits:
1.
2.

Then you'll need fixes:
3. Stackables fix
4. Timestamp fix
And
5.
 
Thats not everything though, and I don't know why would you need that graph thing for item duration feature.

To implement this feature the best possivle way go this path for tfs and otc source edits:
1.
2.

Then you'll need fixes:
3. Stackables fix
4. Timestamp fix
And
5.
i got many errors with time stamp when i tried to add.. i will check it later again, thank u
 
Hello, hello!
I installed it, but the ordering system, letters, books, and writing windows stopped working.


Erro Client:


ERROR: ProtocolGame parse message exception (20 bytes, 5 unread, last opcode is 0x96 (150), prev opcode is 0xffffffff (-1)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 800)
 
Hello @Unknown Soldier @Mateus Robeerto

I did all the following steps on TFS 1.5 and otcv8:

1. New decay and item duration feature · Oen44/tfs-new-decay@f72bde7 (https://github.com/Oen44/tfs-new-decay/commit/f72bde7c08a580c93336d33cbf857b1a008a2764) Done ✅

2. Display Item Duration feature by Oen44 · Pull Request #29 · OTAcademy/otclientv8 (https://github.com/OTAcademy/otclientv8/pull/29/commits/c661b9cdf43a7eb6a034b65222695f48b57cc1e6) Done ✅

3. Fixed compilation errors and stackble items · Oen44/tfs-new-decay@54b3344 (https://github.com/Oen44/tfs-new-decay/commit/54b334489c2a88d1823ce54f2fc41f9db1da9ad2) Done ✅

4. Fixed Item Duration client-server time difference · OTAcademy/otclientv8@268d973 (https://github.com/OTAcademy/otclientv8/commit/268d973e189761405f79f872a9d66da29fe8d95e) Done ✅

5. Removed sending timestamp · Oen44/tfs-new-decay@a293048 (https://github.com/Oen44/tfs-new-decay/commit/a293048036505f82214cd969e0a549cf54880655) Done ✅

And i still get a black screen upon logging in after recompiling server side code.

Anyone got it to work on tfs1.5?

EDIT: Adding g_game.enableFeature(GameDisplayItemDuration) in features.lua made the black screen disappear, but still a lot of weird behavior. I see the minutes displayed on life and time ring for example, but cant drag backpacks etc. Might have done something weird in the server side commit, TFS1.5 had a lot of stuff commented out as opposed to TFS 1.4, so might have missed/skipped something.

Also, should otcv8 be compiled in DirectX x64 or DirectX Win32?


Cheers,
Zeke
 
Last edited:
Pretty sure my issue is with the networkmessage.cpp commit, needs to be compatible with TFS1.5, any help is much appreciated!
 
Back
Top