I think SlideTolerance is a multiplier of maxSlope in movedefs.lua.
It makes units slide/bounce whenever they are in greater slope than that value. SlopeTolerance 1 can make units drive off cliffs and stuff "unintentionally". Slope tolerance below 1 seems to do nothing.
slideTolerance is missting from the wiki
Moderator: Moderators
Re: slideTolerance is missting from the wiki
Code: Select all
slideTolerance = udTable.GetFloat("slideTolerance", 0.0f); // disabled
from groundmovetype.cpp:
Code: Select all
bool CGroundMoveType::OnSlope() {
const UnitDef* ud = owner->unitDef;
const float3& mp = owner->midPos;
return
(ud->slideTolerance >= 1.0f) &&
(mp.IsInBounds()) &&
(ground->GetSlope(mp.x, mp.z) > (ud->movedata->maxSlope * ud->slideTolerance));
}
"skidding" is moving down a slope where the unit "should not be" due to groundSlope > unit's maxSlope.
with slideTolerance the formula is basically changed to:
groundSlope > unit's maxSlope * slideTolerance
if slideTolerance is < 1.0, it is ignored and the unit will never skid.
(skidding speed is also influenced by map gravity.)
Code: Select all
if (OnSlope() && (!floatOnWater || ground->GetHeight(owner->midPos.x, owner->midPos.z) > 0))
skidding = true;
if (skidding) {
UpdateSkid();
return;
But it is not always used, ie UpdateSkid() uses its own formula without slideTolerance. So the actual skidding movement is not influenced by this tag.
Code: Select all
// does not use OnSlope() because then it could stop on an invalid path
// location, and be teleported back.
const bool onSlope =
midPos.IsInBounds() &&
(ground->GetSlope(midPos.x, midPos.z) > ud->movedata->maxSlope) &&
(!floatOnWater || ground->GetHeight(midPos.x, midPos.z) > 0.0f);
I also did some tests and it seems to be something like that.
fun fact:
If units skid into each other they seem somewhat likely to catapult each other across the map or even high in the sky, from where they never return.

here is a video of that:
http://www.youtube.com/watch?v=RbZIbgJFaPM
/edit
mighty strange.
if you have a unit with slideTolerance and spawn in on a steep slope, it will not slide down. Then you have another unit slide down into the stuck unit and now both will slide.
Re: slideTolerance is missting from the wiki
It was intentionally left out. (as were commander, cobID and now smoothAnim)
Re: slideTolerance is missting from the wiki
hm, but unlike some other depreciated tags slideTolerance actually has an effect
slideTolerance < 1
unit stays on slopes
slideTolerance > 1
unit slides down
it does work, just imo not very good.
slideTolerance < 1

slideTolerance > 1

it does work, just imo not very good.
Re: slideTolerance is missting from the wiki
Wouldn't it be fun if slideTolerance<1 would actually do something and make stuff slide even on terrain they can drive on?
So that they try to go up a hill and unless they got enough speed they would fall back like a car driving up a sandy slope.
So that they try to go up a hill and unless they got enough speed they would fall back like a car driving up a sandy slope.