Space Engineers

Space Engineers

[APck] AutoPillock Core 1.0
cheerkin  [developer] 17 Feb, 2024 @ 3:37pm
FAQ and general questions
Q: can you tell certain drones to dock or not to dock?

First about certain drones.
There are several ways of sending commands to multiple agents;
- bc:{full command} sends it to everybody
- w:{full command} sends it to subordinates of this one
- p:{full command} sends to parent ship
- bc<tag>:{full command} sends to units that have matching tag

From 0.9.92 the main way of commanding certain drone is done through <tag>.

If you want to command certain drone, not necessary subordinate, you can also use TMCs' context feature (you'd have to put your commands of interest in the drones' TMC CustomData).

Docking command is command:request-docking.

Then, if you want to exclude some drones from docking with others, then its' a bit trickier. You can give certain drones command:wait-for-signal and they would hold position until you send them command:signal.

Q: Is there a command I can run to refresh active drones on scam and autopillock?

To refresh active drones you can recycle everyone with bc:command:recycle. That way carrier clears its' subordinate list, and they will re-link up to it.

Or recycle only the drone that was added (the drone assigns itself to a nearby carrier, not vice versa), in case you did not lose anyone but added a new one.

Q: If a drone gets destroyed the others have issues waiting on the destroyed drone to dock. Not sure the best way to handle this without refreshing every drone PB and command ship PB

command:cancel-current-route executed on carrier would remove current active docking process and release the lock, letting next queued drone start its' docking route.

Another option would be rebooting everyone as you said, for that there is a bc:command:recycle (everyone) or command:w:command:recycle (only wingmen). That would require ordering dock again and may not resolve the issue as the problematic drone can be responsive but unable to dock because of damage.

Q: Does it work with WeaponCore-based mods?

WC breaks targeting, both turret AI and raycast, and also changes the way weapons are triggered. There are ways to solve those issues:

1. Targeting. To make APck see enemies under WC, you can use an adapter script by WARECRAFTER.
It would pass WeaponCore targeting data into APck, and that means you can use WC weapons for detecting enemies:

Pre 1.0:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2923079499
1.0 compatible version:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3006407323

2. Triggering weapons. Use 'hd-coax' custom weapon grouping feature to wrap up WC weapons (see building guide for more info).

Q: Ok, so I setup APL and the WC plugin as well. Setup the gun groups with 'coax' tags, etc. The fighter started tracking its target perfectly. However, it doesn't pull the trigger for some reason on any of the weapon groups. Any ideas?

by NightRaid:
Originally posted by Nightraid Mine:
Been on the same spot as you so here is what I did.

1. After those process you did, put 2 additional timer blocks. Put a [fire][ref] and [cease] tags on the 2 timer. Example: Timer 1 [fire][ref] and Timer 2 [cease]. These timers will be used to trigger the start and stop shooting of your coax weapon.
Note: when putting your timer, press Ctrl +. This will show which is the front side of the timer as it is important to orient your timers facing front.
2. Put your 2 timers in a group and tag the group with [hd-coax][v=500][r=1000]. Example: Timer Group [hd-coax][v=500][r=1000]. The v and r values you can change, I think r is range v I forgot.
3. Put your weapon coax group on the timer hotbar. Put Shoot On in the timer with [fire][ref] then Shoot Off on the [cease].
4. Not sure if necessary but i ran command:clear-defs on the autopillock PB to be sure
5. Your weapon groups should fire when they detect the enemy and stop when no enemy detected.

by AN Marc Appledash:
Originally posted by AN Marc Appledash:
Just to make this clear the thing below is only for use With Weapon Core

you can also set the weapons shootmode to keyfire set the burst amount and have the timer that is used for the hd-coax tag to start it self and have the guns get triggerd with Shoot Modes Keytoggle/keyFire.

this will make the timer trigger the shoot once command for the gun with the set burst count and trigger it self this will work perfect since it only gets activated once the timer is line up with the target.

this way you can make it so that WC guns dont overheat

Q: I'm using move-rel so they clear their silos before engaging, however this appears to only work when starting them without a target. If they have a target they try hitting it from the moment they are started causing them to crash in the silos. What am i missing here?

