[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
-
- Posts: 693
- Joined: Fri, 21. Jan 05, 00:44
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Smart isn't applied on enemy NPC ships main guns. I don't recall the rationale why not, perhaps something to do with the set of lasers that spawn on enemy fighters.
The maingun task shares the same laser selection routines as regular turrets. The only problem I'm aware of with mainguns is that the laser switching interrupts the natural fire delays when shooting those lasers, producing an abnormally higher rate of fire and DPS noticeably on bigger ships with slower lasers. The energy usage is obviously higher though.
No problem.
Edit: Added the text in italics to first paragraph as it looked wrong when I re-read it.
The maingun task shares the same laser selection routines as regular turrets. The only problem I'm aware of with mainguns is that the laser switching interrupts the natural fire delays when shooting those lasers, producing an abnormally higher rate of fire and DPS noticeably on bigger ships with slower lasers. The energy usage is obviously higher though.
No problem.
Edit: Added the text in italics to first paragraph as it looked wrong when I re-read it.
Last edited by Shimrod on Mon, 18. Feb 13, 01:43, edited 1 time in total.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
I've released AP version 4.5 with a fix for the issue garrry34 found.
Gratuitous low level detail: in capturing mode when picking a shield suppression laser vs bigship targets (GetBestLaser.Capping.BigShip), if no available laser is suitable (i.e would penetrate hull) the routine was leaving the last laser it tested still mounted in bay 0 causing the turret to end up shooting, and with a crazy refire rate. The fix clears the laser in bay 0 before returning (like in GetBestLaser.Capping.SmallShip).
4.5
- Fix a bug in capturing mode vs big ships which could make the turret go nuts and destroy the target when it should instead be holding fire.
Gratuitous low level detail: in capturing mode when picking a shield suppression laser vs bigship targets (GetBestLaser.Capping.BigShip), if no available laser is suitable (i.e would penetrate hull) the routine was leaving the last laser it tested still mounted in bay 0 causing the turret to end up shooting, and with a crazy refire rate. The fix clears the laser in bay 0 before returning (like in GetBestLaser.Capping.SmallShip).
4.5
- Fix a bug in capturing mode vs big ships which could make the turret go nuts and destroy the target when it should instead be holding fire.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
I've been playing XTC 2.0 using the TC version of Smart (2.3) and thought I'd share my observations:
1. Flakiness in main guns laser selection
2. Weak lasers used to shoot TS
3. Weak lasers used to shoot fighters and M6 at shorter ranges. This is due to the desired bullet speed vs ship class/speed/range model being derived from XRM playtesting, with its particular laser/bullet and ship characteristics.
4. Possible ammo based laser selection when no ammo is available (more testing required).
5. Possible broadcast command problem (could not roll out Smart Defence to 10x TS docked in shipyard)
I've made local changes to address these (#4,#5 TBD) including an updated bullet speed model that works very nicely on XTC. PPC is an appropriate choice vs fighters hovering near by my python, while faster lasers are selected when the fighters are manoeuvring.
I don't immediately plan to release an update though as I want to smoke test the balance on XRM, and there's a lot of mileage left in my XTC game before I want to switch. I do hope the the 3 factors in the formula (ship class, speed, range) scale out seamlessly in XRM, but last time I played XRM bullet accuracy and beam lasers made it difficult to produce a generic model that works well in all cases.
I've always developed scripts to fit how I personally play X, and because I have AP and there's a better version of Smart for AP (which can detect laser flags through new APIs and thus work better with XRM's lasers), I'm also inclined to focus my testing on Smart to configurations I actually play, as follows:
AP version - Vanilla, XRM
TC version - XTC
In other words, I want to avoid expending effort testing the TC version of Smart on vanilla and XRM. So do let me know if anyone is stuck on TC (and I sympathize with the Steam requirement), and relies on the TC version of Smart with vanilla/XRM. Bearing mind there is also MARS.
1. Flakiness in main guns laser selection
2. Weak lasers used to shoot TS
3. Weak lasers used to shoot fighters and M6 at shorter ranges. This is due to the desired bullet speed vs ship class/speed/range model being derived from XRM playtesting, with its particular laser/bullet and ship characteristics.
4. Possible ammo based laser selection when no ammo is available (more testing required).
5. Possible broadcast command problem (could not roll out Smart Defence to 10x TS docked in shipyard)
I've made local changes to address these (#4,#5 TBD) including an updated bullet speed model that works very nicely on XTC. PPC is an appropriate choice vs fighters hovering near by my python, while faster lasers are selected when the fighters are manoeuvring.
I don't immediately plan to release an update though as I want to smoke test the balance on XRM, and there's a lot of mileage left in my XTC game before I want to switch. I do hope the the 3 factors in the formula (ship class, speed, range) scale out seamlessly in XRM, but last time I played XRM bullet accuracy and beam lasers made it difficult to produce a generic model that works well in all cases.
I've always developed scripts to fit how I personally play X, and because I have AP and there's a better version of Smart for AP (which can detect laser flags through new APIs and thus work better with XRM's lasers), I'm also inclined to focus my testing on Smart to configurations I actually play, as follows:
AP version - Vanilla, XRM
TC version - XTC
In other words, I want to avoid expending effort testing the TC version of Smart on vanilla and XRM. So do let me know if anyone is stuck on TC (and I sympathize with the Steam requirement), and relies on the TC version of Smart with vanilla/XRM. Bearing mind there is also MARS.
-
- Posts: 3395
- Joined: Thu, 26. Jan 06, 19:45
I just picked up on the XTC v2 release couple of days ago ( a bit late to the party ) ..
I love Mars, but always found it too heavy for my needs, Smart 2.3 is wonderful and fits the bill for vanilla X3TC game for me, and I was wondering earlier today if you may do an XTC v2 compatible Smart ..
I didn't post because I thought you may not be interested in a whole new game setup just to support it.
I for one would very much appreciate an XTC v2 compatible version if it needs one specifically. There are other people already trying your current v2.3 who claim it to be compatible with XTC .. but to be honest I have my doubts and am just playing XTC as intended ( 3.2 game patch, no bonus pack, no mods or scripted mods ).
Its on this compatability list already http://forum.egosoft.com/viewtopic.php? ... sc&start=0
( I have DVD retail X3TC ( not steam ) .. Haven't ventured down the AP path yet, was waiting for XTC to come along
)
I love Mars, but always found it too heavy for my needs, Smart 2.3 is wonderful and fits the bill for vanilla X3TC game for me, and I was wondering earlier today if you may do an XTC v2 compatible Smart ..
I didn't post because I thought you may not be interested in a whole new game setup just to support it.
I for one would very much appreciate an XTC v2 compatible version if it needs one specifically. There are other people already trying your current v2.3 who claim it to be compatible with XTC .. but to be honest I have my doubts and am just playing XTC as intended ( 3.2 game patch, no bonus pack, no mods or scripted mods ).
Its on this compatability list already http://forum.egosoft.com/viewtopic.php? ... sc&start=0
( I have DVD retail X3TC ( not steam ) .. Haven't ventured down the AP path yet, was waiting for XTC to come along

-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Smart was tested against the initial version of XTC, sufficient to flush out major compatibility issues. However I didn't play the original much and the majority of feedback/bugs I've had have been vs XRM or vanilla, so XTC hasn't factored much into Smart's recent balancing.
However I'm heavily into XTC 2.0 right now, and Smart is naturally my turret script of choice so the TC 2.x version is coming out of retirement and getting some attention.
I found Smart 2.3 to be compatible out of the box with XTC 2.0. However it has too much bias on selecting fast lasers vs fighters over heavier guns.
The main goal of Smart is to automatically detect the best laser for the job without reliance on mod specific hint data, so that it works with any bullet/laser mod automatically. However in practice its difficult to achieve a balance that works between vanilla, XRM and XTC, simply because the script has a limited view of laser and bullet data. This has improved in AP with visibility on laser flags and refire delays, but the script still hasn't got a complete picture.
So Smart 2.x works on XTC 2.0 but there'll need to be a 2.4 patch before it'll pick better lasers for shooting fighters.
However I'm heavily into XTC 2.0 right now, and Smart is naturally my turret script of choice so the TC 2.x version is coming out of retirement and getting some attention.
I found Smart 2.3 to be compatible out of the box with XTC 2.0. However it has too much bias on selecting fast lasers vs fighters over heavier guns.
The main goal of Smart is to automatically detect the best laser for the job without reliance on mod specific hint data, so that it works with any bullet/laser mod automatically. However in practice its difficult to achieve a balance that works between vanilla, XRM and XTC, simply because the script has a limited view of laser and bullet data. This has improved in AP with visibility on laser flags and refire delays, but the script still hasn't got a complete picture.
So Smart 2.x works on XTC 2.0 but there'll need to be a 2.4 patch before it'll pick better lasers for shooting fighters.
-
- Posts: 3395
- Joined: Thu, 26. Jan 06, 19:45
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
I've uploaded version 2.4 of the TC version, optimized for use with XTC.
As previously noted, going forward the TC version of Smart will be tested only with XTC, while the newer and more feature rich AP version will get broader testing, and is already optimized for XRM.
As I watch the 5 energy buyers in my complex competing to buy their goods from the same factory, I'm sorely tempted to make some intelligent trade commands. Smart Traders?
Smart Trader
- By default operates as an independent automated trader
- Specifying a homebase setting tethers it to trading goods for a factory
- Defaults to trading all goods in either mode, or optionally specify a restricted set.
As previously noted, going forward the TC version of Smart will be tested only with XTC, while the newer and more feature rich AP version will get broader testing, and is already optimized for XRM.
As I watch the 5 energy buyers in my complex competing to buy their goods from the same factory, I'm sorely tempted to make some intelligent trade commands. Smart Traders?
Smart Trader
- By default operates as an independent automated trader
- Specifying a homebase setting tethers it to trading goods for a factory
- Defaults to trading all goods in either mode, or optionally specify a restricted set.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
There is definitely room for better traders. Commercial Agent and Commodity Logistics Support are needlessly complicated -- beginning with their names.Shimrod wrote:I'm sorely tempted to make some intelligent trade commands. Smart Traders?

Have you tried MK3 Improvement? It solves all of the problems with vanilla Mk3's, and it even addresses economy problems (by prioritizing factories that are stalled due to insufficient resources). I find that they do most of the trading that I need to do (I never need CAG with Improved Mk3's).
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Looks interesting. I've never found standard UT profits particularly good or the levelling concept appealing. They do ok with p2p jumpdrives at max level though.
Initially I'm just interested in coordinating buyers and sellers in my complex:
- The complex makes 4 kinds of lasers which produce slowly and sell to EQ docks. Currently I need to have 4 seller ships even though 1 that sold all 4 would suffice.
- The complex has huge energy requirements. A closed SPP XL loop produces a basic turnover but even with 5 drake energy buyers, it's not stockpiling at the rate it needs to because they aren't coordinated with each other, and causes diminishing returns on more buyers.
- It can't hurt to have 1 buyer assigned to finding deals on intermediate goods (ore, silicon, chelt, etc), which will help fill up the factory and reduce energy consumption.
I don't care to worry about levelling, weird equipment combinations required to enable functionality, paying wages, doing annual appraisals or whatever.
Initially I'm just interested in coordinating buyers and sellers in my complex:
- The complex makes 4 kinds of lasers which produce slowly and sell to EQ docks. Currently I need to have 4 seller ships even though 1 that sold all 4 would suffice.
- The complex has huge energy requirements. A closed SPP XL loop produces a basic turnover but even with 5 drake energy buyers, it's not stockpiling at the rate it needs to because they aren't coordinated with each other, and causes diminishing returns on more buyers.
- It can't hurt to have 1 buyer assigned to finding deals on intermediate goods (ore, silicon, chelt, etc), which will help fill up the factory and reduce energy consumption.
I don't care to worry about levelling, weird equipment combinations required to enable functionality, paying wages, doing annual appraisals or whatever.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
100% agreed.Shimrod wrote:I don't care to worry about levelling, weird equipment combinations required to enable functionality, paying wages, doing annual appraisals or whatever.
If a script does have special requirements, it should say so, in-game. Like in the "info" text, for example.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 3395
- Joined: Thu, 26. Jan 06, 19:45
Many thanks ShimrodShimrod wrote:I've uploaded version 2.4 of the TC version, optimized for use with XTC.
As previously noted, going forward the TC version of Smart will be tested only with XTC, while the newer and more feature rich AP version will get broader testing, and is already optimized for XRM.
As I watch the 5 energy buyers in my complex competing to buy their goods from the same factory, I'm sorely tempted to make some intelligent trade commands. Smart Traders?
Smart Trader
- By default operates as an independent automated trader
- Specifying a homebase setting tethers it to trading goods for a factory
- Defaults to trading all goods in either mode, or optionally specify a restricted set.
I also grabbed your AP version too, I have resisted temptation too long, and the realisation that there is a no steam exe for AP ( enabling a couple of different installation locations so I can keep an XTC game going aswell ) was the clincher.
So now I have two game setups, one for XTC with smart 2.4, and a no steam separate install AP with smart 4.5
Early days yet for AP, but I have a pirate centaur in XTC kitted out with quite a few weapon loads which smart can swap in / out .. See how that goes, it certainly seems to be able to hold up quite a fight so far and earning me some nice rep remotely.

-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
If using smart on the centaur's main guns, be sure to activate training through the menu so it can discover the DPS of the available lasers. While turrets train on lasers automatically the main guns are fired manually so Smart can't otherwise measure refire delays, in case it never tested those particular lasers before.
The DPS values for lasers remain cached for the duration of the game thereafter so it's just something to worry about when first setting up. You can see the cached values in the Smart menu under DPS Cache. I found this handy in XTC as its easy to compare and see which lasers have the best DPS, as cargo limits make it difficult to max out on every laser combo for each ship.
No need to worry about training in the AP version though, they added script APIs to query more detailed laser statistics, which Smart 4.x takes full advantage of.
The DPS values for lasers remain cached for the duration of the game thereafter so it's just something to worry about when first setting up. You can see the cached values in the Smart menu under DPS Cache. I found this handy in XTC as its easy to compare and see which lasers have the best DPS, as cargo limits make it difficult to max out on every laser combo for each ship.
No need to worry about training in the AP version though, they added script APIs to query more detailed laser statistics, which Smart 4.x takes full advantage of.
-
- Posts: 432
- Joined: Fri, 16. Dec 11, 11:24
Is there any way for Smart Turrets to not check energy? With Smart Main Guns in action chargeable weapons a lot more useful except when going from eight to one: I don't care if I end up to 0 energy but having my dps dropping way before that is a problem.
Last edited by Huillam on Tue, 7. May 13, 15:06, edited 1 time in total.
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
There's no option to disable that, but it can be added in future.
To edit this out of the script, look at the start of glen.turret.smart.weapons.xml, find the comment that reads 'Option.GetGunLimit'.
In Smart 2.4, insert the following after line 66:
$GunLimit = $Turret.Global[6]
return $GunLimit
In 4.5, insert 'return $MaxGunsInTurret' after line 71
To edit this out of the script, look at the start of glen.turret.smart.weapons.xml, find the comment that reads 'Option.GetGunLimit'.
In Smart 2.4, insert the following after line 66:
$GunLimit = $Turret.Global[6]
return $GunLimit
In 4.5, insert 'return $MaxGunsInTurret' after line 71
-
- Posts: 432
- Joined: Fri, 16. Dec 11, 11:24
No I probably did something wrong:
Changed:
to:
and then to:
(with a word wrap before 'return $MaxGunsInTurret')
I tried various other things (like replacing $GunLimit by $MaxGunsInTurret at line 74) but no success. I imagine that I miss something pretty obvious.
Edit:
Pretty strange. I deleted lines 69 to 75 and nothing change. At least main guns should be a litte buggy.
I'm editing \x3 terran conflict\addon\types\glen.turret.smart.weapons.xml
Am I in the wrong directory? Or maybe something need to be done for the scripts to update?
Changed:
Code: Select all
<line linenr="071" indent=" "><var>$GunLimit = </var><text></text><var>$MaxGunsInTurret </var><text></text></line>
Code: Select all
<line linenr="071" indent=" "><var>$GunLimit = </var><text></text><var>$MaxGunsInTurret </var><text></text></line>'return $MaxGunsInTurret'
Code: Select all
<line linenr="071" indent=" "><var>$GunLimit = </var><text></text><var>$MaxGunsInTurret </var><text></text></line>
'return $MaxGunsInTurret'
I tried various other things (like replacing $GunLimit by $MaxGunsInTurret at line 74) but no success. I imagine that I miss something pretty obvious.
Edit:
Pretty strange. I deleted lines 69 to 75 and nothing change. At least main guns should be a litte buggy.
I'm editing \x3 terran conflict\addon\types\glen.turret.smart.weapons.xml
Am I in the wrong directory? Or maybe something need to be done for the scripts to update?
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
You MUST use an editor made for X3 scripts, such as the in-game Script Editor. A normal text/xml editor will not work. If you want an external editor then use X-Studio Script Editor or Exscriptor. The human-readable portion of X3's script files is just "documentation". The real code is the array of numbers at the bottom.
A normal text editor is fine for other files in the game -- only scripts require a special editor.
A normal text editor is fine for other files in the game -- only scripts require a special editor.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 907
- Joined: Tue, 18. Feb 03, 01:43
Don't edit the XML directly. Load and edit it in X-Studio, but be sure to restore the original xml file first.
http://forum.egosoft.com/viewtopic.php?t=301433
Before
After
http://forum.egosoft.com/viewtopic.php?t=301433
Before
Code: Select all
* Option.GetGunLimit = 6
if $Option == 6
$MaxGunsInTurret = [THIS]-> get max. number of lasers in turret $TurretId
$GunLimit = $MaxGunsInTurret
skip if $MaxGunsInTurret < 2
gosub GetGunLimit:
return $GunLimit
end
Code: Select all
* Option.GetGunLimit = 6
if $Option == 6
$MaxGunsInTurret = [THIS]-> get max. number of lasers in turret $TurretId
return $MaxGunsInTurret
end