Ship-to-Ship Comms OXP
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
With regard to requestDockingInstructions, I call the function and get a message like "Xeaten Station here. We have uploaded docking instructions to your flight console." No further messages come. If I send the request again nothing happens, so I'm assuming it's waiting for my ship to do something. If I try and dock I get fined for not following the protocol.
Unless there's something obvious I've missed, I going to call this one as "too hard for now" and move on.
Unless there's something obvious I've missed, I going to call this one as "too hard for now" and move on.
Re: Ship-to-Ship Comms OXP
Definitely going for the autodock route. What it expects is that you'll carry out the docking instructions returned by
requestDockingInstructions
, then call the method again to get the next step of the instructions. If you do that successfully enough times it probably will let you dock without fines, but you'll need to do quite a bit more work to give the player the necessary flight instructions.Re: Ship-to-Ship Comms OXP
Phkb, how's the basic functionality coming along? Seeing as docking requests are a bit more problematic...
(3 more days until I can play Oolite again )
(3 more days until I can play Oolite again )
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
What I have at the moment is a functional environment, but nothing that actually changes the gameplay. The MFD will display different message options based on what is currently targeted and the alert status. It will keep track of who you have sent a greeting to since your last launch, and remove that option when a ship is re-targeted. It will check if the targeted ship has cargo when determining whether to offer the "Drop 5 ton of cargo" message.
At the moment, you can send greetings, taunts and threats, and ships will respond to these messages after a suitable delay (ie, not straight away, so it looks more like they thought about the response). You can also ask if anyone is going to your destination system, and ships may choose to respond positively or negatively (ie. "Sure I'm going there. Tag along", or "Sorry, I'm going somewhere else").
Here's a question for everyone, though. If the player's alert status is "RED", should I hide the "Send greeting" option. It seems like an unnecessary option during combat, so my feeling is I should, but I'd like to hear some other opinions.
Anyway, the next phases of development are:
- Work out how to nudge the AI of NPC ships (eg, sending a taunt to a NPC firing at your could either make the NPC more accurate for a few seconds, or less accurate, or nothing at all. Sending a threat to a NPC brings in the small chance the ship might break off, based on it's own weaponry and the players, it's legal status and the players kill count. Sending a greeting to a NPC might make the NPC slight less likely to fire at the player)
- Work out how to tell an NPC ship to drop 5 tons of cargo without actually firing a shot.
- Work out how to tell NPC's "I surrender!" in a meaningful way
- Work out if it's possible to send a "I'm sorry" message to police or stations if you accidentally fire at them. Can their response be reduced to "OK, well, dock and pay a fine and we'll overlook it this time"?
- Building up a good set of transmissions and responses
- Testing with a variety of OXP's that I don't normally use.
Another thing I'd like to incorporate is a way for other OXP's to leverage the system. ie. an mission OXP can add a specific message to the list for specific targets, and have certain actions triggered when that message is sent. If someone can tell me of some OXP's that have ship-to-ship comms in them (like mission OXP's), I might have a look at what's been done before and how it could possibly use this system. But that's a longer term goal.
At the moment, you can send greetings, taunts and threats, and ships will respond to these messages after a suitable delay (ie, not straight away, so it looks more like they thought about the response). You can also ask if anyone is going to your destination system, and ships may choose to respond positively or negatively (ie. "Sure I'm going there. Tag along", or "Sorry, I'm going somewhere else").
Here's a question for everyone, though. If the player's alert status is "RED", should I hide the "Send greeting" option. It seems like an unnecessary option during combat, so my feeling is I should, but I'd like to hear some other opinions.
Anyway, the next phases of development are:
- Work out how to nudge the AI of NPC ships (eg, sending a taunt to a NPC firing at your could either make the NPC more accurate for a few seconds, or less accurate, or nothing at all. Sending a threat to a NPC brings in the small chance the ship might break off, based on it's own weaponry and the players, it's legal status and the players kill count. Sending a greeting to a NPC might make the NPC slight less likely to fire at the player)
- Work out how to tell an NPC ship to drop 5 tons of cargo without actually firing a shot.
- Work out how to tell NPC's "I surrender!" in a meaningful way
- Work out if it's possible to send a "I'm sorry" message to police or stations if you accidentally fire at them. Can their response be reduced to "OK, well, dock and pay a fine and we'll overlook it this time"?
- Building up a good set of transmissions and responses
- Testing with a variety of OXP's that I don't normally use.
Another thing I'd like to incorporate is a way for other OXP's to leverage the system. ie. an mission OXP can add a specific message to the list for specific targets, and have certain actions triggered when that message is sent. If someone can tell me of some OXP's that have ship-to-ship comms in them (like mission OXP's), I might have a look at what's been done before and how it could possibly use this system. But that's a longer term goal.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
Another question: What's the simplest method of making an entire pirate group leave the player alone, or decide to stop attacking? Completely, no refunds.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
And another question: Is there a simple way of assessing the power of one ship over another? ie. comparing a Krait to a Cobra, or a Sidewinder to a Fer-de-lance.
Edit: Actually I think I found this one: ship.threatAssessment.
Edit: Actually I think I found this one: ship.threatAssessment.
Re: Ship-to-Ship Comms OXP
For a ship with a JS AI,phkb wrote:- Work out how to tell an NPC ship to drop 5 tons of cargo without actually firing a shot.
target.AIScript.oolite_intership.cargodemand = 5;
. You'll need to set the target to red alert somehow for it to notice the demand, which is easier to do by attacking it.So long as the player is running away and not firing, NPCs will interpret that as surrender. It's just that many of them don't care... You can try removing the player from the target and defense target lists of nearby NPCs, and going from there.phkb wrote:- Work out how to tell NPC's "I surrender!" in a meaningful way
1.80 does have situations in which a Clean pilot can hit a police ship or Coriolis and get away with it. If you want to add more, then probably the same mechanisms as surrender (though hitting the Coriolis is likely to put the player's bounty too high for a surrender to be accepted)phkb wrote:- Work out if it's possible to send a "I'm sorry" message to police or stations if you accidentally fire at them. Can their response be reduced to "OK, well, dock and pay a fine and we'll overlook it this time"?
If the pirates attacked the player as a robbery, the detargeting (see "surrender" above) will work, and they won't attack the player again until they've tried to rob someone else, but once that's been done the player is fair game again.phkb wrote:Another question: What's the simplest method of making an entire pirate group leave the player alone, or decide to stop attacking? Completely, no refunds.
If the pirates attacked the player because they thought the player was a bounty hunter and they wanted to get in first, they'll just do it again if you detarget them.
You can edit their
target.AIScript.playerRole
variable (on all ships in the group) to change it to something pirates will ignore.You want thephkb wrote:And another question: Is there a simple way of assessing the power of one ship over another?
ship.threatAssessment
method.- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
For the dump cargo issue, could I run the "target.dumpCargo()" function, then do "target.performFlee()". Would that achieve the same thing?
For getting a pirate band to flee, how can I tell if the band is robbing you, as distinct to just wanting to kill you for the bounty?
Edit: Also, how can I tell the target is part of a pirate band, and find all the other members of the band?
Edit: One question from before: the "shipTargetLost" doesn't appear to fire when the player's target enters a wormhole. What event should I be looking at?
For getting a pirate band to flee, how can I tell if the band is robbing you, as distinct to just wanting to kill you for the bounty?
Edit: Also, how can I tell the target is part of a pirate band, and find all the other members of the band?
Edit: One question from before: the "shipTargetLost" doesn't appear to fire when the player's target enters a wormhole. What event should I be looking at?
Last edited by phkb on Thu Jul 31, 2014 7:52 am, edited 2 times in total.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
cim, by the way, my summary back a few posts wasn't to indicate I hadn't read your earlier posts where you answered some of the questions. Sorry if it came across that way. I was just pointing out the progress I had made and where work is still to be done. All your suggestions have been really helpful and I don't want you to think I've rejected anything.
Re: Ship-to-Ship Comms OXP
wow, phkb, you must be really good at programming if you managed to get that much done so quickly!
Re: Ship-to-Ship Comms OXP
Probably better would bephkb wrote:For the dump cargo issue, could I run the "target.dumpCargo()" function, then do "target.performFlee()". Would that achieve the same thing?
Code: Select all
target.target = player.ship;
target.performAttack();
target.AIScript.oolite_priorityai.reconsiderNow();
Check the pirate AI. If they're in the middle of a robbery they'll havephkb wrote:For getting a pirate band to flee, how can I tell if the band is robbing you, as distinct to just wanting to kill you for the bounty?
target.AIScript.oolite_intership.cargodemanded
be the desired amount. That won't tell you if they're robbing the player or merely attacking the player because they interfered, but it doesn't really matter.Being certain about this is difficult.phkb wrote:Edit: Also, how can I tell the target is part of a pirate band, and find all the other members of the band?
Code: Select all
Ship.roleIsInCategory(ship.primaryRole,"oolite-pirate");
ship.group
will then find the rest of them.That may be a bug. I'll investigate further.phkb wrote:Edit: One question from before: the "shipTargetLost" doesn't appear to fire when the player's target enters a wormhole. What event should I be looking at?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
Well, programming is my day job!Zireael wrote:wow, phkb, you must be really good at programming if you managed to get that much done so quickly!
cim, regarding the dump cargo response, in order to determine the response of the target (either "Here's some cargo", or "I'll fight you for it"), would I be able to look at "target.isFleeing", or "target.isPirateVictim"?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
And a general OXP development question: is there a script I can use to easily put some specific ships in scanner range? Testing this OXP would be a lot simpler if I could launch and find a certain target to test on.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Ship-to-Ship Comms OXP
This maybe useful, the another is surely not (a constant).phkb wrote:target.isFleeing
phkb wrote:put some specific ships in scanner range
Code: Select all
system.addShips("[adder]", 1, PS.position.add(PS.vectorForward.multiply(10000)),1000);
Code: Select all
var ships = system.addShips("pirate", 5, PS.position.add(PS.vectorForward.multiply(10000)),5000);
for(var i=0; i<ships.length; i++) {
if(ships[i]) ships[i].displayName = i+". Pirate "+ships[i].displayName;
}
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Ship-to-Ship Comms OXP
Thanks, Norby. That's very helpful.