Here's one for Norby's Variable Masslock that discriminates based on ship role rather than ship mass.
(Big thanks to Norby for help with this - I'm still struggling to believe that I seem to have it working
Change line 156 of variablemasslock.js (in the scripts folder) from...
var r = w.$Range( t.mass );
var r = w.$Range( t.primaryRole );
Then go to lines 44 and 45 of the same script...
this.$Range = function(mass)
return( mass * 0.02 + 17000 );
needs to be changed to...
this.$Range = function(primaryRole)
if (primaryRole == "escort" || primaryRole == "escort-medium" || primaryRole == "escort-heavy" || primaryRole == "trader" || primaryRole == "trader-courier" || primaryRole == "trader-smuggler" || primaryRole == "shuttle" || primaryRole == "miner" || primaryRole == "scavenger")
Now the peaceful (and often tedious) traders exert a smaller masslock than those actively looking for encounters (e.g. police, pirates, hunters, thargoids).
- It's easier to ensure that no encounters expected to result in combat (e.g. pirates) are avoided by reactivating the torus drive before an aggressor can close sufficiently (none of those ships ever have their scanClass changed).
- The more tedious 'crawl-by' masslocks are both easier to avoid and take less time to escape (initial masslock occurs as normal but the torus drive can then be reactivated).
Probably needs some tweaking but a couple of quick tests worked as expected.
- Lave to Zaonce - evaded a few large freighters until got too close to one of them (traders presumably) but was masslocked by police.
- Lave to Leesti - was masslocked by a large pack of ships on the edge of the scanner who, moments later, turned out to be pirates
Rationale (if one is required): Some ships are looking for mass-locks and some ships aren't, by giving them different masslock radii that is further reflected in the game.
[Edited to remove 'list' formating within the 'code' windows - where it can confusingly appear to be code.]