Aller au contenu

Photo

Speaker and listener system for chat-talking to objects and other things


  • Veuillez vous connecter pour répondre
33 réponses à ce sujet

#26
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Tchos,

I made the same reply in your other thread too.

Just to add ... Using a "listener" can be a hit or miss affair as well - and therefore, not as reliable as the method below.

The system you are describing was more appropriately used in NWN1 when other GUI options were not available to us. And the real question here, is more about how you want your player to interact with the game. For instance, it is unusual for the player to use the "chat" function "out of the blue" nowadays in the hope of activating a speech or conversation of some kind. I have designed and used a system very much like you describe, but it has always been for NWN1. In NWN2, we have interactive GUIs to work with the player, and ensure the player is "playing" the game as expected (if that makes sense). The best solution is to bring up a GUI when the player is aware of all the facts about when and where to say a "phrase or word" to move the game forward. e.g. The PC learns that if they say "Pie and Chips" to the boar head in the hallway, then a secret door will open. Before they knew this, clicking on the boar's head would have done nothing (made non useable - or possibly do something if you wanted to). However, once they know about the boar's head, it is made useable and when clicked on offers the player a GUI which awaits the appropriate text.

Check out my tutorial on how to incorporate this sort of stuff ... you will never regret doing so, as it really does opens up a whole new world of inetresting gaming stuff if you can get to grips with it. Posted Image

Lance.


EDIT: I have not checked this out, but maybe this has something based upon NWN1 coding for your original use of the "chat" facility. Also, possible this and this. Personally, however, I still think presenting the player with a GUI is the way to go. You can still then have the "placeable" object respond with appropriate speakstrings if you like - and the code can be made very generic/versatile.

Modifié par Lance Botelle, 07 février 2013 - 02:47 .


#27
Tchos

Tchos
  • Members
  • 5 042 messages
I'm going to try out Lugaid's and Pain's methods as well, but I would still love to know the specifics of what any of the "misses" in a hit or miss affair would be in a case like this.

I know a bit about custom GUIs, but why create a new GUI for something that we already have a dedicated space in the UI for? Just because it's not usually used in a single-player module? In any module of mine, it would not be out of the blue to use it, because it would be my responsibility as an author to clearly explain what would be expected. In no event would I ever include a non-standard game mechanic without indication.

I do understand that a custom UI for the text input would be self-explanatory, though, so that would have an advantage.

#28
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Tchos wrote...

I'm going to try out Lugaid's and Pain's methods as well, but I would still love to know the specifics of what any of the "misses" in a hit or miss affair would be in a case like this.

I know a bit about custom GUIs, but why create a new GUI for something that we already have a dedicated space in the UI for? Just because it's not usually used in a single-player module? In any module of mine, it would not be out of the blue to use it, because it would be my responsibility as an author to clearly explain what would be expected. In no event would I ever include a non-standard game mechanic without indication.

I do understand that a custom UI for the text input would be self-explanatory, though, so that would have an advantage.


Hi Tchos,

Having a "self-explanatory UI" is what I was driving at. :) I believe there is something more "secure" about using a custom GUI in a situation like this. However, having used a system like you describe myself, I do also understand why you may wish to use it as you mention.

Note: I did not read their posts too closely, but if they use a "listener" to react to the PC's spoken words from the chat window, I have found that there are some things that prevent the listener for hearing/responding or being close enough to hear/respond to the call. As I say, that is assuming they use a "listener" .... and it has been some time since I have had to do anything like that. (Only did so for NWN1.) When I did use a listener, the success rate was around 90%. In the other 10% of the time, something prevented the listener from working as expected.

All the best with whatever approach you use.

Lance.

#29
Tchos

Tchos
  • Members
  • 5 042 messages
Do you recall what things could prevent the listener from hearing? I'll give a little more information on the setup I have here, which is that the invisible Listener is right next to the placeable Responder. The Listener also has all of its AI scripts blank, except for the On Conversation and On Spawn In events, which are necessary for this system.

#30
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Tchos wrote...

Do you recall what things could prevent the listener from hearing? I'll give a little more information on the setup I have here, which is that the invisible Listener is right next to the placeable Responder. The Listener also has all of its AI scripts blank, except for the On Conversation and On Spawn In events, which are necessary for this system.



Hi Tchos,

Now you're asking. Posted Image (Terrible memory!)  I used a "listener" system in my Soul Shaker module in a couple of ways. Now, as I stretch to recall what I did, I believe my "password doors" were more stable than my "constant listener", which may be good news for you I believe.

The "password door" system worked on summoning a "listener" at the time of requirement, whereas the "constant listener" was a system that tried to work on a number of "game commands" that I had introduced, which reacted to the PC at *any* time. I just searched out my "Game Manual", which said this about the "listener":-

