Talking NPCs

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
kornom
Posts: 227
Joined: Thu Sep 26, 2013 3:48 pm

Talking NPCs

Post by kornom »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:Last
L2JDP Revision Number:Last

Is there a way to make specific NPCs to shut up? Or atleast speak less?
Example Monks in MOS... They just spaaaam the chat.
Or this wondering Monk in towns...
I tought monks are quiet people lol.
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Talking NPCs

Post by NosBit »

You can hide them from client chat options :P
Image
kornom
Posts: 227
Joined: Thu Sep 26, 2013 3:48 pm

Re: Talking NPCs

Post by kornom »

Hides their Names
Not chat tho
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Talking NPCs

Post by NosBit »

Checking Do not view NPC dialogue hides it
http://pasteboard.co/22b5nXZ.png
Image
Hyrelius
Posts: 257
Joined: Thu Dec 16, 2010 5:16 am

Re: Talking NPCs

Post by Hyrelius »

It still requires every user to do it. Is there a server-side way to e.g. remove or add talking NPCs (as easy as possible) - is probably what kornom wants to know. I'd also like to know this.. I know we can write AIs etc., but is there a relatively easy way to add, remove or even change this?
Image
I don't mind helping - however: I only do so if I want to.
No support for other server packs than L2J.
vampir
Posts: 113
Joined: Sun Mar 28, 2010 6:17 pm

Re: Talking NPCs

Post by vampir »

Take a look at AbstractNpcAi#broadcastNpcSay
I think the best solution, is to make Map<Integer, Long> in L2PcInstance that will contain Message Id and Time of receiving the message. Then while broadcasting message of Npc, we would have to check when that message was received last time, if delay(between next and last messages) is too small, just don't send message to that player.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Talking NPCs

Post by jurchiks »

You would need to store that map for each player, which is obviously a bad idea.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
vampir
Posts: 113
Joined: Sun Mar 28, 2010 6:17 pm

Re: Talking NPCs

Post by vampir »

You could store it in each player, new class containing such data.
What's your idea to achieve same result without creating such map?
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Talking NPCs

Post by jurchiks »

Why would you even want the NPC to send the message to each player seperately? Just decrease the chat delay and be done with it. People always have to complicate things unnecessarily...
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
vampir
Posts: 113
Joined: Sun Mar 28, 2010 6:17 pm

Re: Talking NPCs

Post by vampir »

1. Lets say you are entering monastery of silence and monsters have something important to say("Everybody carring the weapon, will die by our hand"). Now if we will put 5 minutes delayad between the messages, new player that just entered the zone might be killed by those monsters because he didn't know about the weapon.
2. If you will make npcs talk to each other, we could make players able to read whole conversation(from first message to last) even if he just teleported to town and other players are there for 30 minutes.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Talking NPCs

Post by jurchiks »

vampir wrote:1. Lets say you are entering monastery of silence and monsters have something important to say("Everybody carring the weapon, will die by our hand"). Now if we will put 5 minutes delayad between the messages, new player that just entered the zone might be killed by those monsters because he didn't know about the weapon.
That's just an onSeeCreature trigger.
vampir wrote:2. If you will make npcs talk to each other, we could make players able to read whole conversation(from first message to last) even if he just teleported to town and other players are there for 30 minutes.
If the player missed the start of the conversation, there is no reason to compensate for that wasting precious system resources, it's the player's fault. He can just wait until the convo starts over.
For example, if you were to script the NPCs moving along routes and talking specific texts at each specific point in the route. You would not want to start the messages when the player appears, that would mean the messages would start at wrong points in the routes.

TL;DR - don't waste resources on something miniscule like this. Nobody will care except maybe the most hardcore role-players.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
vampir
Posts: 113
Joined: Sun Mar 28, 2010 6:17 pm

Re: Talking NPCs

Post by vampir »

Yeah, but still while using onSeeCreature you need to know somehow if player already received that CreatureSay or not.

Let's say you have created 100 conversations between npcs in one town. You are saying to make them linear and same for every player because it's their fault that they entered in town in middle of conversation they saw last time. I would prefer to make them different for every player, depending if he already saw that conversation or not.
All about 1-3 mb of ram, while most of the servers have at least 16gb and they don't even need half of it.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Talking NPCs

Post by jurchiks »

Ok, on zone enter, whatever.

Prefer what you want, it is a complete waste of resources. Nobody will care about those synced dialogs, not in this game.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Hyrelius
Posts: 257
Joined: Thu Dec 16, 2010 5:16 am

Re: Talking NPCs

Post by Hyrelius »

jurchiks - if you don't care, then it's fine. Noone forces you to answer here, right? Apparently there are enough people on here who actually care.

There should be a nice way to set the auto-text for NPCs as well as its delay. I don't know of such a way. Hence the topic in here.

If you don't have anything to contribute except for "who cares for this" then please don't care and don't pollute this thread.
Image
I don't mind helping - however: I only do so if I want to.
No support for other server packs than L2J.
vampir
Posts: 113
Joined: Sun Mar 28, 2010 6:17 pm

Re: Talking NPCs

Post by vampir »

Messages of MOS monsters are hardcoded in MonasteryOfSilence.java, the only way i noticed to show such message from xml files can be found in Routes.xml(Prophets in Towns are using it). They are connected with next move, example:

Code: Select all

<point npcStringId="1010223" X="43531" Y="-48109" Z="-792" delay="0" run="false" />
You could add something like:
example 1:

Code: Select all

<npc_say text="sadsdsad sad asdas" delay="300" />
example 2:

Code: Select all

<npc_say id="1010221" delay="300" />
example 3:

Code: Select all

<npc_say text="sadsdsad sad asdas" action="death" />
and write core support for it.
Post Reply