Could you add these?
I would like to park a casino wagon on a side track near to my base.
Add train wagonsSuggestion
I'll look into. Last I looked, train cars work differently than other vehicles. They don't take decay damage, they just spontaneously disappear under certain conditions, but its possible to prevent.
Are you sure?
I see wagons having different life points I think.
Would be great if this could be added.
Thank you.
I'll aim to include this in the next feature update. Currently focusing on some other plugins for a bit though.
KleementinAre you sure?
I see wagons having different life points I think.
Here's the vanilla code for reference, from TrainCar.
public void DecayTick()
{
if (completeTrain == null)
{
return;
}
bool flag = HasDriver() || completeTrain.AnyPlayersOnTrain();
if (flag)
{
decayingFor = 0f;
}
float num = GetDecayMinutes(flag) * 60f;
float time = UnityEngine.Time.time;
float num2 = time - lastDecayTick;
lastDecayTick = time;
if (num != float.PositiveInfinity)
{
decayingFor += num2;
if (decayingFor >= num && CanDieFromDecayNow())
{
ActualDeath();
}
}
}
public virtual float GetDecayMinutes(bool hasPassengers)
{
bool flag = IsAtAStation && Vector3.Distance(spawnOrigin, base.transform.position) < 50f;
if (hasPassengers || AnyPlayersNearby(30f) || flag || IsOnAboveGroundSpawnRail)
{
return float.PositiveInfinity;
}
return decayminutes * decayTimeMultiplier;
}
public virtual bool CanDieFromDecayNow()
{
if (CarType != TrainCarType.Engine)
{
return !completeTrain.IncludesAnEngine();
}
return true;
}