EOSERV Forum > EOSERV > NPC Speech
Page: << 1 2 >>
NPC Speech
Author Message
Post #202618 NPC Speech

Here's a basic NPC speech system, it's easy to use and setup and I like to think pretty flexible. It has options make NPCs give random messages or give them in the order you type them.
I've added an option for you to set a chance for them to not speak (Incase you have 5 npcs in a small area it's a chance to reduce spam). I've been jumping back and fourth between trunks so if I've missed anything or you get any errors let me know and I'll post a fix.

Pastebin Link

You will need to change the NPCID sent in the map::msg function to a char also! It's a short atm I think.

7 years, 8 weeks ago
Post #202620 Re: NPC Speech

This looks awesome! I'll try it out when I get time.

Thank you for sharing.

---
Just your friendly neighborhood Programmer-Man!
7 years, 8 weeks ago
Post #202621 Re: NPC Speech

Wow, you like to type. It should be about 25 lines of code tops to product NPC chats, and that includes some nice global config options.

7 years, 8 weeks ago
Post #202622 Re: NPC Speech

Much appreciated! 

7 years, 8 weeks ago
Post #202623 Re: NPC Speech
Apollo posted: (2nd Mar 2017, 02:47 pm)

Wow, you like to type. It should be about 25 lines of code tops to product NPC chats, and that includes some nice global config options.


You should definitely release that system and save everyone the hassle of typing all this code! Or just post the most obnoxious comment and leave.
7 years, 8 weeks ago
Post #202625 Re: NPC Speech
callum posted: (2nd Mar 2017, 05:43 pm)

Apollo posted: (2nd Mar 2017, 02:47 pm)

Wow, you like to type. It should be about 25 lines of code tops to product NPC chats, and that includes some nice global config options.


You should definitely release that system and save everyone the hassle of typing all this code! Or just post the most obnoxious comment and leave.

Done
7 years, 8 weeks ago
Post #202626 Re: NPC Speech

Cool, thanks for releasing. I'll check it out later for sure. I'm going to start getting into programming soon, so this will be a useful example to look at.

---
EO Resources/Guides: â—„ eobud.boards.net â–º
7 years, 8 weeks ago
Post #202649 Re: NPC Speech

Awesome release Callum. I'm sorry for the criticism Apollo gave you. Maybe he should make his own patching system first before criticizing you in this field, hehe <3  ♥ <- that was a alt + 3 heart symbol...  

---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
7 years, 7 weeks ago
Post #202653 Re: NPC Speech
Hacker_Alex posted: (5th Mar 2017, 12:00 am)

Awesome release Callum. I'm sorry for the criticism Apollo gave you. Maybe he should make his own patching system first before criticizing you in this field, hehe <3  ♥ <- that was a alt + 3 heart symbol...  


I put it here:

https://eoserv.net/forum/topic/23929#post202624

You don't need a patch for something so little code to make this work. Maybe I am a bit harsh when I am being critical, but there is often times a lot of bulky releases that could be done far more efficiently. It isn't me trying to hurt anyone's little fee fees, but rather encourage them to figure out how to condense their work into the least possible code. Let me give you an example. Once I saw a patch to PK that essentially was a copy of the entire PK function for an exception for team mates. I explained that it could be done with one line: if (...) continue;. I hope you get it. I don't think I need to explain further.

7 years, 7 weeks ago
Post #202662 Re: NPC Speech

Not that it's about picking sides, but I'd have to agree with Callum/Hacker_Alex here. Almost no one else including yourself releases code to help others.

I'm not saying you have an obligation to help, but you often comment on others code whether criticizing or not, without providing any code to backup what you're saying.

My point is, it's somewhat irrelevant to say to someone you could code something much better, without providing any code or details of how to.

Where as Callum actually released a working example. It may not be perfect as you point out, but it's available and updated for rev535 and I'm sure works fine.

Do you see what I mean? Where else is there updated npc speech code released? You may have your own system coded. But it will obviously not be released, right?

My main point here, is it's pointless to tell someone they can code something better, without providing any details/insight on how to do it.

I'm in no way trying to offend you by the way, or take away from what you've done to help out around here with other things.
For most people, Callums code is the closest they will get, since more advanced programmers usually don't release these types of codes/features, and newer programmers, will find it to be a huge challenge at first.

