Okti wrote:Commander McLane wrote:
By the way, and because I've downloaded the OXP now:
- When the player ship is docked, it still exists. Therefore your code would not remove the missile. I think it would get parked 1000 meters away from the station.
Here is the answer to Commander McLanes question.
Just a suggestion: Personally I generally try to avoid to give the player commsMessages while he is docked. I think they don't really fit nice on the docked screens, and I also think that the player is occupied with the things he's doing
inside the station, not what's happening in front of it (at least that's how it is for myself). I would therefore suggest to suppress the messages if docked. The missile would still be waiting outside, but silently.
You can achieve that by sending the messages from the script instead of the AI. And then you only need a simple condition:
Code: Select all
if(!player.ship.docked)
{
this.ship.commsMessage("your message", player.ship);
}
One caveat, though: this won't work for the first message, because script-sent commsMessages only go to ships within scanner range.
However, they way your AI works, by targeting the player ship from outside scanner range and then sending the message doesn't feel actually right to me. It shouldn't be possible to target an entity outside scanner range, and it shouldn't be possible to send commsMessages to the other end of the system.