• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Capacity Overloaded

Wait, i'm a wee confused, why does it have to make your cap infinite?

I'd much rather have it lower your speed once you have reached a % of your max cap, and at 0 cap you can not move.
 
This is good :0
But just one question, how i desactivate this, because players of my server don't like :/
 
I like sportacus idea, keeps the possibility of someone crashing server as before mentioned, but still slows you down and players wont have to watch caps they will know after, they start slowing down they are close to limit
 
Nice idea, im using it in my OT. But has a small bug for TFS 0.3.6 (I didn´t tested in another version). When the Player has the cap overloaded in the login time, the code will try to change his speed before the player exists and will crash the server.

I did a small change to avoid this in login time (It only updates his speed when the user change any inventory item):

in Player.h look for this line:

PHP:
void updateInventoryWeight();

and replace it with this:

PHP:
void updateInventoryWeight(bool isLogin = false);

in Player.cpp look for this line:

PHP:
void Player::updateInventoryWeight()

and replace it with this:

PHP:
void Player::updateInventoryWeight(bool isLogin)

Inside this function look for this line:

PHP:
if (inventoryWeight >= capacity && !capacityOverload)

and replace it with this:

PHP:
if (!isLogin && inventoryWeight >= capacity && !capacityOverload)

Still inside this function look for this line:

PHP:
else if (inventoryWeight < capacity && capacityOverload)

and replace it for this:

PHP:
else if (!isLogin && inventoryWeight < capacity && capacityOverload)

in the file iologindata.cpp look for this line:

PHP:
player->updateInventoryWeight();

and replace it with this:

PHP:
player->updateInventoryWeight(true);


This is solve the crash in login time :)

Regards,
 
set players cap to 100.000, set in all voc gaincap to 0

and now:
onThink -> getplayerfreecap -> dochangespeed?

without source edit -.- and will be exactly the same
 
set players cap to 100.000, set in all voc gaincap to 0

and now:
onThink -> getplayerfreecap -> dochangespeed?

without source edit -.- and will be exactly the same

Lua will never perform better than C++.
 
set players cap to 100.000, set in all voc gaincap to 0

and now:
onThink -> getplayerfreecap -> dochangespeed?

without source edit -.- and will be exactly the same

I Agree with you that this is the easiest solution.

But is the best solution?

As EvulMastash said c++ always will perform better than lua script, all the lua functions in this software is based on c++ functions.

So if you can do a code in c++ bugfree and efficient, always choose this way!

Regards,
 
I Had this error
Did you add this in configmanager.cpp
Code:
    m_confDouble[CAPACITY_OVERLOAD]        = getGlobalDouble("capacityOverload", 0.75);
and this in configmanager.h
Code:
                  CAPACITY_OVERLOAD,
Check them again
 
yes i add this.
my problem is: i don't have "USE_CAPACITY" in configmanager.h
sorry for my bad english
 
logeo and when I get back into the player gets the same speed, have any idea how to fix it?
 
Back
Top