command:create-task:move-rel:0:0:-100 command:create-task:wingman command:set-value:sp-limit:1000 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:1:distance<50&rc-distance<7:command:detonate command:add-condition:attack:1:distance<15:command:detonate

Yeah, that happens because you set response to Attack, which means it would create attack task (thats default behavior) immediately when it gets suitable target. At that point you have task queue which looks like: attack, move, wingman.
After it gets done with attack task, it would do the 2nd and 3rd tasks.
Solution is to set the response behavior to Attack only after it gets done with the move task - thats what exec task is for. It allows to execute arbitrary command at the moment it actually starts (rather than gets in the task queue).
I.e. you need to make move, exec, wingman tasks in this exact order.
Last edited by cheerkin; 15 Aug, 2024 @ 12:12pm
< >
Showing 1-15 of 94 comments
1. Default threat reaction distance in wb is 2500m, is it between the agent and the threat or the distance between what part(TGP, glaobal)provide the IGC and the threat?
2. Shall I add a PB with APCK WC targeting on each drone if all they have WC fixed weapon? or I just need one in carrier and WC turret tagged with 'x-designator' to provide target
3. What commands should I use if I wanna stop the drone that are attacking threat target and make them reengage the orbit or return to dock? threat response will override/inject it ?
4. I like the design that drone will point damaged blocks on my screen in SCAM(including remaining health about blocks), will u add that in APCK? I think that would be helpful when some drone are valuable I don't want lose it easily.
5. How could I make drones auto refill themselves when in low fuel? I suppose I should set a task queue like:monitor-fuel>dock>set tank/battery in > undock > repeat monitoring and go back to last task. But I have no idea how to accomplish it. Shall I use the new condition command or use behaviour repalce?
At the end I appreciate your masterpiece script for a long time, I believe it has absolute potential to be the best drone script because it nearly fullfill my imagination about carrier with automatic drones.Thanks for ur work and devotion
cheerkin  [developer] 5 Mar, 2024 @ 10:35am 
Thank you!
1. Between the agent and the threat, they select targets on their side.
2. Targeting is global and independent from agents, so you need only one.
3. Check out TMC menu on that blueprint with 5 drones - you would need to change response to Ignore and use "command:next" to force finish current attack task.
4. Maybe in other script, the APck is at the characters limit. You can use event controller with appropriate events I believe, with triggering APck return to base or something similar.
5. The same, I have the code in SCAM but it can't fit into APck, at least for now. Again, maybe event controller block can work around that. There is a "maintenance" task that can be used after docking task and it would switch batteries/tanks/etc, but you need to trigger it (docking/maintenance) from outside.
cheerkin  [developer] 5 Mar, 2024 @ 10:37am 
Pt.3 is important - most of the task are "combat interrupt-able" which means that if response is Attack and there is a target closer than awareness range, then the agent would automatically inject attack task before that task and resume it only after the target is lost. It would do so constantly, so just forcing next task without changing response setting is pointless.
It seems that 'request-docking' isn't a task but 'dock' is, how could I infer a task about docking without using Target ID (but by subordinate)?
because I wanna set drones default task docking and infer wing-man task when needed, it would make drones easily switch state between two tasks just using 'create task wing-man' and 'next'.
cheerkin  [developer] 9 Mar, 2024 @ 9:13am 
request-docking is a convenience command, internally it simply creates docking task for you using the id of TG parent ship, so it should do what you need.
If your case involves docking to arbitrary apck ship, not bound by wingman conneciton, you can use Query target feature with a docking task as a callback (see the Engineering guide)
cheerkin  [developer] 9 Mar, 2024 @ 9:17am 
And infer-task is for creating docking task for non-apck things (i.e. connector at NPC station) - it would remember the position and orientation of your agent, somewhat like how you would set up PAM and similar scripts.
thanks for ur answering!A little question about wing-man circle pattern.When drones orbiting enemy and attack, the circle they move long is pretty perfect.But when they orbiting on the wing-man task in circle, lots of issues come with.Collapse, strange move,happen to my drones(even in example blueprint u uploaded),I guess it's problem of apck on the parent ship. So why don't make circle wing-man task be similar with target on parent ship? u know just force drones face carrier with bottom, orbit without trigger weapon.I hope this would be helpful.
cheerkin  [developer] 10 Mar, 2024 @ 8:15am 
Hmm, that's very weird, never seen such issues. You mean the blueprint with 5 drones - you deploy wingmen, set formation to circle, and they have hard time with that? Space or gravity?

