Space Engineers

Space Engineers

2cm Beam System
XY78 21 Jul, 2019 @ 6:04pm
Infinite Damage Bug (And solution)
I have had an issue wherein blocks would for the most part (sometimes this did not happen if three blocks or more are placed in a row) instantly be destroyed when the laser touches them, only leaving the block despawn time and the tick update time - basically the time between laser position updates - to slow down a laser of any power that can deal damage.

I am still not entirely certain about why it happens, especially since it does not seem to be a widespread issue, but it is an issue with how the beams generate explosions. Removing the explosion code in the Beam.cs file resolves the issue.
Specifically this:
var explosion = CreateExplosionInfo( ref explosionArea, damage: damage, hitEntity: hitInfo.HitEntity as MyEntity, ownerEntity: (from as MyCubeBlock)?.CubeGrid, dir: dir); //explosion.Velocity = explosion.Damage * Settings.LaserPhysicsForce * -dir; explosion.StrengthAngularImpulse = explosion.StrengthImpulse = 0.01f; // explosion.Damage * (float)Settings.LaserPhysicsForce; MyExplosions.AddExplosion(ref explosion); if (target.Physics?.Enabled ?? false) target.Physics.AddForce( type: VRage.Game.Components.MyPhysicsForceType.APPLY_WORLD_IMPULSE_AND_WORLD_ANGULAR_IMPULSE, force: dir * damage * Settings.LaserPhysicsForce, position: explosionArea.Center, torque: null);
The other consequence of this is that there will be no impulse generated on the blocks, meaning that your laser will not be pushing.

If this is added on, using the delayedJob function for the laser damage no longer has any affect. If the explosion code is not removed and the delayedJob is added, it means that when there are several blocks in a row getting vaporized, the laser will stop to damage a single one of them, leading me to believe it was implemented as a solution to the explosion issue that just did not work for me for whatever reason.

Could I have permission to reupload the mod with my fixes?

< >
Showing 1-4 of 4 comments
falnen 23 Jul, 2019 @ 2:07pm 
Awesome, thanks so much man worked for me. The lasers were instantly breaking heavy armor before even single blocks, now its better.
the lasers still do more damage straight out of the generator than the ion ones, but i guess that's intended?
XY78 24 Jul, 2019 @ 5:43am 
I think that's intended behaviour. Lasers are more space efficient, ion has a much greater maximum strength.
i think im having this problem, did you ever upload the mod?
XY78 3 Dec, 2019 @ 10:12am 
Without permission from the original author I am not going to, I'm afraid.
< >
Showing 1-4 of 4 comments
Per page: 1530 50