Re: Ship-to-Ship Comms OXP
Posted: Fri Aug 01, 2014 6:37 am
This is where the debug console is your friend - you can also then use it to monitor, evaluate and tweak the added ship at your pleasure...
For information and discussion about Oolite.
https://bb.oolite.space/
target.isFleeing
will tell you if the target is currently running away, but it won't tell you if it's dumped cargo before or after doing so.Code: Select all
this._reportAllEntities = function() {
function _isValidEntity(entity)
{
return entity.isValid && !(entity.isVisualEffect);
}
var ents = system.filteredEntities(this, _isValidEntity);
log(this.name, "Total entities = " + ents.length.toString());
ents.forEach(function(ent)
{
log(this.name, "==========================================");
log(this.name, "entity displayName = " + ent.displayName);
log(this.name, "entity scanClass = " + ent.scanClass);
log(this.name, "entity owner = " + ent.displayName);
log(this.name, "entity isInSpace = " + ent.isInSpace.toString());
log(this.name, "entity isDock = " + ent.isDock.toString());
log(this.name, "entity isPlanet = " + ent.isPlanet.toString());
log(this.name, "entity isPlayer = " + ent.isPlayer.toString());
log(this.name, "entity isShip = " + ent.isShip.toString());
log(this.name, "entity isStation = " + ent.isStation.toString());
log(this.name, "entity isSubEntity = " + ent.isSubEntity.toString());
log(this.name, "entity isVisible = " + ent.isVisible.toString());
log(this.name, "entity isWormhole = " + ent.isWormhole.toString());
log(this.name, "entity status = " + ent.status);
}, this);
}
Code: Select all
> system.mainStation.subEntities[2]
[Dock "Coriolis Dock" position: (0, 0, 500.256) (subentity)]
AIScript.oolite_priorityai
". In particular, any "Hognose" ships I come across or even create. Is this due to some issue with the Hognose, or something I should consider on a wider scale (ie. OXP ships's pre v1.79)?AIScript.oolite_priorityai
, when I do the performAttack
and reconsiderNow
, I'm not getting any of them to decide to drop cargo. Yet if I fire a shot at them they drop and run straight away.Oolite PriorityAI Documentationphkb wrote:Also, for the instances where I do find aAIScript.oolite_priorityai
, when I do theperformAttack
andreconsiderNow
, I'm not getting any of them to decide to drop cargo. Yet if I fire a shot at them they drop and run straight away.
That property will only exist for ships with a 1.79 or later JS AI (which at the moment is basically no OXP ships with custom AIs). The old style AIs will occasionally dump cargo but you definitely have to shoot at them to get that to happen.phkb wrote:I'm noticing that some ships don't seem to have a "AIScript.oolite_priorityai
". In particular, any "Hognose" ships I come across or even create. Is this due to some issue with the Hognose, or something I should consider on a wider scale (ie. OXP ships's pre v1.79)?
"performAttack" is on the ship object itself, not the AI controller, which might be causing the problem?phkb wrote:Also, for the instances where I do find aAIScript.oolite_priorityai
, when I do theperformAttack
andreconsiderNow
, I'm not getting any of them to decide to drop cargo. Yet if I fire a shot at them they drop and run straight away.
Right. That's fair enough.cim wrote:That property will only exist for ships with a 1.79 or later JS AI
This is what I'm doing, based on your sample. I'll keep trying -- I might remove a few OXP's to just get the core ships and see whether I can get any of them to work, and let you know how I get on. Thanks for the help.cim wrote:"performAttack" is on the ship object itself, not the AI controller
My ideas: you can check if the player acts as really cooperate. For example reducing the speed and turning off weapons is good (can extend the time for dump) and using injectors (speed>maxSpeed) or a laser hit on any ship will be retaliated.- If the player doesn't dump some cargo within (say) 10 seconds, the pirate band start attacking again.
Some random neutral answer is enough in the first version imho. You can add more later and you can outsource the task into other OXPs by providing an interface to add more. You must not write stories here to fill up the radio comms with meanings, I guess others will be happy to do it.it would be good for the greeting to mean something in the game world
Possible but is not recommended, at least until we can not query which MFDs are displayed to avoid overwrite another. Dispaying in the first empty slot is also problematic, without query this way will duplicate the MFD at every priming of the equipment until all available slot will be filled with this MFD.when a piece of equipment is primed is it possible to have the associated MFD be displayed