Space Engineers

Space Engineers

58 ratings
Doomsday Missile Script v1
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
871.608 KB
Mar 23 @ 9:39pm
1 Change Note ( view )

Subscribe to download
Doomsday Missile Script v1

Description
Doomsday Missile script (General purpose cluster missile script? :D)


Introduction
This script was designed to work with the warhead deployment system I designed and presented here:
https://steamcommunity.com/sharedfiles/filedetails/?id=3450877073
https://steamcommunity.com/sharedfiles/filedetails/?id=3450877227

For those interested in debugging and real-time missile logic visualization, I've also created a version of this script that utilizes the DebugAPI mod. Check it out here:
https://steamcommunity.com/sharedfiles/filedetails/?id=3450872597


Script commands
This script currently supports two commands for controlling the missile:
  • "LAUNCH" or "launch" – Initiates the missile launch sequence. This command disconnects all connectors and merge blocks with the designated name tags specified in the script settings, allowing the missile to begin its flight.
  • <GPS from clipboard> – Simply pasting GPS coordinates from the game's gps tab will set them as the missile's GPS target. The script will automatically store the provided location and use it for navigation.



Script settings
WARNING! Modifying settings mid-flight will cause the script to reload and the missile to crash
Pre-Navigation Settings
These settings come into play in the first two stages of missile's lifetime:
  • freeFallTime [s] – Time before thrusters and gyroscopes are activated. Usefull for gravity assisted missile deployment.
  • noGuidanceFlightTime [s] – Time before missile activates it's guidance mode. In this stage the missile will fly straight ahead.
Navigation Modes
  • 0 - GlidingUntilTargetDetected – The missile tries to maintain forward flight until a target with set characteristics is detected.
  • 1 - BeamRiding – Follows a beam designated by the player until a target with set characteristics is detected.
  • 2 - GPSUnlessTargetDetected – Moves toward a GPS coordinate but switches to tracking if a with set characteristicst is detected.
  • 3 - AbsoluteGPS – Moves and bombards a set GPS coordinate.
Navigation Settings
  • gpsX, gpsY, gpsZ – Target GPS coordinates. Can be set manually or as an argument. With the latter method it can be done mid-flight.
  • beamBlockCustomDataTag – Tag for the block controlling the beam in BeamRiding mode. The specified tag must also be placed in the Custom Data field of the block that should emit the guidance beam.
Target Characteristics
missileTargetType – Defines the type of object the missile will engage:
  • 0 – Large Grid
  • 1 – Small Grid
  • 2 – Planet
  • 3 – Asteroid
  • 4 – Floating Object
  • 5 – Any
