Fabi Marzan
Well-Known Member
- Joined
- Aug 31, 2020
- Messages
- 136
- Solutions
- 6
- Reaction score
- 67
Greetings, I have a problem that I can't understand, it's about placing Healthticks and Manaticks as a description.
By placing the manaticks or healthticks attributes, it shows the seconds that it will be healed.
So it would be displayed like this:
So in Item.cpp
I have it like this
I try to set it to display the decimals of the milliseconds, that is, if I set 1100, then it should show 1.1s, if I set 1200, then it would show 1.2s.
So I put it like this:
From what I see that every 1000 would simplify it by 1.
But it doesn't work for me, even if I have it at 1000 it shows me 1.1s and if I set it to 1200 it still shows me 1.1s.
I got this code from this post:
By placing the manaticks or healthticks attributes, it shows the seconds that it will be healed.
Lua:
<attribute key="manaGain" value="20" />
<attribute key="manaTicks" value="1000" />
So it would be displayed like this:
So in Item.cpp
I have it like this
C++:
if (it.abilities->manaGain) {
if (begin) {
begin = false;
s << " (";
}
else {
s << ", ";
}
s << "Mana Recovery +" << std::showpos << it.abilities->manaGain << std::noshowpos << " each/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
}
So I put it like this:
C++:
if (it.abilities->manaGain) {
if (begin) {
begin = false;
s << " (";
}
else {
s << ", ";
}
s << "Mana Recovery +" << std::showpos << it.abilities->manaGain << std::noshowpos << " each/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "." << it.abilities->manaTicks / 1000 * 1 << std::noshowpos << "s";
}
From what I see that every 1000 would simplify it by 1.
But it doesn't work for me, even if I have it at 1000 it shows me 1.1s and if I set it to 1200 it still shows me 1.1s.
I got this code from this post:
(OTXSERVER TFS1.2 BASSED)Look HP/Mana regeneration and percent on look
(Title too redundant lol) Hello mates, this is my first post for C++ section. I saw a lot of post about "i want to see those attributes like health regeneration when i look" Then i've decided to explore about how to do, and works well. Here we go: Item.cpp above if...
otland.net
Attachments
-
Screenshot_1.png55.6 KB · Views: 1 · VirusTotal