Space Engineers

Space Engineers

AutoPillock - universal flight automaton [SUPERSEDED]
 This topic has been pinned, so it's probably important
cheerkin  [developer] 11 Dec, 2022 @ 7:03am
Script argument reference
Script argument reference
There are two types of args - command and toggle. Both can be used in CustomData boot sequence and directly by putting them as an argument and hitting Run button on PB.
Toggle flips its' state whenever you execute it.
Commands can also be seen as two general types - set-value and action.

Toggle reference
Pattern: toggle:<name>
Example: toggle:wb-jab

You can add optional 3rd part to force specific state (true/false):
Example: toggle:wb-jab:true

Name
Default
Meaning
suppress-transition-control
false
Block transition control (ignore thrusters)
wingman-circle-rotation
false
Rotation formation pattern for subordinates in wingman task
damp-when-idle
true
Similar to vanilla dampening, but better. Vanilla dampening (Z) should be always disabled
vtol-hybrid
true
Assist VTOL thrust provider with normal thrusters
ignore-user-thruster
false
Suppress WASD input (needed for scripts that use WASD for interation with GUI)
emit
true
Send debug projections to HUDSvc script or Commander script if any available
coax-ripple
true
Ripple behavior for precision slow weapons (rail, arty, rockets)
suppress-gyro-control
false
Block gyro control (not set overrides)
aim-to-center
false
Aim to target BB center instead of specific block/point
avoid-carrier
true
Avoid parent ship bounding sphere for Move, Attack and Wingman tasks
freefall-target-filter
false
Filter out targets that show no signs of acceleration for some time (constant velocity in space or matching natural gravity for planets)
wb-snipe-range
false
WeapBot - set combat distance as the biggest range of all available weapons
wb-jab
false
WeapBot - use Jab attack during combat ('dumb-units')


Set-value reference
Set-value is a container object representing some key-value pair that can be changed in runtime by script user.

Pattern: command:set-value:<name>:<value>
Example: command:set-value:sp-limit:1500

