Skip to content

Traveling Merchant

Hc_SephirothHc_Sephiroth Member Posts: 10
edited May 2018 in Builders - Scripting
Anyone know how to script a merchant to travel from one area to another selling different items in each area, or have a merchant in one area that appears only at certain times of day?

Comments

  • antirelicantirelic Member Posts: 20
    This shouldn't be too hard to script. You will likely want to use a trigger to spawn the merchant. I strongly suggest against trying to have an NPC travel between areas on it's own (the game doesn't like this). You could also set the conversation of the merchant to launch the nearest store (which can be pre loaded with specific items). If you need the actual scripts, please request...
  • ProlericProleric Member Posts: 1,283
    edited May 2018
    Merchants will reliably jump from one area to another if you set their AI level to normal. That overcomes the tendency for NPCs to go dormant if there are no PCs in their area. For example, you can have a holding area, which no PC can enter, for storing any NPCs who are currently "not at their desk".

    You can also tell the merchant to walk to a waypoint in another area, so that PCs actually see this happen. For an example of how to script this, see the official WalkWayPoints function, in particular the code that moves an NPC from their day post to their night post.

    Conditional scripts in the merchant's conversation can determine which store to open, by tag, based on time, location or whatever. A store doesn't need to be in the merchant's current area, so you can even have the same merchant selling the same stuff in several different areas if you like.
  • MermutMermut Member Posts: 44
    If you want the merchant to sell different items in each area, you could put different stores with the same tag (but different merchandise) in each area he sells. Set your script to open the 'nearest' store with the specified tag. That will always get the store in the same area as the merchant.
Sign In or Register to comment.