missileTargetRelationship – Defines the target’s relationship to the missile owner:
  • 0 – Enemies (Note - from initial testing, grids transfered to space pirates apparently aren't recognized as enemies)
  • 1 – No Ownership
  • 2 – Neutral
  • 3 – Owner
  • 4 – Faction Share
  • 5 – Friends
  • 6 – Any
World Settings
  • maxSmallGridSpeed [m/s] – Maximum speed for small grids in world settings. In vanilla SE it's always 100m/s. Note that I haven't yet tested how the missile performs above 100m/s (but should be fine!).
Missile Build Settings
  • missileDockingMergesNameTag – Tag for docking merge blocks.
    - This tag must be included in the name of the merge blocks that connect the missile to the launcher.
  • missileDockingConnectorsNameTag – Tag for docking connectors.
    - This tag must be included in the name of the connectors that secure the missile to the launcher.
  • missileDockingConnectorsCount – Number of connectors the missile uses for connecting to the launcher.
Important: If multiple missiles exist on the same grid, each must have unique docking tags. This allows the script to correctly differentiate between them and prevent misidentification during launch.
Flight Settings
  • sideMomentumCorrection, downMomentumCorrection, upMomentumCorrection – Lateral, downward, and upward motion correction. Smaller values will result in a smoother flight trajectory, but larger ones make the missile more accurate and responsive.
  • turnSpeedModifier – Rotation speed modifier, that impacts the strength gyroscopes operate with. Values too large will make the missile unstable.
  • fuelSavingMultiplier – Fuel efficiency multiplier. Divides fuel consumption by set ammount. Only activates once the missile is at maximum speed and never drops the missile bellow minimum required consumption.
Collision Avoidance
  • obstacleEvasionStrength – Determines how strongly the missile responds to detected obstacles. Higher values increase the missile's repulsion from obstacles.
  • maxAvoidanceAngle [degrees] – The maximum angle by which the missile can deviate from its course to avoid obstacles.

Radar Settings
  • radarDistance [m] – The maximum range at which the radar scans for targets.
  • radarConeAngle [degrees] – The field of view for radar scans, determining the scanning angle.
  • radarResolution [m] – Target scan grid resolution. If the current resolution is lower than the set value, the script will slightly shift the scan grid with each scan. Over time, this ensures that the entire area is covered at the desired resolution.
  • trackingOvershootFactor – Extends radar scans beyond the target to compensate for movement. For example, with a factor of 1.1 and a target 3 km away, the radar scans up to 3.3 km in that direction.
  • trackingAreaModifier – Multiplier for the tracking area size. At "1," the tracking area matches the target's dimensions. Higher values increase the scan area to account for potential target movement.
Bombardment Settings
  • minimumBombardmentAngle [degrees] – The minimum angle the missile must reach before releasing its bombs. Higher values improve accuracy but may delay release. Only applies to gravity bombardments.
  • acceptableInaccuracyModifier – Adjusts missile accuracy. At "1," the missile is precise but may delay payload release. Higher values reduce accuracy but trigger an earlier drop.
  • proximityToStartBombardment [m] – The distance from the target at which the missile switches to bombardment mode. In this mode, it consumes fuel at maximum rate. Ideally, this should be at least 2 km away from the target.
  • overshootCorrection [m] – A correction factor for gravity bombardments. Moves the target closer to the missile to counteract common overshooting issues.
  • carpetBombingLength [m] – Defines the length of the bombing strip during a carpet bombing run. Only applies to gravity bombardments.
  • deadManSwitchTime [s] – Time before released bomblets self-destruct.
  • distanceFromTargetToArm [m] – Distance from the target at which bomblets arm. Setting this to 0 causes each warhead to arm on impact, but premature detonations may destroy nearby bomblets before they activate.
  • detonationTimeDelay [s] – Adds a randomized delay to warhead detonation after reaching the target. A value of 5 will assign each warhead a detonation time between 0-5 seconds, reducing strain on the game’s physics engine.



Developer Information
https://steamcommunity.com/sharedfiles/filedetails/?id=3451304627
19 Comments
axolotltoloxa Apr 25 @ 6:58pm 
Got it! Thanks!
F8Code  [author] Apr 25 @ 4:50pm 
@axolotltoloxa sadly you cannot immitate a proximity fuze on the warheads. That would require strapping a sensor block to each warhead and (most likely?) an extra bit of programming. This is due to the fact that the programmable block can only monitor simple bomblet factors such as velocity, position, etc. and not the distance towards nearest object (it could technically estimate it based on last enemy data and current warhead data, but it would be innacurate and wouldn't account for the target's shape). I'm guessing you're struggling with warheads flying past your target? An extra bit of code could probably be implemented to trigger an explosion on all bombs X seconds after a first hit, to make sure the bomblets that miss still explode in targets vicinity.
collins3 Apr 24 @ 5:15pm 
Arming a Warhead means it can detonate from any damage/collision, or from a timed explosion
axolotltoloxa Apr 24 @ 4:49pm 
What does arming an explosive do in SE? I haven’t played a lot so I’m not sure what this all does.
axolotltoloxa Apr 24 @ 4:48pm 
Is there a way to turn this into a proximity explosive or is that what the distanceFromTargetToArm does?
collins3 Apr 16 @ 12:12pm 
Watching the video of this thing had me maniacally giggling the whole time, lmao
RagnarDanneskjold Apr 13 @ 10:25pm 
... the reason being that they are too darn effective at messing up the day of everybody in the remote vicinity of your target.
RagnarDanneskjold Apr 13 @ 10:23pm 
There is a reason cluster munitions are banned under the CCM...
Brolaf Keggstanndir Apr 10 @ 12:03pm 
Holy Shit, Batman.
F8Code  [author] Apr 8 @ 12:38am 
dontstealmycheese thanks! The song is Tenzoo - Bloody brazil