[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
- hourheroyes
- Posts: 346
- Joined: Mon, 9. Apr 12, 05:14
It might be possible to implement missile strafing through script, but I think it's outside the scope of Smart and probably best linked to a ware upgrade like missile evasion software.
While excluding boarding pods I came across a mothballed copy of Smart with a fairly sophisticated countermissile system, am looking at resurrecting it:
- Countermissiles fired from ship and from missile turrets
- Any ship could intercept missiles incoming to all that races ships
- Calculates longer range intercept point based on speed and range of the countermissile vs speed and range of the incoming missile.
If we allow for longer range countermissiles, these could intercept barrages real far away, greatly reducing the risk of any reaching the player as there'd be plenty of time to launch more countermissiles. Though as it stands the code just uses the standard 'get best missile for target' script that pretty much just returns mosquitoes.
While excluding boarding pods I came across a mothballed copy of Smart with a fairly sophisticated countermissile system, am looking at resurrecting it:
- Countermissiles fired from ship and from missile turrets
- Any ship could intercept missiles incoming to all that races ships
- Calculates longer range intercept point based on speed and range of the countermissile vs speed and range of the incoming missile.
If we allow for longer range countermissiles, these could intercept barrages real far away, greatly reducing the risk of any reaching the player as there'd be plenty of time to launch more countermissiles. Though as it stands the code just uses the standard 'get best missile for target' script that pretty much just returns mosquitoes.
Not firing boarding pods is good, what about missile turrets holding fire with capture status?
WRT strafing, I've observed difficulty turrets and main guns have hitting swarm missiles even with the gentle rolling movement. I have no idea if it would be easy to duplicate.
My shiny new Cobra also demonstrated vanilla missiles and torpedoes are fairly limp against smart turret NPC capitals.
WRT strafing, I've observed difficulty turrets and main guns have hitting swarm missiles even with the gentle rolling movement. I have no idea if it would be easy to duplicate.
My shiny new Cobra also demonstrated vanilla missiles and torpedoes are fairly limp against smart turret NPC capitals.
Yes I plan to have the missile turrets hold fire too, except for countermissile activity.
What you might be seeing with missing bullets missing or not destroying missiles is some combination of:
- Inaccuracy built into that laser
- Reduced size of hit box on the missile
- Missile hitpoints
- Spiral motion defeating the game's target leading logic, like when turrets shoot an undocking khaak cluster that is spiralling and end up shooting far wide.
All Smart does is tell the turret X to shoot at target Y, it doesn't have control over accuracy or target lead prediction.
I haven't had an M7M for a long time but I'll get plenty of exposure with testing the countermissile feature. With replicators on board I'll be happier to have them in my fleet. What tends to put me off is:
- collateral torpedo damage agroing neutral ships & killing my fighters
- missiles detonating on launch and destroying the M8 + killing my fighters
- friendly stations or ships being in between the missile boat and its target
What you might be seeing with missing bullets missing or not destroying missiles is some combination of:
- Inaccuracy built into that laser
- Reduced size of hit box on the missile
- Missile hitpoints
- Spiral motion defeating the game's target leading logic, like when turrets shoot an undocking khaak cluster that is spiralling and end up shooting far wide.
All Smart does is tell the turret X to shoot at target Y, it doesn't have control over accuracy or target lead prediction.
I haven't had an M7M for a long time but I'll get plenty of exposure with testing the countermissile feature. With replicators on board I'll be happier to have them in my fleet. What tends to put me off is:
- collateral torpedo damage agroing neutral ships & killing my fighters
- missiles detonating on launch and destroying the M8 + killing my fighters
- friendly stations or ships being in between the missile boat and its target
That's the general idea for a new generation of corkscrewing missilesShimrod wrote: - Spiral motion defeating the game's target leading logic, like when turrets shoot an undocking khaak cluster that is spiralling and end up shooting far wide.
All Smart does is tell the turret X to shoot at target Y, it doesn't have control over accuracy or target lead prediction.
I don't think a mod like that exists out there or if there is, I missed it. XRM boosts the missile speed towards similar end.
4.7.1 released.
4.7.1
- Launch countermissiles from missile turrets and the ship itself like mosquito defence. This feature can be disabled in the menu.
- Made missile turrets hold fire when in capturing mode
- Stopped missile turrets firing boarding pods
- Set a floor on main guns laser switching iteration time equal to the current laser refire delay, to help remedy higher than normal rate of fire caused by the laser switching when guns are being fired.
- Added support for Advanced Fight Scripts by publishing laser turret target
- As both vanilla and XRM halve the missile refire delay between missile turret volleys, do the same with Smart missile turrets for balance.
- Add a missile turret setting for using swarm class missiles on huge ships. Off by default.
- If it would take more than 250 missiles of the ships best available type to destroy a target then hold fire on the missile turret.
4.7.1
- Launch countermissiles from missile turrets and the ship itself like mosquito defence. This feature can be disabled in the menu.
- Made missile turrets hold fire when in capturing mode
- Stopped missile turrets firing boarding pods
- Set a floor on main guns laser switching iteration time equal to the current laser refire delay, to help remedy higher than normal rate of fire caused by the laser switching when guns are being fired.
- Added support for Advanced Fight Scripts by publishing laser turret target
- As both vanilla and XRM halve the missile refire delay between missile turret volleys, do the same with Smart missile turrets for balance.
- Add a missile turret setting for using swarm class missiles on huge ships. Off by default.
- If it would take more than 250 missiles of the ships best available type to destroy a target then hold fire on the missile turret.
Yes, in the TC version it'll equip highest shield dmg per shot lasers when OOS.
Turret scripts get disabled by the game when ships are OOS but Smart has another script running on the ship which swaps lasers when OOS. This sleeps for 1-2 minutes between iterations so won't immediately react to equipment changes.
Turret scripts get disabled by the game when ships are OOS but Smart has another script running on the ship which swaps lasers when OOS. This sleeps for 1-2 minutes between iterations so won't immediately react to equipment changes.
They're independent scripts and don't conflict with each other. You could install both and try a spell with each to see which suits you best.
Smart doesn't have the drones. They both share functionality of being laser switching turret scripts and can be enabled on enemy ships. Both switch in lasers when OOS and avoid station friendly fire.
Some of Smart's features (in AP) include:
- Works with missile and laser turrets
- Built in countermissile (mosquito defence) functionality
- Can fire lasers and countermissiles at missiles incoming to friendlies
- Has capturing modes that can be used to suppress shields for capturing, or to chip away at hull for bailing.
- Fires individual turret guns at incoming missiles to take down barrages faster (more effective in plain TC without the missile hitpoints)
- Doesn't require mod specific datafiles
- Avoids jumpgate friendly fire by turning the gate neutral
Smart doesn't have the drones. They both share functionality of being laser switching turret scripts and can be enabled on enemy ships. Both switch in lasers when OOS and avoid station friendly fire.
Some of Smart's features (in AP) include:
- Works with missile and laser turrets
- Built in countermissile (mosquito defence) functionality
- Can fire lasers and countermissiles at missiles incoming to friendlies
- Has capturing modes that can be used to suppress shields for capturing, or to chip away at hull for bailing.
- Fires individual turret guns at incoming missiles to take down barrages faster (more effective in plain TC without the missile hitpoints)
- Doesn't require mod specific datafiles
- Avoids jumpgate friendly fire by turning the gate neutral
Speaking about being independent scripts, using Smart Turrets with XTended 2.2a, I assume that means I lose the ECM functionality of the Xtended hacked vanilla turret scripts?
Tough choice... lose ECM (which is absolute awesome as it can take down any number of missiles in range and recharges quickly and can be equipped on anything M6 and up) and stick with the silly vanilla turrets scripts of trying to hit M5s with a T. Cannon or start using Smart Turrets (get much better anti-fighter turret behaviour) but lose ECM and likely increase the chances of getting hit by missiles when many are incoming.
Tough choice... lose ECM (which is absolute awesome as it can take down any number of missiles in range and recharges quickly and can be equipped on anything M6 and up) and stick with the silly vanilla turrets scripts of trying to hit M5s with a T. Cannon or start using Smart Turrets (get much better anti-fighter turret behaviour) but lose ECM and likely increase the chances of getting hit by missiles when many are incoming.
There's no ECM support in Smart, however it can be quite efficient at taking down missiles particularly in TC with no missile hitpoints, as it simulates firing individual turret guns independently at separate missiles.
Smart's anti-missile prowess was a big deal at least until AP introduced missile hitpoints. If you have multi gun turrets like on M7/M2, with fast firing lasers available (ideally beams), its really awesome in TC.
Wouldn't an ECM make more sense as an additional ship command, or is that XTC simulates each turret running an independent ECM system? If all turrets share a single ECM timer, how about setting 1 turret to a standard turret command to enable ECM, while using Smart on the other turrets?
Smart's anti-missile prowess was a big deal at least until AP introduced missile hitpoints. If you have multi gun turrets like on M7/M2, with fast firing lasers available (ideally beams), its really awesome in TC.
Wouldn't an ECM make more sense as an additional ship command, or is that XTC simulates each turret running an independent ECM system? If all turrets share a single ECM timer, how about setting 1 turret to a standard turret command to enable ECM, while using Smart on the other turrets?
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]