Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

enabling chat module with NPC ships

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Commander McLane wrote:
And I guess it won't be a good idea to have two or more people fiddling with different parts of the code at the same time.
Actually, that would be ideal. :-)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Arexack_Heretic wrote:
This would be a hack/compromise....but...

for comms inflight:
how about pausing the game and forcing view to mission_screen.
offer option, stuck in mission_screen untill a choice is made.
I think it would be very annoying to have the game paused and a mission screen poping up whenever a NPC send a commsMessage to you. Imagine yourself being in a battle and your adversaries frequently sending hails...

So we would need a new method as well, something like "interactiveCommsMessage: Can you help me?, YES, NO". And the pause-game-and-show-mission-screen sequence would be triggered only on that. And it would be handy to have the possible choices defined in that method as well. If not possible by seperating with commas (you sometimes might want to use a comma in your text, wouldn't you?), then there should be another method setting the possible answers, analogous to the setDesiredRange you need together with any scanFor. Something like "setAnswer YES, NO, DON'T KNOW". And according AI-messages like ANSWER_1 = (do something); ANSWER_2 = (do something else); ANSWER_3 = (do something yet different);, analogous to ROLL_1 and so on.

*******

@ Ahruman: Okay, if it is so, then let's look for volunteers. (But not me.)
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post by Wiggy »

Commander McLane wrote:
The point is: I don't know how easy the implemetation would be, but it would need to be implemented in the code. It's not OXPable, as it would need keystrokes to be defined for the preset answers. And this can't be done with an OXP.
I disagree.
In Assassins OXP, there are NPC ships that give out various comms messages when they attack and when they die.

Presumably, it would not be very difficult to implement a special type of comms message that requires the player to press one of two keys: a positive or a negative response.
The text of the messages could be in the OXP.

Code: Select all

sendInteractiveMessage:"Help me!"
           yesResponse:"I shall assist you!"
           noResponse:"Unlucky, son."
Obviously this is not actual code. I agree that you couldn't have n options, where n is not fixed and would require additional buttons.
But if all interactive messages had only a yes or no reply, then this would be straightforward.
You could then have NPCs reacting to the message differently.
You came in that? You're braver than I thought!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Wiggy wrote:
Commander McLane wrote:
The point is: I don't know how easy the implemetation would be, but it would need to be implemented in the code. It's not OXPable, as it would need keystrokes to be defined for the preset answers. And this can't be done with an OXP.
I disagree.
In Assassins OXP, there are NPC ships that give out various comms messages when they attack and when they die.
Well, that's a completely different pair of shoes. Of course it's hell easy to have all ships spit out all types of hails all the time. But that's not the point. We wanted it to be interactive, not just reading hails but responding to them.
Wiggy wrote:
Presumably, it would not be very difficult to implement a special type of comms message that requires the player to press one of two keys: a positive or a negative response.
The text of the messages could be in the OXP.

Code: Select all

sendInteractiveMessage:"Help me!"
           yesResponse:"I shall assist you!"
           noResponse:"Unlucky, son."
Obviously this is not actual code. I agree that you couldn't have n options, where n is not fixed and would require additional buttons.
But if all interactive messages had only a yes or no reply, then this would be straightforward.
You could then have NPCs reacting to the message differently.
You got it: This is not actual code. And our main coder (Ahruman) won't implement it into the code anytime soon. And that's my whole point.

If you've read my above post you will have seen that I already have proposed a syntax for it. An AI-syntax, to be precise, as I think this kind of communication has to be scripted in the NPCs AIs. The texts of the messages could still be defined in descriptions.plist. If I was a coder I could give it a try. But unfortunately I'm not. So it's back to Position A: Waiting for Ahruman (or anybody else) to take the ball.
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post by Wiggy »

OK, well, I've just just written my first couple of programs in ObjC using Xcode, so I should be able to write it in about 12 months time.
You came in that? You're braver than I thought!
Post Reply