Diziet Sma wrote: ↑Sun Mar 26, 2017 11:03 pm
hoqllnq wrote: ↑Sun Mar 26, 2017 3:43 pm
Disembodied wrote: ↑Tue Mar 21, 2017 9:49 amMaybe a missile needs to travel a certain distance before its warhead arms
I like this idea, although I feel it should be time not distance.
Maybe missiles can not be fired while ECM is active. (To protect against detonation inside the launching tube.)
I like both those ideas.
This can be achieved by abusing the missile launch evasion code. It is normally meant to let the missile evade the
launching ship in certain firing contexts. If I disable the context checks and fire a missile right before me, I see the missile "dive" for a few secs. So this is a simple solution to the "missile in your face" problem, though a bit ugly.
I'm not sure what problem this code solves, but maybe the wanted behaviour in our case - just go straight ahead for a few seconds - could solve it?
I also have the "performTumble" thing.
Alpha version
Extract into your addons folder.
For the first time yesterday I fired a standard missile and I was confident that it would do something.
I somewhat took the opposite of Redspear's approach; the idea is to spam ECM either to delay the incoming missile or to destroy it. This assumes you have injectors too, but in my experience you have to deal with missiles only when you're about to blow up your target, so you are being aggressive; often the target starts to flee before they launch "panic" missiles. On a related note, it seems to me that N-shields (and probably customShields) make the opponents overestimate themselves. I uninstalled it because dogfights were taking way too long, and I noticed that opponents were much more prone to flee. In particular, when I destroy one of the ships in a pair of pirates, the other is very likely to flee - a behaviour I did not see before.
The tumbling part is a bit convoluted. It looks like I'm missing something:
Code: Select all
this._ecmProofMissileResponseStd = function()
{
var r=Math.random();
if(r<0.5)
{
this.ship.AIScript.oolite_priorityai.behaviourTumble();
this.ship.AIScript.oolite_priorityai.reconsiderIn(3);
}
[SNIPPED]
This function is assigned to
oolite_missile_ecmResponse.
Unfortunately, some other things got thrown into the mix because I did it as part of a larger WIP. So what's in there:
- Standard missiles have 50% chances to tumble and 25% chances to explode, 25% chances not affected by ECM.
- Hardened missiles have 10% chances to behave the same as standard missiles when hit by ECM.
- 5 secs "arming" period on missile launch
The unwanted stuff:
- Fuel scoops take 1TC of cargo space
- Player Cobra III speed reduced from 350 to 300
- all ships have 5TC cargo capacity minimum
- The cargo bay extension cannot be bought any more
- Military laser damage reduced from 12 to 9
- Heat shield has increased probability of being damaged (from 1 to 2)