Sign in to follow this  
bdew

[Alpha] Custom NPC

Recommended Posts

This is a work in progress, more stuff coming in the feature.

 

Allows you to spawn a "Custom NPC", which work similar to vanilla NPCs, except:

 

  • They don't talk... for now.
  • By default the won't move around.
  • Can be set (Manage->Movement) to wander inside the territory of a village or a house.
    • NPCs that end up outside their area will teleport back. If you want to move an NPC, set it to "Static" first then summon to the wanted location.
  • Their face can be customized
  • You can directly change their equipped items (Manage -> Equipment)
  • Can be told to turn towards you or come to your location

 

Data for NPCs is store inside your world folder, in a new folder "npc_data", the files can be edited by hand but don't do it while the server is running.

 

Planned features:

  • More movement schemes
  • Ability to set animations
  • Custom chat scripts, response to keywords, etc.
  • ...? Have any ideas? let me know!

 

Download and source code: https://github.com/bdew-wurm/customnpc/releases

Edited by bdew
  • Like 12

Share this post


Link to post
Share on other sites

Will armor appear when given to the custom NPCs? Are they kill able? Can they be attacked on a PvE server?

Share this post


Link to post
Share on other sites

Having them do tasks, like shearing or milking stuff like that.. 

  • Like 3

Share this post


Link to post
Share on other sites

Yayyyyyyyyyyyyyyyyyyyyyyyyy!!!!!!!!!!!!! This is something I've DREAMT of since my early days of Wurm. And as you might have noticed, I already gave a lengthy response over here:

 

So, I dove right in to test this baby out of course and came up with the first problem: I had always assumed that the NPCs you could spawn could be dressed by Look > Equipment, like you would dress a horse with a saddle and bridle. But I wasn't able to. It said "You are not allowed to do that":

 

npc_clothing.jpg

 

So for me, this would be the first thing I'd love we could do. 

 

The movement options are amazing btw, absolutely love the way you set that up! 

Edit: Oh one thing does come to mind, if it's not too hard to do. But would it be possible to add an option so they are only restricted to a room as well? I guess by setting that they should not walk through doors or arches. I have a tavern that has the kitchen section and the actual bar itself. I would love Christopher the cook to walk around only in the kitchen and keep the bartenders in the bar section.

 

The stuff you have planned all sounds wonderful as well! Out of those, the ability to set their face and hair will be awesome. Until then I'm happy to keep spawning different npcs until I get the right look. 

Also being able to choose their animation will be great. It will really enhance the LIFE aspect I talk about in my other post! 

 

Great work bdew! I'm truly thankful as always! 

 

 

 

Edited by Malena

Share this post


Link to post
Share on other sites

Oh and by the way do these summoned NPCs have life spans and eventually die?

Share this post


Link to post
Share on other sites

And is there any way to rotate, push and pull them while they are in static mode?

And I really feel greedy asking about this, but any possibility to make them sit on chairs and benches? 

 

Again though, even at the level that this mod is already now, it's absolutely wonderful and more than we could dream of!

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, bdew said:

Custom chat scripts, response to keywords, etc

Wonderfull mod sooo amazing =)))

I am courius about the chat scripts, with this mod, there will come so many new ways to improve your world. Thank you Bdew!

 

A little question.......can you use this new Npc´s also for missions?

 

Eject

Share this post


Link to post
Share on other sites
11 hours ago, bdew said:

...? Have any ideas? let me know!

 

This is great!  I'd love it if we could attach them to missions. Right now I have multiple NPC Humans at my spawn town, with missions to give a gift and a pop up message if players choose Talk.  Mine chatter a lot, and move all over the place. This mod sounds like it would solve those problems, as long as I can still do missions.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Malena said:

I had always assumed that the NPCs you could spawn could be dressed by Look > Equipment, like you would dress a horse with a saddle and bridle.

 

I dress my NPC Humans by activating an article of clothing, then right clicking the NPC and choosing Give. It shows up on the NPC.

Share this post


Link to post
Share on other sites
2 hours ago, Jerone0601 said:

Will armor appear when given to the custom NPCs? Are they kill able? Can they be attacked on a PvE server?

 

