Space Engineers

Space Engineers

Directed Energy Weapons - Semi-obsolete
Seamus Donohue 7 Sep, 2022 @ 11:15am
How to get this mod working again (credit: Squidtank)
Squidtank's comment got pushed off the front page, and xenon187's comment isn't far behind, and comments have a 1000 character limit, anyway, so I'm going to post this as a Discussion.

This mod works, just not out-of-the-box. Some Assembly Required. To get this mod to work, do the following:

(Note, if Clockwork168 has updated this mod AFTER September 7, 2022, then you can safely ignore this Discussion as he's probably integrated these changes into the mod.)

.

1) Subscribe to this mod, then wait for Steam to download this mod.

.

2) Get Notepad++. Not required if you're good at manipulating LUA code, Notepad will suffice. But, the rest of my instructions will assume that you're using Notepad++.

I'm also assuming that your copy of Steam and Space Engineers are installed on the C drive.

.

3A) Here, we're going to fix the Railgun crash.

Use Notepad++ to open C:\Program Files (x86)\Steam\steamapps\workshop\content\244850\1724382943\Data\Scripts\DEW_CustomEnergyWeapons\Config\DEW_WeaponLogic.cs

3B) Select the following two lines: (They should be lines 51 and 52.)

[MyEntityComponentDescriptor(typeof(MyObjectBuilder_SmallMissileLauncherReload), true)]
public class DEW_SmallMissileLauncherReloadLogic : DEW_WeaponLogic { }

EITHER Right-click the selection and click "Block Comment" OR delete the lines. In either case, save the file. This should prevent Space Engineers from crashing when you try to place a vanilla Railgun.

.

4A) Here, we're going to get the turret AI working again.

Use Notepad++ to open C:\Program Files (x86)\Steam\steamapps\workshop\content\244850\1724382943\Data\Ammos.sbc

4B) On line 12 under "LaserCharge", you'll find:

<MaxTrajectory>5</MaxTrajectory>

Change this to:

<MaxTrajectory>3000</MaxTrajectory>

Most of the turret and gimbal lasers use this ammunition, of which the Heavy Laser Turrets have the greatest range at 3000 meters. The number here in Ammos.sbc doesn't have any effect EXCEPT to tell the turret AI "This bullet can only reach out to this many meters". This is false, but the turret AI believes it, and thus won't attempt to fire at targets more than 5 meters away. That's why we're changing this number. This doesn't actually extend the range at which a specific turret or gimbal can hit; that's defined in the CubeBlocks.sbc.

4C) On line 32 under "PDLaserCharge", you'll find:

<MaxTrajectory>5</MaxTrajectory>

Change this to:

<MaxTrajectory>1000</MaxTrajectory>

The Point Defense Laser and Anti-Fighter Laser Turret use this ammunition; of those two, the latter has the greater range at 1000 meters.

4D) Save the file.

.

5A) Here, we're going to fix the camera issues on the turrets.

Use Notepad++ to open C:\Program Files (x86)\Steam\steamapps\workshop\content\244850\1724382943\Data\CubeBlocks.sbc

5B) Look at each <Definition> block. It will have a <DisplayName> tag, such as

<DisplayName>Ultra-Heavy Fixed Laser</DisplayName>

or

<DisplayName>Heavy Laser Gimbal Turret</DisplayName>

If the DisplayName says anything about "Fixed", then skip that Definition block and move on to the next Definition, because that's not a turret that you can control.

If the DisplayName uses the word "Turret" or "Gimbal", then insert the following two lines anywhere into the Definition block:

<UpCameraOffset>1</UpCameraOffset>
<ForwardCameraOffset>1.5</ForwardCameraOffset>

This tells Space Engineers to move the camera some number of meters up and some number of meters forward from the turret's pivot point (at least, I think it's the pivot point). Without these tags, the default offsets are 0 meters, which places the camera inside the turret, which is why you can't see anything.

5C) Save the file.

.

All done! If, during play, you decide that you don't like where the camera is for a given turret type, then save your game, go to Main Menu, then go back to Steps 5A and 5B and put different camera offset numbers in. For example, on the Anti-Fighter turret, I don't use UpCameraOffset (so it becomes zero), I just use ForwardCameraOffset 1.5. For the Point Defense Laser, I use 0.1 meters up and 1.5 meters forward.
< >
Showing 1-2 of 2 comments
Seamus Donohue 8 Sep, 2022 @ 12:08am 
I've made a best attempt at underlying explanations, but take those with a grain of salt. I'm not a modder, much less an expert modder.

For example, my in-game testing shows that the smallblock "Light Fixed Laser" has a range of about 1500 meters, and I only just now realized that it's not defined in CubeBlocks.sbc, but rather in BlocksConfig.cs (in one of the subfolders).
aczel2 10 Nov, 2022 @ 8:14am 
It works perfectly for me with this fix!
< >
Showing 1-2 of 2 comments
Per page: 1530 50