Talking NPCs
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 227
- Joined: Thu Sep 26, 2013 3:48 pm
Talking NPCs
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.
» 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.
-
- L2j Veteran
- Posts: 314
- Joined: Mon Mar 11, 2013 4:19 pm
-
- Posts: 227
- Joined: Thu Sep 26, 2013 3:48 pm
Re: Talking NPCs
Hides their Names
Not chat tho
Not chat tho
-
- L2j Veteran
- Posts: 314
- Joined: Mon Mar 11, 2013 4:19 pm
-
- Posts: 257
- Joined: Thu Dec 16, 2010 5:16 am
Re: Talking NPCs
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?

I don't mind helping - however: I only do so if I want to.
No support for other server packs than L2J.
-
- Posts: 113
- Joined: Sun Mar 28, 2010 6:17 pm
Re: Talking NPCs
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.
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Talking NPCs
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 113
- Joined: Sun Mar 28, 2010 6:17 pm
Re: Talking NPCs
You could store it in each player, new class containing such data.
What's your idea to achieve same result without creating such map?
What's your idea to achieve same result without creating such map?
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Talking NPCs
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 113
- Joined: Sun Mar 28, 2010 6:17 pm
Re: Talking NPCs
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.
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Talking NPCs
That's just an onSeeCreature trigger.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.
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.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.
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 113
- Joined: Sun Mar 28, 2010 6:17 pm
Re: Talking NPCs
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.
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Talking NPCs
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.
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 257
- Joined: Thu Dec 16, 2010 5:16 am
Re: Talking NPCs
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.
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.

I don't mind helping - however: I only do so if I want to.
No support for other server packs than L2J.
-
- Posts: 113
- Joined: Sun Mar 28, 2010 6:17 pm
Re: Talking NPCs
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:
You could add something like:
example 1:
example 2:
example 3:
and write core support for it.
Code: Select all
<point npcStringId="1010223" X="43531" Y="-48109" Z="-792" delay="0" run="false" />
example 1:
Code: Select all
<npc_say text="sadsdsad sad asdas" delay="300" />
Code: Select all
<npc_say id="1010221" delay="300" />
Code: Select all
<npc_say text="sadsdsad sad asdas" action="death" />