Space Engineers

Space Engineers

[APck] AutoPillock Core 1.0
cheerkin  [developer] 25 Feb, 2024 @ 3:10pm
Boot Sequence examples
This document contains usable examples for common scenarios.
Place in programmable block Custom Data for the main unit, and in remote control Custom Data for sub-units.
For main unit, they are executed line-by-line on script recompile (or recycle command).
For sub-units, they are executed when the unit starts (command:start-su:first, command:start-su:all, etc). Due to this fact sub-unit that was initialized (command:refresh-su) can be unmerged and started (booted) any time without being the part of the main unit.



"Missile" strike, previously separate ram task
command:create-task:wingman command:set-response:Attack command:replace-behavior-task:attack:move:Empty command:set-response-ovr:command:inject-task:attack:TargetId={id},FlyThrough=true command:set-value:awareness-range:10000 command:add-condition:attack:5:3600:distance<800:command:set-value:sp-limit:1000 command:add-condition:attack:1:3600:distance<100:command:timer:conditional command:add-condition:attack:1:distance<50&rc-distance<7:command:detonate command:add-condition:attack:1:distance<10:command:detonate
  • wingman "neverending" task allows returning back for unspent missiles or fly in formation if no targets initially available
  • "Empty" replacer for move removes CQB shifter (default behavior for attack task - circling, evasion, etc) for all subsequent attack tasks
  • response override (set-response-ovr) substitutes attack task with another attack task, but with modded FlyThrough attribute (or the missile would slow down and gently land on target)
  • "set-value:sp-limit" tricks APck into max thrust mode (no fuel conservation) for more aggressive angle in gravity environment (or it would fly almost vertically - relevant only for 1t missiles)
  • "command:timer:conditional" runs tagged timer 100m before target, I use it for item nukes (disperse mags)
  • rc-distance (see Engineer guide) checks distance with a raycast if there is a cam available. Note that it is preceeded by distance<50 to not raycast earlier than really needed
  • simple "distance" predicate is for cases when raycast is not available




Horizontal bombing run, 1t drone (one direction of thrust)
Result:
https://youtu.be/UkWhoQSKS_k
Bulding process
command:set-value:awareness-range:10000 command:set-response:Attack command:replace-behavior-task:attack:move:Empty toggle:allow-1t-up-shifter:true command:add-condition:attack:30:6000:distance<10000:command:replace-behavior-current:move:Higher/400,Closer/2000 command:add-condition:attack:30:6000:distance<2250:command:replace-behavior-current:move:Higher/400,Closer/-100000 command:add-condition:attack:30:6000:distance<1050:command:replace-behavior-current:aim:Higher/100 command:add-condition:attack:5:6000:distance<850:command:timer:drop-stuff|command:replace-behavior-current:aim:reset|command:delay-cmd:500:command:detonate command:add-condition:attack:30:6000:distance<600:command:set-response:Ignore|command:inject-task:move-rel:RemapNG=true,FlyThrough=true,Ticks=600:0:0:-2500
  • allow-1t-up-shifter:true allows NegGravityRejectTilt behavior for 1t agent (disabled by default due to uncertainity of up vector during low speed, i.e. breaking/acceleration transitions)
  • attack task condition at 10000m shifts the target position up 400m and closer 2000m, creating a "virtual" intermediate destination to gain desired altitude (400m)
  • attack task condition at 2250m mirrors that point, after that the destination is behind the target at 400m altitude (and the agent is at that altitude), thus creating roughly even trajectory
  • attack task condition at 1050m overrides the aim point so the drone is forced to look at the target (100m above), this is done to orient the agent better prior bombs release
  • attack task condition at 850m is where the action happens - triggering timers, aim override is removed, and warhead detonation is scheduled for 500 ticks later
  • attack task condition at 600m is the attempt to disengage by suppressing auto response mode and injecting relative waypoint (up 2500m along gravity vector), 10 seconds limit

Last edited by cheerkin; 9 Mar, 2024 @ 3:59pm