Space Engineers

Space Engineers

Nanite Control Factory - Automated Construction (Not working - Old Version)
John Wick 2017 年 3 月 25 日 上午 11:58
[Modification] Changine the nanite pule/spawn rate to reduce lag on a DS
Hey im a newb to modding and im trying to figure out what variables i need to change in the code to slow down the spawn rate from every 3 seconds to around 1 minute. We were using the nanites on our server but they were creating to much lag from continious stream spawning so we want to reduce the spawn rate. I believe i had isolated the section of code that is responsible for spawning the nanite streams ...

NaniteParticleManager.cs Line 75-79
double distance = Vector3D.Distance(m_constructionBlock.ConstructionBlock.GetPosition(), targetPosition);
int time = (int)Math.Max(60f, (distance / distanceDivisor) * 1000f);
int tailLength = Math.Max(1, 15 - ((int)(m_particles.Count / 40f)));
NaniteParticle particle = new NaniteParticle(time, (IMyCubeBlock)m_constructionBlock.ConstructionBlock, target, startColor, endColor, tailLength, 0.01f);
m_particles.Add(particle);

But i have not been able to figure out what to change. Any help would be greatly appreciated, thanxs.