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

Problem with exp stages

warmenopen

New Member
Joined
Feb 16, 2017
Messages
7
Reaction score
0
hello guys, i'm facing a little problem with exp stages in my server. first i have a question, the minimal exp stage multiplier is multiplier="1" ? i need to put a less multiplier, it's possible to be like 8.6 servers ? like multiplier="0.1" ? thanks
 
hello guys, i'm facing a little problem with exp stages in my server. first i have a question, the minimal exp stage multiplier is multiplier="1" ? i need to put a less multiplier, it's possible to be like 8.6 servers ? like multiplier="0.1" ? thanks

Code:
    multiplier = pugi::cast<uint32_t>(multiplierAttribute.value());
tfs 1.3 have multipiler in uint32, older tfs like 0.3 have that in float:
Code:
if(readXMLFloat(q, "multiplier", floatValue))

Yes, you can do it like 0.1 if you change type in src.
 
Sorry for up the topic.

My solution is:
Game.cpp:
change
Code:
uint64_t Game::getExperienceStage(uint32_t level)
for
Code:
double Game::getExperienceStage(uint32_t level)

change
Code:
uint32_t minLevel, maxLevel, multiplier;
for
Code:
uint32_t minLevel, maxLevel;
double multiplier;

change
Code:
multiplier = pugi::cast<uint32_t>(multiplierAttribute.value());
for
Code:
multiplier = pugi::cast<double>(multiplierAttribute.value());
Game.h
change
Code:
uint64_t getExperienceStage(uint32_t level);
for
Code:
double getExperienceStage(uint32_t level);

change
Code:
std::map<uint32_t, uint32_t> stages;
for
Code:
std::map<double, double> stages;


Now it works 0.1 :)

@Delusion Do you recommend using double or float? I for example will use a value of 0.0066 in "multiplier".
 
Sorry for up the topic.

My solution is:
Game.cpp:
change
Code:
uint64_t Game::getExperienceStage(uint32_t level)
for
Code:
double Game::getExperienceStage(uint32_t level)

change
Code:
uint32_t minLevel, maxLevel, multiplier;
for
Code:
uint32_t minLevel, maxLevel;
double multiplier;

change
Code:
multiplier = pugi::cast<uint32_t>(multiplierAttribute.value());
for
Code:
multiplier = pugi::cast<double>(multiplierAttribute.value());
Game.h
change
Code:
uint64_t getExperienceStage(uint32_t level);
for
Code:
double getExperienceStage(uint32_t level);

change
Code:
std::map<uint32_t, uint32_t> stages;
for
Code:
std::map<double, double> stages;


Now it works 0.1 :)

@Delusion Do you recommend using double or float? I for example will use a value of 0.0066 in "multiplier".
They will both be the same for tiny decimals like that.
 
Back
Top