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:58am
FAQ
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:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2923079499

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
Last edited by cheerkin; 29 Jan, 2023 @ 4:20am
< >
Showing 1-15 of 73 comments
Krakenson 12 Dec, 2022 @ 10:06am 
Is it possible to have a static grid instead of a carrier from where i could control and dispatch my drones? When i try to run the script on my static grid it complains that I'm missing a bunch of blocks such as gyros and thrusters.

I was hoping that I could run this in paralel with your SCAM script and just have a base with automated mining and combat drones which would be very cool.
cheerkin  [developer] 12 Dec, 2022 @ 10:49am 
You can have static grid but gyro and remote are still required. They are used for certain things even if you are not flying.
Thrusters are not required.
Last edited by cheerkin; 12 Dec, 2022 @ 10:50am
Krakenson 12 Dec, 2022 @ 2:43pm 
Is it possible to use Searchlights (the DLC block) as x-designator? From my understanding they do have the turret AI on them and considering how compact they are they would make for a fantastic target designator.
Last edited by Krakenson; 12 Dec, 2022 @ 2:43pm
cheerkin  [developer] 12 Dec, 2022 @ 3:41pm 
No, unfortunately, they don't have the interface to provide access to target data.
Nightraid [Mine] 14 Dec, 2022 @ 4:18am 
I tried using the hd-coax group but it doesn't work for me. Either its a force attack command or when the drone detects an enemy, the timers under the group won't trigger. Not sure what steps I'm missing. These are what I did (Exact casing and enclosed in [])

1. Updated script to 0.9.97
2. Created 3 timers. Named them Timer [fire], Timer [cease] and Timer [ref].
3. Added all those timers to group hd-coax. (Tried using [hd-coax] but it causes errors on the script).
4. Recompiled the PB and ran command:clear-defs
5. Added actions for fire and cease timers. For Timer [fire] I added the action coaxial-weapons shoot on. For Timer [cease] I added coaxial-weapons shoot off. I left Timer [ref] as it is.
6. Testing - Added hostiles and issued attack commands.
cheerkin  [developer] 14 Dec, 2022 @ 5:47am 
Originally posted by Nightraid Mine:
3. Added all those timers to group hd-coax. (Tried using [hd-coax] but it causes errors on the script)

[hd-coax] is a group tag not the group name. From building guide:

'heavy dakka [hd-coax][ripple][v=500][r=1000][fwO=2][d=5]'

Not sure about errors. Maybe because you didn't have the group name to be tagged and just made a group from a combination of tags only?

Originally posted by Nightraid Mine:
2. Created 3 timers. Named them Timer [fire], Timer [cease] and Timer [ref]

'You can add two timers and tag them [fire] and [ceise]. The code would trigger appropriate timer when it needs to start or stop firing. You should tag one of them [ref] to be used as bore reference.'

You don't need 3 timers. 2 is enough, and one of them should be ref. Otherwise, ref would be picked randomly from one of those two.
Nightraid [Mine] 14 Dec, 2022 @ 6:15am 
Sorry I'm confused regarding the tagging and grouping. Still I need to group all the timers together right? Because hd-coax is a group tag the groupname for the timers shouldn't be [hd-coax] but it can go like Timer [hd-coax][ripple][v=500][r=1000][fwO=2][d=5]? Also I'm now using 2 timers, one named Timer 1 [fire] and Timer 2 [ref].

For reference, because I'm still testing things I'm using your default drone replaced the script with your updated one. My aim is to have the coaxial-weapons group to fire when the code triggers when it needs to start or stop firing. So I have to setup the action for Timer 1 [fire] right? So I setup the coaxial-weapons shoot on for Timer 1 [fire] but the weapons still won't fire.
cheerkin  [developer] 14 Dec, 2022 @ 6:32am 
I am confused reading your question. It is as simple as this:

You make a group 'some unique name [hd-coax][v=500][r=1000]'.
Place a timer named 'Timer [fire][ref]'.
Place a timer named 'Timer [cease]'.
Add both timers to the group.
Done.
cheerkin  [developer] 14 Dec, 2022 @ 6:36am 
The first timer would be triggered when it is forward-aligned with fire solution.
The second timer would be triggered when the code decides to stop firing.

During design time, I strongly suggest reading the PB screen log.
Nightraid [Mine] 14 Dec, 2022 @ 6:53am 
Originally posted by cheerkin:
I am confused reading your question. It is as simple as this:

You make a group 'some unique name [hd-coax][v=500][r=1000]'.
Place a timer named 'Timer [fire][ref]'.
Place a timer named 'Timer [cease]'.
Add both timers to the group.
Done.

Alright what I was confused about was the tag. Didn't know I should combine the tag [fire] and [ref] in 1 timer block. So I followed this example, my group is Timer [hd-coax][v=500][r=1000] and under this group are Timer [fire][ref] and Timer [cease]. Recompiled and ran command:clear-defs, issued an attack command but coaxial-weapons group still not firing. Btw, I noticed that the Timer [fire][ref] is always toggled off. Is that suppose to behave like that?
cheerkin  [developer] 14 Dec, 2022 @ 7:13am 
I've literally did the points that I described above for the stock AAG, here is the result:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2901725542

Just take it and let's finish this.
Nightraid [Mine] 14 Dec, 2022 @ 7:23am 
I'll try this later, if it still doesn't work for me there's probably some conflict because of weaponcore.

Thank you cheerkin for your time, effort and patience regarding this.
cheerkin  [developer] 14 Dec, 2022 @ 7:26am 
NP! By the way, how does the drone even react to threats? From what I've heard, WC completely breaks turret AI unless specifically dealt with. Asking because I just realized that it does somehow, since you are getting attack tasks created.
Last edited by cheerkin; 14 Dec, 2022 @ 7:27am
Nightraid [Mine] 14 Dec, 2022 @ 7:50am 
With WC, drones would still detect enemies. They'll still try to align their coaxial guns to the enemy but won't fire. Also when I tried forcing the coaxial weapons to shoot, the AI felt like it was having a hard time keeping itself aligned with the enemy. So many ammo were wasted during this testing. Tho the turret works fine
Nightraid [Mine] 14 Dec, 2022 @ 9:42pm 
Btw, I finally made the trigger for the timer work. Well it was working already a while back but what's missing was putting the on/off shoot command on the timer group itself [hd-coax] for the coaxial weapon. But it does not trigger when the drone detects and enemy by itself, it only works when issuing attack commands. I guess this is a limitation brought by WC.
< >
Showing 1-15 of 73 comments
Per page: 1530 50