Armor, weapons, tools etc will appear. They are flagged as invulnerable so shouldn't be possible to kill, but this needs testing.

 

2 hours ago, ozmods said:

Having them do tasks, like shearing or milking stuff like that.. 

 

Interacting like that with the world is outside the scope of what i have planned... at least for now.

 

1 hour ago, Malena said:

 I had always assumed that the NPCs you could spawn could be dressed by Look > Equipment, like you would dress a horse with a saddle and bridle. But I wasn't able to. It said "You are not allowed to do that":

 

For now you can give them items by activating the item, clicking on the NPC and using "Give", they will equip the item if they can (this also applies to vanilla NPCs). I'll see about enabling interaction via the equipment window.

 

1 hour ago, Malena said:

But would it be possible to add an option so they are only restricted to a room as well?

 

I'll look into adding that.

 

1 hour ago, Malena said:

Oh and by the way do these summoned NPCs have life spans and eventually die?

 

Don't think so... but needs testing.

 

1 hour ago, Malena said:

And is there any way to rotate, push and pull them while they are in static mode?

And I really feel greedy asking about this, but any possibility to make them sit on chairs and benches? 

 

I'll add the ability to move them more easily. For now you can do it with Summon for the static ones, but no way to change their facing i think.

I'll look at letting them sit, not sure how feasible it is.

 

38 minutes ago, Eject said:

A little question.......can you use this new Npc´s also for missions?

 

They should work with mission triggers like examine and such.

 

  • Like 2

Share this post


Link to post
Share on other sites

Most important - they will NOT spawn on the ground when server restarts. They will spawn on the correct floor inside a building.

  • Like 2

Share this post


Link to post
Share on other sites

First, I'm French and my English is bad, I use google trad.

Congratulations for your work that makes this game more complete and open.

Would it be possible to add dialogs in this mod ... or a separate mod.
Dialogues that one could create / edit in DM and saved in XML file or other format easy to edit with NP ++, in the directory "npc_data" or another directory.

Share this post


Link to post
Share on other sites
22 hours ago, bdew said:

Planned features:

  • Custom chat scripts, response to keywords, etc.

 

If you mean this, it should come

Share this post


Link to post
Share on other sites

I think that the chat script (answer to keywords) and the dialogs are two different things. the first pemet in a tavern for example to say "A drink waitress if he please" and on the recognition of the word "drink", the NPC waitress come serve you to drink. The dialogs are used to display a suite of information in dialogs box using the command prompt "speak" on an NPC.

Hello, what do you want ?
1 - Can you tell me where is the nearest tavern?
2 - I'm hungry, where to eat?
3 - Nothing, thank you.

1 ->
Can you tell me where is the nearest tavern?
You will find the drunken dwarf tavern north of the city.
1 - Thank you.

2 ->
I'm hungry, where to eat?
At the inn of the two bears located at the crossing of Soufflevent and Bois-Noyé they serve as excellent rotis deer.
1 - Thank you.

 

Edited by Alvin

Share this post


Link to post
Share on other sites

To be honest i was mostly thinking about using chat to "talk" to NPCs because that's how it worked in UO (and this mod is 99% inspired by @Malenaand her UO project). But yeah having dialog trees like more modern RPGs could be nice as well. I'll think about it when i actually get to that part.

  • Like 3

Share this post


Link to post
Share on other sites

v0.2 is out

  • Added face customization
  • Added equipment management
  • Added "Come here" command - makes the NPC come to your location. Or at least try to. This temporarily suspends whatever movement routine is used and will resume it when the command is finished.
  • Added "Face me" command - makes the NPC turn towards the player.

https://github.com/bdew-wurm/customnpc/releases/tag/v0.2

 

 

 

On 1/20/2018 at 9:17 AM, Malena said:

Oh and by the way do these summoned NPCs have life spans and eventually die?

 

Checked that - no they don't. Age is tracked internally but they will never show it or die of old age.

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Hey bdew,

 

Love the concept of this mod.  I know it's alpha but in case I am discovering something to fix in one of the next releases as opposed to some weirdness on my server, I thought I would share that my CustomNPC people disappear on server restart.

 