"GAME NOTE: The macro commands are answered by something called a “Guardian Spirit” (players can ignore this invisible NPC), which is assigned to the PC as they enter the Realm. Occasionally, this spirit may be a few seconds behind and fail to respond immediately."

As I read that, I believe the problem I am thinking about may not affect you, if you are only using a "listener" from one place and only as it is required. The problem I had was due to the fact that as a PC moved, the listener had to stay within "listening" range, and so if the PC moved out of the "listeners" range and used a macro (equivilent to your chat call), it would not hear it and so not respond. If the player tried the same command again, the "listener" had normally caught up with them by then.

As I say though, if you intend to place this "invisible listener" near the placeable in question at build time and not move it, then you should be fine. One other thing I noticed from the NWN1 days was that you could never quite make the listener always completely "un-noticeable" (which is why I made reference to the "Guardian Spirit", in the event that the player might accidentally see/notice the "spirit" on a mouse hover moment), even though the functions I tried implied it should have been completely invisible and not noticed in game. Posted Image This, however, may not be an issue in NWN2.

The bottom line is normally to do with "distance" and making sure the invisible creature is within range and is "spawned" in a valid location/walkmesh space.

As a side point, I have made use of an "invisible shouter" for another aspect of my NWN2 module, and one thing I did was to create the invisible creature, make it say its piece, and then destroy it again. This helps avoid cursor activity by the player, and the process can be repeated for as many conversation lines as you need. Creation, speech and destruction all take place within 0.3 of a second.

Anyway, I hope some of that made sense, and may be of help.

Lance.

Modifié par Lance Botelle, 07 février 2013 - 09:53 .


#31
Tchos

Tchos
  • Members
  • 5 042 messages
Right, I would not have a Listener following the player around or moving in any way, and the Invisible Man appearance as noted above (or on the previous page) is completely undetectable even in the toolset, let alone the game itself. So when used for the purpose I intended, this should not have the problems you describe.

#32
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
You could also handle the password using the on-chat event, with a function that checks whether the PC is close enough to the right spot. You could even just have a trigger throw a variable as the PC enters/exits.

#33
Amphibious Bagel

Amphibious Bagel
  • Members
  • 22 messages
Yes, essentially you all have it down.

In NWN1, the listening system was, I believe, also used by the DMFI folks to create a special "Voice" tool. This tool was sadly bugged, last I used it (years and years ago) and I've never seen it recreated for NWN2. A DM could use the tool to spawn an undetectable invisible creature which would then follow its target around the server (even through transitions) and repeat back anything that the PC said and/or heard directly to the listening DM (excluding tells).

The tool was extremely useful for DMs on Player Worlds who needed to leave an area to set up another spot for the incoming adventure party. Using the voice tool, they could still follow the party's conversation despite being in another area entirely. Of course, players could also use party chat, but the downsides to Party Chat were always 1) ALL DMs can hear ALL parties, which got tiresome and 2) Players speaking/listening outside the party won't be heard or hear what is going on.

If anyone were interested in trying to create an improved Voice Tool for NWN2, or if there is already one out there, I'd be interested to see it. (No time to do it myself, sadly.)

#34
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages

Amphibious Bagel wrote...

Yes, essentially you all have it down.

In NWN1, the listening system was, I believe, also used by the DMFI folks to create a special "Voice" tool. This tool was sadly bugged, last I used it (years and years ago) and I've never seen it recreated for NWN2. A DM could use the tool to spawn an undetectable invisible creature which would then follow its target around the server (even through transitions) and repeat back anything that the PC said and/or heard directly to the listening DM (excluding tells).

The tool was extremely useful for DMs on Player Worlds who needed to leave an area to set up another spot for the incoming adventure party. Using the voice tool, they could still follow the party's conversation despite being in another area entirely. Of course, players could also use party chat, but the downsides to Party Chat were always 1) ALL DMs can hear ALL parties, which got tiresome and 2) Players speaking/listening outside the party won't be heard or hear what is going on.

If anyone were interested in trying to create an improved Voice Tool for NWN2, or if there is already one out there, I'd be interested to see it. (No time to do it myself, sadly.)


Ouch, that sounds scary.

You can just use the chat event ( think this is true now on NWN1), and hear players server wide. This is part of the features I've released, and listening to players has always been in use. Targeting specific players is not that hard to add technically recreating it should take no more than an hour of effort ( just grab the sendmessagetoalldm's type of code found in the dmfi, or in my content ).

I've always hidden as dm, used a proxy creature to speak for me, while i am logged on as a player, and used chat commands and such to keep players in line as needed. Generally players get more help if I acted as a guide and partied with them, and showed them our PW. Used properly you just need chat commands to do all dm activities, and this helps with skywings text based dm client ( allows you to log into dm mode and player mode at the same time, and you can paste into the text entry area snippets of text ).

If not ( like on earlier version ) xp_chat gave the same features until it was rolled into the official version.

Modifié par painofdungeoneternal, 18 février 2013 - 11:16 .