Space Engineers

Space Engineers

Whip's Turret Ai Slaving Script WC Addon
38 Comments
Smax4455 25 Mar, 2023 @ 12:59pm 
it doesnt find PB with Whip script :c
Perryax 20 Dec, 2022 @ 9:24am 
my script doesn't detect the PB. Does it need a specific name?
Siam 3 Jul, 2022 @ 2:30pm 
Does it work with the custom turret controler
eg: I create a bunch of custom turret that are aimed for bombardment of targets below my ship (did somebody asked an exterminatus?) and I want all of them to shoot at the same time at the same place.
Sparktite 6 Dec, 2021 @ 4:09pm 
So if I'm to understand this correctly, this will take weapons slaved to a designator turret and set the convergence point for those turrets to the distance that the designator detects an enemy at?
Sigmund Froid  [author] 6 Jun, 2021 @ 11:18pm 
Nope. I have an own rotor turret script in the linked Collection though. Though it's lacking the advanced LoS check Whip's script (unless Darkstars recent API update added them)
Kittamaru 6 Jun, 2021 @ 7:29pm 
Stupid question... with this script, does this mean that Whips Script will work to slave player made turrets using WC Weapons to a WC Turret as well?
Const 10 Mar, 2021 @ 2:31am 
oh well i'm dumb. misunderstood the script. thanks for the time anyway!
Sigmund Froid  [author] 10 Mar, 2021 @ 2:25am 
Well that wasn't the point of the script, it was designed to have the slaved turrets focus the target of the main designator. For other focus you could use WCs focus targeting.
Const 10 Mar, 2021 @ 2:06am 
alright, now detects the PB, and says that it's managing a rotor turret. but it doesn't seem to track targets beyond the main designator's range

do i have to edit some variables inside the addon script to make it work?
Sigmund Froid  [author] 15 Feb, 2021 @ 12:56am 
Last time I checked it worked but I'll do another check on it
Const 14 Feb, 2021 @ 8:13pm 
does the script still work the latest version of turret slaving? everytime i use it, it says 0 PBs with whip's script, even though I have the slaving script on the grid
salin_soulok 30 Jan, 2021 @ 9:55am 
i dont know what im doing wrong but i cant get this script to work what all must i do? i have this pb on the same grid as whip's and it clames it cant find the pb
Sigmund Froid  [author] 9 Jan, 2021 @ 5:38am 
You need to use it along side whip's script.
FireManDan 9 Jan, 2021 @ 5:16am 
Do you 7se this along side whips script or stand alone?
Cpt. Cheesecake 31 Dec, 2020 @ 7:15pm 
I personally use the MA designator as it self creates ammo out of energy on the grid, so it's place and play!
ExCaedibus 15 Dec, 2020 @ 5:23am 
Is there a WC-compatible Designator turret meanwhile?
I don't want to use a normal turret that fires unnecessary ammo (could it confuse WC with its own trajectory and speed?) that only "designates" a target while firing. There were a few nice ones around before WC but none compatible, how is it now?
Sigmund Froid  [author] 22 Sep, 2020 @ 9:50am 
@MikeDude Target Communication would be possible using his IGC but weapon firing would need edit's to the script itself. Additionally I held back on it as Alysius told me he is working on adding support. He hasn't reached out for help yet so I assume he's just busy with more important
matters.
Mike Dude 22 Sep, 2020 @ 8:58am 
Were you able to look into Diamond Dome System and see if this could be made to also support that script for target and fixed weapon firing?
Sigmund Froid  [author] 30 Aug, 2020 @ 1:08am 
IMyLargeTurretBase.ApplyAction("ShootOnce") and similiar work now, however they don't set values like IsShooting or HasTarget, or implement getTargetedEntity(). It's unlikely that these will be added as I shouldn't even be able to call them on the weapons. I only tested with MWI collection 1 so maybe that's why it partialy works but we're a step closer to have vanilla scripts work with WC, however it might never fully happen.
Sigmund Froid  [author] 29 Aug, 2020 @ 2:46pm 
Well I don't use discord for various reasons but you may tell him that I asked on his guide to DDS if he finds a moment to spare for this (Somebody asked just 2 days ago if it's WC compatible and got an answer, however I'm patient, more time to built rotor turrets for WC :steamhappy: )
Mike Dude 29 Aug, 2020 @ 2:42pm 
That would be awesome if you're able to add that. He is on Singapore time I believe so he may not replay for a while. He's also in our server's discord too and I've been forwarding your guide and stuff.
Sigmund Froid  [author] 29 Aug, 2020 @ 2:31pm 
Because of the nature of the framework WC only provides Conveyor Sorters/ IMyTerminalBlocks which inherently don't have those lines. Also I think there would be issues with keens normal implementation trying to react to it, you'd have to ask Darkstar though for confirmation imjust assuming from my limited knowledge. I've asked Alysius for his IGC format so I can start working on the script (probably just a edit of my addon for Whip's script)
Mike Dude 29 Aug, 2020 @ 2:27pm 
I wonder why the WC team didn't just add those two lines back into their turrets...
Sigmund Froid  [author] 29 Aug, 2020 @ 2:19pm 
I could probably hijack DDS's target communication as I did with Whip's Turret Based Radar Script, depends on the information sent.
Sigmund Froid  [author] 29 Aug, 2020 @ 2:15pm 
Well Whip's no didn't prevent adding compatibility though ;P

