Jump to content

Utility: News NPC


Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

News NPC


Description
A News npc that will let the players read news from the server stocked in sql. It can print colors and show an animated showevent to attract players if there's a new news.
Each news is separated in 2, the resume and more. Make a short version of your news and then explain it more. That way you have more chance to spread at least the important part of it to the players.

Installation
-Run this sql command

CREATE TABLE IF NOT EXISTS `z_custom_news` (`id` int(11) NOT NULL AUTO_INCREMENT,`News` text NOT NULL,`Resume` text NOT NULL,`More` text NOT NULL,PRIMARY KEY (`id`))

-Add news

-Edit the !!Modify  Lines

-Check if you want to edit anything in the OnInit.

-Load the npc (news.txt) and voila!

-The news are sql and to update in game, just make a gm talk to it, no need to reload it each time. Not making it checking each time someone talk to it (or each hour ect) make the npc less ressource consuming, but you can edit it and make the request everytime.

Information
-It does not make a lot of sql request, it only update when a gm talk to it and chose to update.

-It saves the highest news seen and print an event to attract the attention of the player, commenting all the !!Saving Mecanism!! lines removes it. It does not save which one you saw.

-You can add color using ^RRGGBB and adding new lines using # (editable)
 


  • Submitter
  • Submitted
    05/15/2020
  • Category
  • Video
     
  • Content Author
    Kreustoo

 

Edited by Kreustoo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  09/27/12
  • Last Seen:  

good day brother.. sorry i want to ask to you why when i update it at npc but nothing happen and i only able to update news from database manually this is the picture.

manual.png
screenGatherRO048.jpg

 

screenGatherRO049.jpg

 

Thanks for your support ..

^_^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

@daLWeeeeelll, maybe it's not obvious but when you're a gm, talk to it again without updating it. I think that's just that?
I'll make a patch making that after updating it go to the news part even for gm directly.

EDIT: Patch uploaded, 1.2.0 it is

Edited by Kreustoo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  06/12/12
  • Last Seen:  

How to make it work with another language in UTF8?

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

@nickhun07 What is the problem? You have some character being weird inside the npc?
I used to print french accent in it without any problem ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  06/12/12
  • Last Seen:  

4 hours ago, Kreustoo said:

@nickhun07 What is the problem? You have some character being weird inside the npc?
I used to print french accent in it without any problem ?

I would like to print Thai language and i did change Collation in Mysql to UTF8_unicode_ci.  it shows ?????????? in game.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

@nickhun07Try with this?

CREATE TABLE IF NOT EXISTS `z_custom_news` (`id` int(11) NOT NULL AUTO_INCREMENT,`News` text NOT NULL,`Resume` text NOT NULL,`More` text NOT NULL,PRIMARY KEY (`id`))
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...