Jump to content
Stephenw1992

NPC Logic

Recommended Posts

hey everyone (and @Ane if nobody else knows)

Right now I'm programming a whole load of npcs for trading, has anyone found a way to empty an npcs inventory without either despawning them or doing what i'm currently risking and setting up logics to check their inventory for every individual item? this is going to drive me (and my server) insane at this rate lol

Share this post


Link to post
Share on other sites

I haven't tried to despond someone's inventory, but I'm not even sure how to check that it is empty.

I know the standard vendor NPC is spawned in at a certain time. It just needs to be assigned a label for Logic to interact with it. An action sequencer populates the inventory for the vendor. This may be less laggy overall. 

Are you trying to preserve the inventory for each vendor, when a player interacts with it?

Share this post


Link to post
Share on other sites
3 minutes ago, mid endian said:

I haven't tried to despond someone's inventory, but I'm not even sure how to check that it is empty.

I know the standard vendor NPC is spawned in at a certain time. It just needs to be assigned a label for Logic to interact with it. An action sequencer populates the inventory for the vendor. This may be less laggy overall. 

Are you trying to preserve the inventory for each vendor, when a player interacts with it?

hey man,

no i've tried all kinds of things. assigning labels to items, assigning to vendors... 

the only way i have been able to so far is by using "check inventory" and having "remove" checked. the idea is to empty the inventory of a specific group of NPCs but without despawning and spawning new, the only way so far seems to be what i mentioned above. at this rate i may just kill and respawn them since there going to be thousands of items to check for and that is not going to be healthy on the server

Share this post


Link to post
Share on other sites
2 minutes ago, mid endian said:

If you can set up a night time zombie (mummy, mutant) spawn, let us know. 

yes you can, one of the changes in the update was you can make time triggers start at a certain time of day. you would be able to use them, labels as points to spawn at, or even link them together to create waves. by assigning spawned enemies a label you can despawn/kill/disintegrate using a time trigger set to start at a time (eg 6am,) and "perform action with entity">"labelled entity">assigned label>"disintegrate"

if you dont want them to despawn however, make sure you have an event listener programmed to listen for a set limit on said labelled entities to disable spawning or you may end up with more than a full server could cope with 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

You can now target all items in player's/NPC's inventory. (or all items in chest)

20180220085810_1.jpg

  • Like 1
  • Thanks 2

Share this post


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

You can now target all items in player's/NPC's inventory. (or all items in chest)

Thanks @Houp, I have suggestion, how about you guys make videos tutorial? or share open Scenario which have NPCs in it, as for learning source? So we can atleast make something not "brute-force", if you know what I mean. :)

Edited by Velocifer

Share this post


Link to post
Share on other sites

We are working on a new way of editing actions. (current one is really limited and with a lot of actions it is not manageable) So it does not make much sense to make a tutorial now. With the new system there will be something (maybe official "how to" compositions) to teach you how to do something nice in our editor.

  • Upvote 1

Share this post


Link to post
Share on other sites

@Houp Thank you so much! going to test it out now, i couldn't work out the "entity" and "entity inventory item" difference so it's appreciated!
You've just sped work up on my server considerably!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×