To your problem: Simply put, IMyLargeTurretBase.HasTarget and IMyLargeTurretBase.ApplyAction("ShootOnce") both don't work with WC weapons, the first because that property doesn't exist the second because the action doesn't exist for these blocks. As replacement you have to add WcPbApi.GetWeaponTarget and null check it for the first one. For the second you'd add WcPbApi.ToggleWeaponFire or WcPbApi.FireWeaponOnce and call those. You can defnitely tell Alysius about my guide linked above. Because of how the API works I doupt though that he'll be able to fit it into his script. (With all blank spaces it's about 9k characters)
Mike Dude 29 Aug, 2020 @ 1:52pm 
Ha I'm just happy they were able to add the API and people are using it. I was hoping the big name scripts would be adding WC compatibility but Whip just said straight up he's not adding anything from other mods in his script. Alysius hasn't gotten around to adding anything for WC into his script yet either which I'm really bummed about.

DDS's primary means of receiving target data is through the DDS Designators turret group, and it just doesn't work at all on even the WC vanilla replacement. It looks like there may be the 2nd challenge of firing those WC weapons that are on the turret too.
Sigmund Froid  [author] 29 Aug, 2020 @ 1:42pm 
Hey Mike Dude! I kinda owe it to you that I got some small fame here. I'll investigate if this is possible however I've never used DDS before, so it might take some time.
Mike Dude 29 Aug, 2020 @ 1:26pm 
Hey do you think this will work with Alysius' Diamond Dome System for his required Designator turret groups too?
Izidore 24 Aug, 2020 @ 9:49am 
BANG! I knew I was doing something wrong. Thank you!
Sigmund Froid  [author] 24 Aug, 2020 @ 9:05am 
Weapon core will only detect grids with at least one weapon, to avoid destoying salvagable debris.
Izidore 24 Aug, 2020 @ 8:30am 
I am obviously doing something wrong. Convergence Range just defaults to max. So how does RDAV's determine what is considered a target? Maybe the targets I used do not meet the criteria for a 'target'(?). I set up large 'rectangles' made of large blocks, stuck an antenna on them (with power), changed them to neutral and enabled target neutral on the turrets.
Izidore 24 Aug, 2020 @ 6:13am 
This is absolutely awesome. I will get this going as soon as I can. As far as my kind words; you are being extremely modest.
Sigmund Froid  [author] 24 Aug, 2020 @ 1:23am 
Yup works. Pretty much the same way Rdav's Fleet Command finds its targets via turret UI. The script will always take the closest target in the direction of the turret (Had 1398 as convergence with a designator with 2.2k range, target was ~1.4k out and behind it a target at ~2.1k)
Sigmund Froid  [author] 23 Aug, 2020 @ 2:14pm 
Just thought about something that might work with controlled turrets, I'll test it tomorrow and will report back with the results.
Izidore 23 Aug, 2020 @ 11:44am 
If taking targeting distance from an AI turret is a feasible option I would appreciate that addition if it is not too much trouble. Thanks again.
Sigmund Froid  [author] 23 Aug, 2020 @ 9:39am 
For taking the range of the target the designator would need to be Ai controlled, if that is what you want I can add this.
Also the turret script was my work of the last three days, so it was already almost finished when you came in with your request. As it's quite easy to do that once you wrap your head around the API, I don't deserve these kind words, I'll take them, but I don't deserve them. ;P
Izidore 23 Aug, 2020 @ 7:53am 
I noticed that in a few short minutes after developing this script you developed and published a completely new script to support WC weapons on PM Rotor Turrets. Your industriousness is truly astounding. I am blinded by the brilliance of your scripting genius as I tread water in the bubbling cauldron of mediocrity. :) Anyway thanks again for what you do.
Izidore 23 Aug, 2020 @ 7:46am 
First I would like to say thank you very much for indulging my request. I truly appreciate your time, effort, patience and scripting skill. I will use this script in its current form, however, at the risk of sounding ungrateful (which I am not - I am very grateful), I was shooting for something a bit more dynamic. I was hoping that it was possible to grab the target distance from the designator turret meaning the distance to the grid the designator is currently aiming at as opposed to just setting the convergence point to the max range of the designator. Based on the AI Turret Radar Script I knew it was possible to determine the actual range of a target and was hoping this could transfer to my application. I suspect that the issue is that once the turret is no longer 'AI' and it is 'controlled' by a player that data is no longer captured or produced.