"Live" Editing.

01/01/2010 03:55 Santa#1
Hey, I was just wondering if there is a way to edit Npc Dialog without restarting/compile the server to see the changes. Like how Qonquer or Jonquer has it, i know they can change Npc Dialog without restarting the server, is that just a java thing?
01/01/2010 04:26 N¡ghtMare ?? WooT#2
If you use C#, i dont think is possible, maybe.
You need to make alot of hard coding.
The reason why i say is might not possible.
Is because you need to debug.
But is possible, but alot of hardcoding.
01/01/2010 05:47 CptSky#3
Use extern NPC Script and when someone want to talk with a NPC, you read the script.
01/01/2010 06:51 _tao4229_#4
Use a scripts instead of hard code or you'd have to write some kind of debugging engine that would let you modify the code at runtime.
01/01/2010 07:44 pro4never#5
You could do something using ini files or a database npc system but that would require some significant source editing unless I'm mistaken. Large npcs would still not be easily codeable without restarting but it would allow for simple changes such as text.

I know CoEmu was partially converted at one point to use the database to store simple npc stuff. All the real "code" behind the npcs was still server side though.
01/01/2010 07:56 _tao4229_#6
You could easily implement an IronPython or Ruby engine into a C# server
01/01/2010 08:17 InfamousNoone#7
Are we all forgetting my inlined C# and VB.NET engines?
/brag
01/01/2010 08:58 _tao4229_#8
*cough* memory leak *cough*
01/01/2010 09:01 © Haydz#9
Quote:
Originally Posted by _tao4229_ View Post
*cough* memory leak *cough*
You should get that cough sorted.
01/01/2010 12:33 Korvacs#10
Plenty of ways of doing this.

1) Scripts which are read when someone interacts with an npc.

2) Scripts which are stored seperate and loaded into the server using a method. (call the method when you update something)
3) C# Scripts which are stored seperate and compiled using a method.

4) Database based Dialogs which are loaded when you interact with the npc or by using a method.

5) Ini file style script loaded when interacting or via metthod.

Thats 5, theres alot more options, just use your imagination.
01/03/2010 08:59 Qonquer#11
On QO this is possible because the NPCs are not just dialogs, they are entire class files that are compiled in-line via our Admin Control Panel. When an NPC is clicked, the server loads the relevant class and executes it. Thus to change an NPC we just compile a new version of just that NPC and replace the class file, so the next time the NPC is clicked, the new class executes. This also has the advantage of allowing NPCs full access to the main server code allowing an NPC to do almost anything.