Space Engineers

Space Engineers

[APck] AutoPillock Core 1.0
cheerkin  [developer] 15 Feb, 2024 @ 11:58am
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
Since APck v1.0 toggle state can be forced with optional param, e.g. toggle:wb-jab:true

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
ignore-user-thruster
false
Suppress WASD input (needed for scripts that use WASD for interation with GUI)
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')
patrol-after-response
false
Generate Orbit task for a limited amount of time after response ends, in case if there is no another tasks in the queue
allow-1t-up-shifter
false
Use up-shifters (roll) for single-directional thrust. Enabling can interfere with reaching the waypoint in gravity but allows "plane-like" flight using certain shifters
log
false
Enable verbose logging to PB screen (critical errors and certain things would be written even if feature is disabled). Use when designing or debugging issues, avoid on servers
echo
false
Enable verbose output to PB detailed info. Use when designing or debugging issues, disabling improves performance

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
cc-gain
100f
How far away the destination point is generated for "direction" shifters (cruise task, orbit during attack, etc). Bigger value means more acceleration for poorly thrust-equipped grids which stopping path could be larger than 100m
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)
ripple-increment-interval-rail
180
How soon WeapBot cycles to the next weapon in ripple mode (in ticks) for railguns. They need bigger value since they charge up their shot to prevent WB from readjusting aim to the next railgun while previous is still in the process of shooting
filtering-size
6
Targets less than this would be ignored (target bounding box extents, in meters)
awareness-range
3000
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])
wb-model-cycle-timeout
60
How often WB would force cycle weapon groups that are non-ripple by its nature (i.e. gatlings). In other words, it would let these groups fire that amount of ticks until attempting to use ripple groups if they are not cooling down
custom-val
0f
Used for conditional triggers (e.g. custom-val>100), see Engineer guide

Action command reference
Pattern: command:<name>:<p1>:<p2>:...:<pN>
Example: command:create-task:cruise-fw
Command parts are always separated with ':' character. Sometimes part can contain subparts, in which case separators are different. "Values" in the following table are separate parts, so the whole command may contain varying amount of parts. See User Guide for more info.

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
inject-task-inherit-target
...
Parse and add new task before the current one, passing the current task target (move feed) to the new 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
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. An agent would undock and go to a point 100m above the connector (useful if the dock isn't an APck-managed one). IMPORTANT: you rarely need to use this command as most tasks would automatically undock, just create specific task
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 target id)
Starts SubUnit, running its' boot sequence from its' remote CustomData. First param is selector, followed by optional target id
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)
query-target
...
See Engineer guide: target queries
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'
replace-behavior-task
...
See Engineer guide: replaces behavior chain for all upcoming tasks
replace-behavior-current
...
See Engineer guide: replaces behavior chain just for current task instance, cancels itself after task completion
chain-behavior-task
...
See Engineer guide: adds shifter to the end of behavior chain for all upcoming tasks
chain-behavior-current
...
See Engineer guide: adds shifter to the end of behavior chain for current task instance, next time a new task of the same kind would have initial behavior chain against
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-targeting-strategy
First|Closest|Random|Loop
Strategy for sub-units target distribution. "First" or "Closest" would focus all sub-units on the same target, "Random" would assign randomly, and "Loop" evenly
detonate
Detonate all available warheads
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
index (optional)
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 conditional commands. You can pass index as a parameter. I.e. if you have 2 weapon faces, set the default (usually forward-looking) by "command:wb-cycle-face:0", second by "command:wb-cycle-face:1", etc.
add-condition
...
See Engineer guide: adds a Condition to be tested during specific task
cmdr-draw-pos
sprite, color, size, label
Sends current unit world position to be drawn by Commander HUD. {sprite} is a identifier for SE LCD sprite, {color} is a prefixed RGB string (#FFaa90). E.g.: 'command:cmdr-draw-pos:CircleHollow:#fa00fa:20:normal proc'
cmdr-draw-targetable
sprite, color, size, label
Same as above, but also makes that mark a targetable entity
delay-cmd
delay (ticks), ... commands
Postpone command execution
get-toggles
IGC id for callback
Sends menucommand.get-commands.reply with Toggle states to {IGC id}
Last edited by cheerkin; 23 Sep, 2024 @ 9:52am