Name
Default
Meaning
wb-range-override
0
WeapBot - combat distance override
wb-precision-override
0
WeapBot - global precision override. Set to higher value if the agent fails to align with very fast small target. Default values range from 2m for precision weapons to 10m for rockets
hold-thrust-on-rotation
false
Don't accelerate if badly aligned with desired direction (i.e. you want an agent to rotate before going full speed rather than do it simultaneously)
torpedo-fuse-offset
-0.5f
This value gets added to calculated ETA for jab-launched torpedoes and set as timer countdown
roll-power-factor
0.1f
Roll multiplier (relative). It is downscaling to make rotation favor yaw/pitch rotations. Make it higher to have an agent roll faster
sp-limit
104.38
Change if you break speedlimit with exploits or through modding
move-through
false
Fly through destination point for all subsequently created Move tasks (i.e. don't brake to stop precisely but rush there like a missile)
dpath-speed-limit
30
Limit the speed during dock path task (when navigating through graph)
capital-behavior
false
For now it just means more careful approach to surface landing task, so heavy ship'd have time to brake
ripple-increment-interval
20
How soon WeapBot cycles to the next weapon in ripple mode (in ticks)
filtering-size
6
Targets less than this would be ignored (target bounding box extents, in meters)
awareness-range
2000
At what range the unit would consider global detected target, triggering response (free fire, attack, etc)
tg-autolink-range
500
Maximum range for searching for suitable parent (i.e. a unit with [rank-1])

Action command reference
Pattern: command:<name>:<p1>:<p2>:...:<pN>
Example: command:create-task:cruise-fw

Name
Values
Meaning
set-output
(control seat, screen index) or (LCD panel)
Basic output to internal screen or LCD. Two params for the 1st case, one for the 2nd
next
Force finish current task
create-task
...
Parse and add new task at the end of the queue
inject-task
...
Parse and add new task before the current one
remove-task
id
Remove specific task from the queue. Id is appended to task kind in log and output (e.g. move-7)
infer-task
(dock|land|move)
Create task based on your position. Add wait-for-signal tast beforehand, or this new task would be immediately completed. For dock, you need to be connected to connector. For land - resting with landing gear on the surface. The script would record matrices of gear/connector and create appropriate task. It can be later re-used from exec-queue, by repeat order, etc
default-task
...
Same as create-task, but the task would be saved as default one permanently. This means that this task would get inserted every time when task queue gets empty. I.e. move task would make the drone return to position. Default task is auto-completed as soon as an agent gets any other new task
remove-default-task
Permanently clears default task
signal
Completes wait-for-signal kind of task. Used for starting task queue after pausing it for whatever reason (setting up a permanent repeated queue, inferring task, making synchronized attack, etc)
repeat
Re-creates the whole task history starting from the last wait-for-signal task (task buffer). This can be used to make cyclic task sequences
save-queue
Permanently saves current task buffer (task history starting from the last wait-for-signal)
exec-queue
Replicates tasks from saved queue
jab
Create untargeted jab using all available dumb-units at once
jab2
Create untargeted jab using only the first available dumb-unit. If it is missing, it is identical to jab command above
orbit-here
1 to 3 params
One params - circle around current position using param as a radius (command:orbit-here:500). Three params are considered a point (X, Y, Z) and it launches an attack on this point. Don't ask why
thrust-delegation
None|Vtol|Rover|Clang
Set thrust delegation - movement would be provided by external script
recycle
Reset the code. Almost identical to recompile
set-value
key, value
See section above
set-tag
tag
Tag unit for command broadcast filtering. Works like substring, i.e. you can make tags like asf-1, asf-2, and they would accept command tagged <asf> but not <asf-3>
clear-state
Clear PB Storage - remove nav graph, grid defs, stored queue, default task, etc
clear-defs
Clear grid defs. Use when you deliberately have changed grid by adding or removing blocks and you want the script to capture (use) them permanently
clear-navs
Clear DockHosts' navigation graph
request-docking
Shortcut for creating docking task targeted at a parent ship (for a subordinate aka wingman)
request-depart
Undock from the ship asking nav grahp and permission. If the dock isn't an APck-managed one, then just undock to a point 100m above
cancel-current-route
Delete curent active docking transition (i.e. a drone is badly damaged and can't dock properly, blocking others)
start-su
(all|first|tag), (optional X:Y:Z)
Starts SubUnit, running its' boot sequence from its' remote CustomData. First param is selector, followed by optional XYZ as a target point (for static point attack)
refresh-su
Check all sub-unit merges in attempt to initialize a new SubUnit instance. This is also done automatically during certain tasks (e.g. unit using sub-unit missiles to attack target)
tmc
TMC query
Pass a query to TreeMenuCommand script if available
timer
tag
Trigger tagged timer
d-path-add
node|entry
Create nav graph node for a parent ship (used on subordinate)
d-path-clear
Sends command:clear-navs to a parent ship. Now this seems redundant as it can be done like this: 'p:command:clear-navs'
pick-target
Starts/finishes SelectTarget task. Point forward at a target of interest until you see TargetId populated. It can be either any friendly APck-managed grid or globally locked target
raycast-pt
Sets static target point using raycast (look through camera when use this command)
range-pt
Sets static target point using look direction and current Range
rangefind
Sets Range using raycast (look through camera when use this command)
override-task-behavior
_________
__________
set-awareness
None|TurretAi|TGP|Global|Full
What target sources to consider for reaction (response) purposes. TurretAi - local AI turrets, Global - global datalink, TGP - local TGP script, Full - everything
set-response
Ignore|FreeFire|Attack
How to respond when aware of enemy. FreeFire - don't stop doing current task or sitting idle, but shoot enemy when it is in range, also use PMWs when available. Attack - immediately inject Attack task and actively engage
set-response-ovr
command to execute instead of Attack task injection
You can place {id} placeholder to have it replaced with current target id by the WeapBot. Example for missile: 'command:set-response-ovr:command:inject-task:ram:TargetId={id}'
w-mod-value
key (base-fw|base-up|interval|echelon|circle), value
Override value for TacticalGraph (affects wingman formation). base-fw, base-up - forward and up offsets related to carrier. interval - space added for each wingmen horizontally. echelon - space added for each wingmen vertically. circle - radius for circle formation mode
wb-cycle-face
Cycle currently used WeaponFace (there is one per 6 directions where you have weapons installed). E.g. you can have guns pointing forward and left, this command would switch them. Unit can use any direction face any time. You can cycle it in combat using WeapBot conditional commands
wb-condition
1: comma-delimited kv pairs (key1=xx,key2=yy), 2: command to be executed if test succeeds
Tests are commited every 5 seconds during combat. Possible keys for now: chance - from 0 to 1. minSzSG - if the target it small grid check its size (larger than?). minSzLG - if the target it large grid check its size (larger than?). Examples: 'command:wb-condition:chance=0.2,minSzSG=10:command:wb-range-override:100'
read-gps-from
full block name
Parse full keen 'GPS:' string and set it as a static point
get-toggles
IGC id for callback
Sends menucommand.get-commands.reply with Toggle states to {IGC id}
Last edited by cheerkin; 13 Dec, 2022 @ 6:39am