Sign in to follow this  
Batta

NPC item exchange?

Recommended Posts

Is there a way to create a mission so that a player can somehow trade an item with an NPC?  For example, if the player gives the NPC a pelt, it will give back a coin.

 

I haven't figured out a way to get an NPC to take an item from a regular player, yet, or how to get it to give a coin.

  • Like 1

Share this post


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

Yes you can.

It will require database manipulation though.

 

I see. Would you please describe what needs to be done?

Share this post


Link to post
Share on other sites

Add a trigger with the item you want to use (say longsword) on the NPC. "Give" command.

Set the effect that you should get an acorn or something.

Open the wurmplayers database using sqlite and edit the triggereffect. Change the REWARDITEM to the item you want them to get (like 58 to get a twenty copper coin etc).

 

*Edit*

You should ofc change the triggereffect, not the trigger.

Edited by Jukken
  • Like 1

Share this post


Link to post
Share on other sites
On 12/13/2017 at 0:08 AM, Jukken said:

Add a trigger with the item you want to use (say longsword) on the NPC. "Give" command.

Set the effect that you should get an acorn or something.

Open the wurmplayers database using sqlite and edit the triggereffect. Change the REWARDITEM to the item you want them to get (like 58 to get a twenty copper coin etc).

 

*Edit*

You should ofc change the triggereffect, not the trigger.

Just to clarify, I assume that is the one in the "WurmServerLauncher", not the "WurmLauncher", right?

Share this post


Link to post
Share on other sites
On 12/12/2017 at 9:08 PM, Jukken said:

Add a trigger with the item you want to use (say longsword) on the NPC. "Give" command.

Set the effect that you should get an acorn or something.

Open the wurmplayers database using sqlite and edit the triggereffect. Change the REWARDITEM to the item you want them to get (like 58 to get a twenty copper coin etc).

 

*Edit*

You should ofc change the triggereffect, not the trigger.

 

I've run into a problem that maybe you can help me with?  I set up the mission on an NPC Human, exchanging a yoke for an iron ribbon.  I checked, and the exchange worked.

 Then I shut down the server, opened the wurmplayers database, and changed the REWARDITEM as you mentioned, to make it small nails (218).  I saved the db changes, patched the changes with patcher.bat, and restarted the server.

When I got back in, the mission still showed up when I chose Manage missions, but the NPC Human was completely gone. I did a locatecreatures for her, and she is just not in the world anymore. I have to think it's something I did wrong, but I don't know where to search for my error.  

Edited by Batta

Share this post


Link to post
Share on other sites

She has probably wandered off.

Look in the wurmcreatures.db database and search for her. Use the WurmID number to locate her.

Share this post


Link to post
Share on other sites
9 hours ago, Jukken said:

She has probably wandered off.

Look in the wurmcreatures.db database and search for her. Use the WurmID number to locate her.

 

I found her (her name is Yoke for Nails) in the db, but when I input her WurmID into the GM Tool to locate her, it says "no creature found with that ID."  I had her in a locked enclosure, with no permissions to pass the gate. 

Edited by Batta

Share this post


Link to post
Share on other sites

Then she is probably dead I'm afraid.

You need to remake the triggers.

Share this post


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

Then she is probably dead I'm afraid.

You need to remake the triggers.

 

Oh!  I didn't realize that dead creatures still show up in the wurmplayers database!  

Share this post


Link to post
Share on other sites

NPC´s can die? I have a lot of NPC´s in my trainingscamp for near 6 month

 

Eject

Share this post


Link to post
Share on other sites

They can. Abit rare, but is happens.

I suggest locking them up.

Share this post


Link to post
Share on other sites
41 minutes ago, Jukken said:

They can. Abit rare, but is happens.

I suggest locking them up.

 

Mine was young, and in a locked pen.

 

Share this post


Link to post
Share on other sites

I don't think they can die from age, but can be killed by other creatures.

Share this post


Link to post
Share on other sites

From my experience NPC will always disappear on server restart. Believe they are stored in player db but area always gone when reset happens. Not sure if summoning NPC with that exact name will make it that same NPC or not. It is one of the reasons I have not made any missions using NPC because they kept disappearing on me. I attempted modding in some NPCs but either get fall back that looks like a ghostly glitch or get models that I cannot do anything with equipment weise. Maybe I missed something when creating them but giving the custom ones armor or weapons would not allow rendering of the items. 

Share this post


Link to post
Share on other sites
On 12/31/2017 at 5:14 PM, Jukken said:
6 hours ago, Jerone0601 said:

From my experience NPC will always disappear on server restart. Believe they are stored in player db but area always gone when reset happens. Not sure if summoning NPC with that exact name will make it that same NPC or not. It is one of the reasons I have not made any missions using NPC because they kept disappearing on me. I attempted modding in some NPCs but either get fall back that looks like a ghostly glitch or get models that I cannot do anything with equipment weise. Maybe I missed something when creating them but giving the custom ones armor or weapons would not allow rendering of the items. 

That definitely hasn't been my experience.  We have NPCs who have been around for almost a year.  It was only these two new ones that I altered in the database that disappeared, and I have no idea why.  But NPCs usually don't disappear on restart.

  • Like 1

Share this post


Link to post
Share on other sites

Weird I have always had them disappear. Also when we had the vampire mod running for a bit those NPCs would disappear each restart and Friya and I couldn't figure out why. I haven't tried in a long time so maybe I will try again soon and see what happens. 

Share this post


Link to post
Share on other sites

My NPCs have been up for years, not a problem. One was however killed by a dragon (accidental blast by fire I think). Quite annoying.

Share this post


Link to post
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.

Sign in to follow this