Anyways I still have not got around to trying this yet, I will probably take a look at it tomorrow. Just been occupying my time with other stuff. =D


---
EO Resources/Guides: â—„ eobud.boards.net â–º
7 years, 7 weeks ago
Post #202663 Re: NPC Speech
shayne posted: (5th Mar 2017, 10:12 am)

Not that it's about picking sides, but I'd have to agree with Callum/Hacker_Alex here. Almost no one else including yourself releases code to help others.

I'm not saying you have an obligation to help, but you often comment on others code whether criticizing or not, without providing any code to backup what you're saying.

My point is, it's somewhat irrelevant to say to someone you could code something much better, without providing any code or details of how to.

Where as Callum actually released a working example. It may not be perfect as you point out, but it's available and updated for rev535 and I'm sure works fine.

Do you see what I mean? Where else is there updated npc speech code released? You may have your own system coded. But it will obviously not be released, right?

My main point here, is it's pointless to tell someone they can code something better, without providing any details/insight on how to do it.

I'm in no way trying to offend you by the way, or take away from what you've done to help out around here with other things.
For most people, Callums code is the closest they will get, since more advanced programmers usually don't release these types of codes/features, and newer programmers, will find it to be a huge challenge at first.

Anyways I still have not got around to trying this yet, I will probably take a look at it tomorrow. Just been occupying my time with other stuff. =D



He posted his here: https://eoserv.net/forum/topic/23929#post202624
7 years, 7 weeks ago
Post #202666 Re: NPC Speech

Tbh guys If anyone uses this code or parts of it to make something better then it's a win. My code is far from perfect but then again, I don't claim it's perfect. It's just a shame it takes Apollo the need to be superior to release something.

7 years, 7 weeks ago
Post #202670 Re: NPC Speech
callum posted: (5th Mar 2017, 01:21 pm)

Tbh guys If anyone uses this code or parts of it to make something better then it's a win. My code is far from perfect but then again, I don't claim it's perfect. It's just a shame it takes Apollo the need to be superior to release something.


No its a shame you get your feelings hurt so easy. I have seen better code from you to be honest. What I was trying to get you to do was think about what is necessary to achieve the result. In its simplest form it is string = file text and send a packet to nearby players. Sounds pretty minimal right? Anyway, I wasn't trying to get you all riled up over something so trivial.

@shayne I released the NPC chat as it works in main. It is 19 lines plugged into NPC Act plus a couple of declarations elsewhere. It's not that I don't want to release code, it is that I probably have shared way too much code that winds up in some random build somewhere. I think this and Marriage are the only remaining features missing in EOSERV so realistically there isn't much room for releases.

7 years, 7 weeks ago
Post #202672 Re: NPC Speech
Apollo posted: (5th Mar 2017, 05:04 pm)

callum posted: (5th Mar 2017, 01:21 pm)

Tbh guys If anyone uses this code or parts of it to make something better then it's a win. My code is far from perfect but then again, I don't claim it's perfect. It's just a shame it takes Apollo the need to be superior to release something.


No its a shame you get your feelings hurt so easy. I have seen better code from you to be honest. What I was trying to get you to do was think about what is necessary to achieve the result. In its simplest form it is string = file text and send a packet to nearby players. Sounds pretty minimal right? Anyway, I wasn't trying to get you all riled up over something so trivial.

@shayne I released the NPC chat as it works in main. It is 19 lines plugged into NPC Act plus a couple of declarations elsewhere. It's not that I don't want to release code, it is that I probably have shared way too much code that winds up in some random build somewhere. I think this and Marriage are the only remaining features missing in EOSERV so realistically there isn't much room for releases.


Your comments don't bother me, they do need to taken loosely though. I'm normally first in line to get straight from configs as you've probably seen,  I just seen how drops were loaded and wanted to do something similar.
7 years, 7 weeks ago
Post #202676 Re: NPC Speech

It's all good, but something else you missed was yours would have problems with still NPC's that call return. 

7 years, 7 weeks ago
Page: << 1 2 >>

EOSERV Forum > EOSERV > NPC Speech