They are in the creatures table and in the position table.  They just are no longer where I put them when I restart the server (or anywhere as far as I can tell), I tried on static to see if somehow they had moved - still not finding them.  I checked and the positions recorded in the database are correct (after the divide by 4 calculation)

 

I updated my server mod launcher to 0.33 (I was on 0.32.2) just in case.

 

Not sure what I could be doing wrong, I have no problem waiting until next releases obviously (this happened in 0.1 and 0.2), but if you want me to run some queries or something to troubleshoot, I am happy to do that too.

 

thanks

 

 

Share this post


Link to post
Share on other sites
13 minutes ago, Worfeus said:

Hey bdew,

 

Love the concept of this mod.  I know it's alpha but in case I am discovering something to fix in one of the next releases as opposed to some weirdness on my server, I thought I would share that my CustomNPC people disappear on server restart.

 

They are in the creatures table and in the position table.  They just are no longer where I put them when I restart the server (or anywhere as far as I can tell), I tried on static to see if somehow they had moved - still not finding them.  I checked and the positions recorded in the database are correct (after the divide by 4 calculation)

 

I updated my server mod launcher to 0.33 (I was on 0.32.2) just in case.

 

Not sure what I could be doing wrong, I have no problem waiting until next releases obviously (this happened in 0.1 and 0.2), but if you want me to run some queries or something to troubleshoot, I am happy to do that too.

 

thanks

 

 

 

post server log please.

Share this post


Link to post
Share on other sites

Any chance of being able to alter model size? So I could make a dwarf village or giant village kind of thing. If that is out of scope that's cool I will use method I currently use to adjust mob size. This is awesome btw.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Jerone0601 said:

Any chance of being able to alter model size? So I could make a dwarf village or giant village kind of thing. If that is out of scope that's cool I will use method I currently use to adjust mob size. This is awesome btw.

 

Should be possible, i'll add something for that in the furure.

 

1 hour ago, Worfeus said:

 

Hm i'm not seeing anything wrong... can you try looking up one of their IDs in the database, then when the server is running running GMTOOL on it and see if it shows anything fishy (or at all?)

 

Also if you can try running a fresh server with no other mods and see if it works there. if it does add your normal mods until you find the one that breaks it.

Share this post


Link to post
Share on other sites

When I try to do face customization on my male CustomNPCs, I see a female character only on the customization pop-up.  The features do carry over to the male NPC, except there is no option for facial hair removal.  

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Batta said:

When I try to do face customization on my male CustomNPCs, I see a female character only on the customization pop-up.  The features do carry over to the male NPC, except there is no option for facial hair removal.  

 

Hm... It might be taking your character sex instead of the npc's sex. The face customisation window was never meant to be used on other characters, and what i'm doing there is somewhat a hack :P

 

For now you can switch your own character to the right sex before customising... i'll look for a saner solution for a future update. 

  • Like 2

Share this post


Link to post
Share on other sites
ok, not sure if I have a valid theory but I do have an observation...
 
Here is what I did
 
1 - I created a custom NPC - used GMTOOL on it, compared that GMTOOL output to the output for the Guide template NPC and they are pretty much identical.  I cannot do this on any of the missing NPCs because they are not in world and I only know how to hover over something with GMTOOL - I do not know how to pass a wurmId to it.  As a point of interest - this normal looking custom NPC also disappeared on restart
 
2 - I made a new server - whole new directory - disabled every mod expect CustomNPC - same problem - made an NPC, and it disappeared on restart
 
3 - I have a lot of mods - and I am willing to do the 1 by 1 thing but I wanted to try something else first.  I read somewhere that one of the differences between Creative and Adventure was that there were NPCs.
 
4 - I ran the same server instance as in point #2, with all mods disabled expect Custom NPC and ran a vanilla adventure map - it worked and Custom NPC showed up after restart!
 
5 - Litmus - I then did the same with a vanilla Creative map... and it worked also the Custom NPC showed....
 
So since the same mods ran on all three servers - this is something in my server folder?  either in the database or somehow my map??
 
I'll keep digging let me know if you can think of something else you want me to try
 
thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this