[SCR] Smart Turrets v4.7.2 (AP, 05-04-14), v2.6 (TC, 21-08-13)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Good point. I think Xtended team hacked a number of built-in turret scripts (missile defence for sure which is what I'm using now, likely missile only and protect ship too) to trigger ECM when ready. There is a single ECM device and a single ECM counter for the entire ship. Good point about keeping one turret with a Missile Defence just for ECM purposes, I'll try that out and see how it works.
Sorry if this has been asked before but since you mentioned: when deciding what laser to set on turrets meant to be good anti-missile, what criteria should I use? Speed only? PAC would be the fastest, followed by PBE and so on, the PBE at least can do decent damage to M5/M4 while the PAC is mostly useless outside of anti-missile purposes.
But for turrets that can sport Alpha/Beta Flaks (which I usually set to Missile Defence) do I need a PAC/PBE besides just the Flak? I think the Flaks are good enough against missiles so I wouldn't sacrifice the second slot of that turret for another good anti-missile laser, I'd instead use an anti-fighter (HEPT & co) laser.
Thanks!
Sorry if this has been asked before but since you mentioned: when deciding what laser to set on turrets meant to be good anti-missile, what criteria should I use? Speed only? PAC would be the fastest, followed by PBE and so on, the PBE at least can do decent damage to M5/M4 while the PAC is mostly useless outside of anti-missile purposes.
But for turrets that can sport Alpha/Beta Flaks (which I usually set to Missile Defence) do I need a PAC/PBE besides just the Flak? I think the Flaks are good enough against missiles so I wouldn't sacrifice the second slot of that turret for another good anti-missile laser, I'd instead use an anti-fighter (HEPT & co) laser.
Thanks!
A turret's lasers qualify for antimissile duty based on the following criteria.
Lasers with lowest refire delay are most preferred, if they have sufficient range. So IRE, PBE, MD likely most preferred, though I don't recall refire delays on XTC. Do be sure to run the training command when new lasers are available, so Smart can sample their refire delays.
If no lasers qualify for antimissile then the special antimissile mode doesn't trigger. Instead missiles are prioritized by that turret against all other targets, and the turret will only shoot the missile if it's highest priority. It won't use the multi-gun spliting feature in this case.
In my experience flak aren't great for anti missile as they don't fire rapidly enough to take out barrages.
In my case I tend to mod my game so that all lasers have 1 volume. This lets me ship every laser combination possible and provides better light shows during combat. I don't need to worry about tradeoffs or sacrificing jump energy and ammo space. I've yet to encounter a downside.
Smart traces out the sorted laser arrays at log level 6 (glen.turret.smart.cache.ship.local: Recache). Here you can see what lasers have been put into each category. Poking something in the DPS cache and restarting the turret script might trigger a recache, I don't recall exactly how to force one.
Code: Select all
414 || $Laser = $CacheSensitive.Delay.Ascending [ $idx ]
415 || gosub CheckWeapon :
416 || if $AllowWeapon
417 ||| * Antimissile:
418 ||| * - By Delay Ascending
419 ||| * - Speed gt 650
420 ||| * - Range lt 5000
421 ||| * - Delay lt 650
422 ||| * - At least 1 DPSCache sample
423 ||| * - At least 1 hull dmg
424 @ ||| $Delay = [THIS] -> call script 'glen.turret.smart.cache.dps' : Option = 0 Laser = $Laser Sample = null
425 @ ||| $Samples = [THIS] -> call script 'glen.turret.smart.cache.dps' : Option = 4 Laser = $Laser Sample = null
426 ||| $Range = get range of laser $Laser
427 ||| $Speed = get bullet speed of laser $Laser
428 ||| $HullDmg = get hull damage of laser $Laser
429 |||
430 ||| if $Samples AND $Delay <= 650 AND $Speed >= 650 AND $Range <= 5000 AND $HullDmg
431 |||| if $Range > $Longest.AntiMissile
432 ||||| $Longest.AntiMissile = $Range
433 ||||| $Lasers.Transient [ 1 ] = $Laser
434 |||| end
435 |||| append $Laser to array $Transient.AntiMissile
436 ||| end
If no lasers qualify for antimissile then the special antimissile mode doesn't trigger. Instead missiles are prioritized by that turret against all other targets, and the turret will only shoot the missile if it's highest priority. It won't use the multi-gun spliting feature in this case.
In my experience flak aren't great for anti missile as they don't fire rapidly enough to take out barrages.
In my case I tend to mod my game so that all lasers have 1 volume. This lets me ship every laser combination possible and provides better light shows during combat. I don't need to worry about tradeoffs or sacrificing jump energy and ammo space. I've yet to encounter a downside.
Smart traces out the sorted laser arrays at log level 6 (glen.turret.smart.cache.ship.local: Recache). Here you can see what lasers have been put into each category. Poking something in the DPS cache and restarting the turret script might trigger a recache, I don't recall exactly how to force one.
Smart reserves ship additional command code 1259 in the community library thread:
http://forum.egosoft.com/viewtopic.php?t=216690
The right approach would be for the conflicting component to respect those reservations and use a non conflicting command code. 1227, 1253 and 1257 look free.
To make a local workaround, the references in the scripts also need updated to point to the renumbered command.
(setup.glen.smart.turret)
(glen.turret.smart.mainguns)
Code: Select all
<t id="1259">COMMAND_TYPE_SHIP_59</t> : Main Guns - Smart Turrets by Shimrod
The right approach would be for the conflicting component to respect those reservations and use a non conflicting command code. 1227, 1253 and 1257 look free.
To make a local workaround, the references in the scripts also need updated to point to the renumbered command.
Code: Select all
190 set script command upgrade : command = [GLEN_SMART_MAINGUNS] upgrade = $RequiredWare script = 'glen.turret.smart.check'
200 global script map : set : key = [GLEN_SMART_MAINGUNS] , class = [Ship] , race = [Player] , script = 'glen.turret.smart.mainguns' , prio = 0
Code: Select all
032 set script command : [GLEN_SMART_MAINGUNS]
I tested vanilla with a hyperion vs Xenon Atmospheric Lifter and Smart keeps the shield at 3%. IIRC shields must be below 10% for boarding.
I can't speak for xrm/sos, just be sure there are small enough lasers available so Smart can chip away at the shields. If only powerful guns are available it won't shoot them if the shot could penetrate to hull.
I can't speak for xrm/sos, just be sure there are small enough lasers available so Smart can chip away at the shields. If only powerful guns are available it won't shoot them if the shot could penetrate to hull.
Shimrod wrote:I tested vanilla with a hyperion vs Xenon Atmospheric Lifter and Smart keeps the shield at 3%. IIRC shields must be below 10% for boarding.
I can't speak for xrm/sos, just be sure there are small enough lasers available so Smart can chip away at the shields. If only powerful guns are available it won't shoot them if the shot could penetrate to hull.
"If only powerful guns are available it won't shoot them if the shot could penetrate to hull"
that might have been the problem. Still missing guns from the ship since i am just beginning a new game..will try to buy some pacs/hepts..
Yours is one excellent script dear Sir!Shimrod wrote: ...
The right approach would be for the conflicting component to respect those reservations and use a non conflicting command code. 1227, 1253 and 1257 look free.
To make a local workaround, the references in the scripts also need updated to point to the renumbered command.
...
Used it all the time playing AP. Many thanks to you.
Now though in Litcube Universe there are some hickups.
Since I'm exactly zero in scripting, my only hope now is (he-he, I sound kind of like princess Lea here) that you post a working version.
Could you find it in yourself to do this?
I'd expect that wing command to issue move/attack orders to the ships but I doubt it'd override the turret commands.
What you might want to do is go into the Wing Command Console, Combat -> Smart -> Broadcast Command -> Smart Capture / Scope Wing. This should replace all Smart Turret commands on the wing ships.
I don't know how subtle the wing's attack shields command would be, but I expect the main guns attacks won't coordinate will annihilate the target. Shield suppression is probably best left to turrets only via Smart Capture.
What you might want to do is go into the Wing Command Console, Combat -> Smart -> Broadcast Command -> Smart Capture / Scope Wing. This should replace all Smart Turret commands on the wing ships.
I don't know how subtle the wing's attack shields command would be, but I expect the main guns attacks won't coordinate will annihilate the target. Shield suppression is probably best left to turrets only via Smart Capture.
Smart's main guns command only switches lasers, it doesn't fire them itself. The firing is done by the ship's command script (fly straight at them firing guns, fly away, repeat).
The ships commands are not part of Smart and won't coordinate their damage output with Smart Turrets commands. How well the ships will coordinate with each other I can't say, never looked at this wing shield attack script.
For info Smart uses a cache stored on the target ship used to record every shot fired by Smart along with an estimated bullet useful lifetime. This is used to estimate the amount of hull and shield damage 'in flight', and Smart Turrets on all attacking ships coordinate using the same cache and fine tune their damage output (selected laser, number of guns fired) to avoid impacting the hull.
I doubt stock scripts will do anything as sophisticated. They probably just stop firing when shields are 0%, ignoring how many bullets are in flight.
The ships commands are not part of Smart and won't coordinate their damage output with Smart Turrets commands. How well the ships will coordinate with each other I can't say, never looked at this wing shield attack script.
For info Smart uses a cache stored on the target ship used to record every shot fired by Smart along with an estimated bullet useful lifetime. This is used to estimate the amount of hull and shield damage 'in flight', and Smart Turrets on all attacking ships coordinate using the same cache and fine tune their damage output (selected laser, number of guns fired) to avoid impacting the hull.
I doubt stock scripts will do anything as sophisticated. They probably just stop firing when shields are 0%, ignoring how many bullets are in flight.
Shimrod, thank you very much for this script!!! Briliant work!
Just tested Smart 4.7.2 in X3:AP 3.1 - It is one of the best scripts I ever met. And I met and tested about 100 scripts in all X2-X3-games.
This one has no glicthes, no troubles, no questions, including all functions I could imagine for turrets use - Just put all other turret-scripts on their knees!
The only thing I dream for the complete X3 combat package - is a friendship of Smart turrets with Weapon loadout hotkey-function. At this moment I use Bombardier, but it can not save smart turrets in configurations (I know that its a bombardier's issue).
So when I need to use some individual type of weapon in particular turret - I switch to this config with hotkey and have to manualy choose Smart Turret Custom Order for my turrets.
At least it would be good if Smart turrets Custom command could be activated by one hotkey.
Just tested Smart 4.7.2 in X3:AP 3.1 - It is one of the best scripts I ever met. And I met and tested about 100 scripts in all X2-X3-games.
This one has no glicthes, no troubles, no questions, including all functions I could imagine for turrets use - Just put all other turret-scripts on their knees!
The only thing I dream for the complete X3 combat package - is a friendship of Smart turrets with Weapon loadout hotkey-function. At this moment I use Bombardier, but it can not save smart turrets in configurations (I know that its a bombardier's issue).
So when I need to use some individual type of weapon in particular turret - I switch to this config with hotkey and have to manualy choose Smart Turret Custom Order for my turrets.
At least it would be good if Smart turrets Custom command could be activated by one hotkey.
Thanks, it certainly gives MARS a run for its money.
I haven't tried Bombardier before, sounds odd that it can't save turret loadouts with Smart, especially if laser switching is disabled on the active Smart command.
You can disable laser switching on all of the Smart configurations via Combat -> Smart -> Turret Command Profiles. This is probably the best option if manually switching weapon configs.
There is a hotkey for cycling between Smart commands. You could also customize all turret command profiles to do exactly the same thing, so the hotkey always produces a predictable configuration. However the hotkey only affects turrets with Smart already enabled on them.
Sounds like what you need is a set of hotkeys for applying Smart <cmd> to all turrets on the playership. Assuming disabling laser switching on all profiles doesn't resolve the bombardier problem.
Actually there's an argument to say that would be best done as a standalone script. A single setup script which tests for presence of MARS, Smart, vanilla scripts and registers hotkeys accordingly. Should be straightforward to code that.
However I'm unlikely to be doing any development on this in the near term, particularly not now that Homeworld Remastered has been released!
I haven't tried Bombardier before, sounds odd that it can't save turret loadouts with Smart, especially if laser switching is disabled on the active Smart command.
You can disable laser switching on all of the Smart configurations via Combat -> Smart -> Turret Command Profiles. This is probably the best option if manually switching weapon configs.
There is a hotkey for cycling between Smart commands. You could also customize all turret command profiles to do exactly the same thing, so the hotkey always produces a predictable configuration. However the hotkey only affects turrets with Smart already enabled on them.
Sounds like what you need is a set of hotkeys for applying Smart <cmd> to all turrets on the playership. Assuming disabling laser switching on all profiles doesn't resolve the bombardier problem.
Actually there's an argument to say that would be best done as a standalone script. A single setup script which tests for presence of MARS, Smart, vanilla scripts and registers hotkeys accordingly. Should be straightforward to code that.
However I'm unlikely to be doing any development on this in the near term, particularly not now that Homeworld Remastered has been released!
Shimrod wrote:I haven't tried Bombardier before, sounds odd that it can't save turret loadouts with Smart, especially if laser switching is disabled on the active Smart command.
Bombardier CAN save any LOADOUTS. And it CAN save turret COMMANDS only which it KNOWS or "none" commands. So it can save vanilla commands or the one modified - vudu.turret.attack.my.target (Link to russia/direct download), which I used for ages.
If you trying to save any other commands - you will have "none" commands, when load this profile. I have tested it with MARS and Smart Turrets. Thats why I need hotkey to activate Smart Turrets.
So I could load desired Bombardier profile, then turn on the Smart for all turrets with hotkey, and then cycle Smart commands if needed.
The point is to start with Custom command set to "No Switching Lasers" and then proceed to "switching lasers" Smart configurations if needed.
At present after swithing loadouts I have to make a lot of actions: "open ship command console LIST to turret control - enter - LIST to Smart commands - find Smart Custom (without switching lasers) - enter." Two key-pressing and two listing actions. Too much during the fight.
Shimrod wrote: You can disable laser switching on all of the Smart configurations via Combat -> Smart -> Turret Command Profiles. This is probably the best option if manually switching weapon configs.
Yes it could be a decision - but only if I save all bombardiers profiles with NONE command for ALL turrets. Then activate Smart Turrets to Custom or w/o switching lasers. After that I can switch to any loadout without loosing Smart in turrets.
Actually I like Smart switching - it is perfect. But sometimes I need specific loadout. Mostly for concentrated fire from capital big guns with turret set to command "My target only" and forecasting tracking of this target. It vastly helps to kill enemy capital ships faster.
That's why I need second hotkey to enable Smart turrets.Shimrod wrote:There is a hotkey for cycling between Smart commands. You could also customize all turret command profiles to do exactly the same thing, so the hotkey always produces a predictable configuration. However the hotkey only affects turrets with Smart already enabled on them.
Or make Bombardier to be able to remember Smart in profiles.
Or ability to activate Smart Custom Command in all turrets whit "None" command pressing "Cycle" key if they are present on my ship. And next press makes them equal to other turrets with active Smart if they were on my ship.
Shimrod wrote:Sounds like what you need is a set of hotkeys for applying Smart <cmd> to all turrets on the playership. Assuming disabling laser switching on all profiles doesn't resolve the bombardier problem.
Yes indeed!!!
At least one key to enable Custom, and then I can switch them with "Cycle" hotkey.
Shimrod wrote:Actually there's an argument to say that would be best done as a standalone script. A single setup script which tests for presence of MARS, Smart, vanilla scripts and registers hotkeys accordingly. Should be straightforward to code that.
Do it! Please-please-please! It would be great!
Yeah! Homeworld is a Classic and Relic.Shimrod wrote:However I'm unlikely to be doing any development on this in the near term, particularly not now that Homeworld Remastered has been released!
Well if you accidently will have time and mood to do it - at least you could make just one hotkey to activate Smart Custom in all turrets.
It would make Smart compatible with most of the other weapon loadout scripts.
Last edited by redagent on Thu, 19. Mar 15, 01:09, edited 4 times in total.