Wingman task and attack circling are very different under the hood: the attack code decides where to go based only where the target and agent are, it does not know about other drones, and wingman task is orchestrated from above (position is assigned by parent ship individually for every drone based on their number and time).

If I just make the wingman task share the same logic, the perfect pattern won't be possible, and drones would often collide. I think you can actually try it, use follow task (it would make drone keep position relative to parent) and add circle shifter on top of that.
NYET RIFLE IS FINE! 10 Mar, 2024 @ 11:22pm 
Trying to use "command:create-task:cruise-fw:Ticks=300", in order to cruise forward for three seconds. Works perfectly as expected in gravity on my 1T grid, but as soon as I use it in space the grid goes wild and begins turning hard. Looking at the forward-gyro, the override values for pitch, yaw and roll are repeatedly oscillating between positive and negative values, the magnitude of which slowly changes from about 8 to 30 rpm. I dont have any subgrids present that might be causing weird phantom forces to move the grid around. I've also tried to use "command:add-condition:cruise-fw:1:3600:alt=false:toggle:suppress-gyro-control:true" to supress gyro control during cruise but that hasn't worked either. Any ideas?
cheerkin  [developer] 11 Mar, 2024 @ 3:03am 
Hmm, I'll look into that, haven't tried cruise-fw in space for 1t. Can suspect it having issues in space because cruise-fw works by constantly creating a destination point at certain distance forward (which direction is defined by forward-gyro), and 1t has to rotate to regulate acceleration, so probably that creates feedback loop that snowballs the situation.

Was thinking for a good minute about what condition can you use to detect the absence of gravity and have not come up with anything :) the opposite is easy. alt=false won't work as it supports only comparison with a numeric value. I should probably add special value like 0 to test against, or better and new predicate like ng (natural gravity) that would be 0 in space.
Yusheng 11 Mar, 2024 @ 9:28am 
Hello! Firstly thank you for creating this as I am very excited to understand all of the programs options. I have been able to successfully dock and undock my test drones however I have run into a problem:

When testing basic setup using https://www.youtube.com/watch?v=JgcJ8v372-8&t=400s
bomber drone reference

I have noticed that setting the range and attack task do not cause the drone to auto attack.

I have also added attack task to drones with x-designator and put them in range of enemy ships and still no response.

Could you provide some insight into how the drones can auto attack?
cheerkin  [developer] 11 Mar, 2024 @ 10:49am 
They auto attack if:
1. The response kind is Attack (could be FreeFire and Ignore)
2. The target is within awareness range
3. The task allows "combat interrupt" (e.g. docking task does not, and some others too)
4. The target can be "seen" either by onboard turrets (x-designators), other drones within antenna reach, or other sources like TGP script.

In general, the simplest case is to have x-designator turret, drone with Attack response setting, and SPRT grid nearby. As long as turret targets that grid, the drone should be starting attack task automatically (check AAG/SU drone as an example, it attacks as soon as you get an enemy within turret range).
cheerkin  [developer] 11 Mar, 2024 @ 10:51am 
In that video I use "DummyTargetEmitter" script that emits fake target with some offset, it is convenient for testing purposes. I can upload that script too.
cheerkin  [developer] 12 Mar, 2024 @ 11:46am 
Originally posted by NYET RIFLE IS FINE!:
but as soon as I use it in space the grid goes wild and begins turning hard

Thinking of this, what you actually expect from cruise-fw in space for 1t? Just override thruster to max? In gravity it has at least some guides in form of gravity/horizon. The whole point of cruise-fw is that it flies where you point the nose, while maintaining the speed (thus "cruise"). But in case of 1t it would need to "flip and burn" to regulate speed, which in space completely breaks the whole idea. To "go in that direction at speed" in space just use move-rel command, it would capture initial direction.
< >
Showing 1-15 of 94 comments
Per page: 1530 50