Home > Tutorials > Creating a Custom Merchant for The Player’s Camp – Part 3

Creating a Custom Merchant for The Player’s Camp – Part 3

In part 1 of this tutorial series, we looked at how we can use a “PRCSCR” file to get the game engine to run a custom script upon entering an area.  This allowed us to then spawn an NPC character that we created inside the Single Player game’s Player Camp.  In part 2 we looked at the conversation editor, and how to create conversations.  We then gave a basic conversation to our NPC in preparation for turning them into a merchant.

In this part we’re going to actually turn our NPC into a merchant that the player can interact with.  Now unfortunately Bioware made what I feel is a bad decision, and made it so that you can not dynamically create a merchant resource.  If you attempt to use CreateObject() with OBJECT_TYPE_STORE you will find that the call fails every time.   This means we need to think outside the box and figure out how to get our merchant resource into the player’s camp.  So let’s see how we can do that.

What We Have right Now

Let’s take a quick stock of what we have.  We have our PRCSCR file that calls our “spawn” script.  We have our Creature resource, and a Conversation resource that is tied to the Creature.  some of you also have a placeable that you are spawning with the merchant, like a chest or crate.  We also have our ShowLocation debug script.

Just to organize things a bit, what i’ve done is gone and created a few folders in the toolset to contain the resources from each part of the tutorial.  You can easily do this by first opening up the properties of one resource, and in the Folder property just type in a new folder structure and it will create that structure, then move the resource there.  Once the folder(s) have been created, you can simply drag and drop other resources into it.

Folders are per resource however so you need to create them for each, but once you have done that you can click on the ALL resource and you will see everything in a nice neat package.

This isn’t a requirement, I just wanted to get us organized.  You can see what I did below.

So in part 1 we have our Creature resource, the spawn Script, and the ShowLocation debug Script.  In part 2 we have our Conversation resource, and you can see there a sneak peek of what we will be doing in this part, another Script which we will use to open our store from the conversation, our merchant, and a new area? Yep.  Just stay with me 🙂

Why We Can’t Just Spawn a Merchant with CreateObject()

When you first think about this, knowing what you now know from past tutorials, you would think this would be as simple as creating a merchant resource, and then spawning it in our spawn script using CreateObject().  It makes sense, but unfortunately you would be wrong.  That would be great if we could, but Bioware made a strange (in my opinion) decision to limit the use of the CreateObject function.  This is what the Wiki says:

Note that dynamic creation of objects in the engine is subject to a host of limitations, reason being attempts to cut down ‘unaccounted’ memory usage.
Avoid using CreateObject whenever possible.

These objects can be created with CreateObject:
– Creature
– Placeable
These objects can not be created with CreateObject:
– Merchant

Note the section I put in bold. Simply put, the engine will not allow you to spawn a merchant dynamically.  That means we need to find some other way to get our merchant into the camp.  It is time to think outside the box.  There are actually three solutions to this that I thought of.  I’ll briefly detail each, but we will only cover one in detail — for now.

Option 1 – Create a new player camp area, and override the original
Easiest, but least compatible

The first, and easiest way would have been to create a completely new area that duplicates the player camp from Single Player.  In this new area we could then have simply used the area editor to drag and drop in our NPC, crates, and the merchant with ease.  We would never have had to bother with the PRCSCR file, or the spawn script.  nice and easy.  We then could use this new area to override the original.

So if this is so easy why didn’t I go this way at the start?  As most of you know, compatibility is very important to me.  I feel it is vital that mod authors make the effort to make their mod work as well as possible with the base game and other mods, as well as any future mods and DLC’s that might appear.  While this solution is the easiest to do, it is also the least compatible of the choices.  It completely replaces the base camp, and while we might make it look the same, there is always the possibility of it not playing well with other mods and future DLC.

Option 2 – Create a small dummy area that holds our merchant, but also loads up with the original player camp
A bit more work, and fairly compatible

For this option, what we would do is still create a new area for our merchant, but it would be a small dummy area that is actually in the same area list as the player camp.  An area list is a list of areas that the game should consider related, and as such it will load all those areas into memory at once.  You can have one outside area, and an unlimited number of inside areas in an area list.  Since all the areas in the list are loaded into memory, we are able to access objects between areas.

So what we can do is create this dummy area, place our merchant in there, then make sure this dummy area is in the same area list as the player camp.  Then we can simply use the merchant from that area while we are in the single player camp.

This is sort of the “middle of the road” solution.  It isn’t the easiest of the three, but it isn’t the hardest either.  It is more compatible than the first option, but not as compatible as we could make it.  It is however pretty darn compatible.  In this case the only incompatible issue is that we are modifying an area list from the base game.  So in theory this could cause a problem if that area list ever needed to change, but the chances of this for this specific area are pretty slim.

This is the option we will be doing in this tutorial.

Option 3 – Re-use the existing merchant in the player camp
This is the most complicated, but also the most compatible

This option is a bit tricky, but doable.  What you would do is essentially re-use the existing merchant that is in the player camp by saving that merchants complete state when your store is opened, then setting the merchant to your store’s state.  Then when the store is closed, saving your stores state and restoring the original merchant.

This is essentially 100% compatible in that it never overrides anything from the base game.  The only thing that could cause a problem was if some other mod actually removed that merchant, but I can’t see that happening.

The downside to this option is that it is the absolute most complicated and requires extremely advanced scripting.  As such we will not be doing that for this tutorial.

Create a Merchant

The first thing we need to do is actually create our merchant resource.  So go ahead and do that.  It can just be in your module, no need for Core here.

There isn’t much to a merchant really.  Give it a name that the player will see at the top of the store window.  I’m going to name mine “Talia’s Store”.  You can leave the script as it is.  It is just a blank script anyway.  If you prefer then you can change that to (none) to be safe.  After that skip down to Pricing and set your markup and markdown as desired.  This is a percent.  For now I set both of mine to 20%.

Lastly you have an inventory property just like our creature did.  You can go ahead and throw items in there depending on what you want your merchant to sell.  You can also play with the restricted items if you want to get advanced.  This property basically allows you to set items that the merchant buys.  You can either set it so the merchant will only buy the items you specify, or so that the merchant will buy anything except what you specify.  Essentially its either a whitelist or a blacklist.

Save it and your done.  Nice and simple!  Now on to the workaround to actually get this in game.

Creating a New Area to Hold our Merchant

I’m not going to go very in-depth into area creation and editing in this tutorial, as it deserves it own writeup, but we will go through the basics of what we need to do.  Since we can’t spawn a merchant through script, we have be able to just drop it into an area through the area editor.  To do this we will create a small indoor dummy area to hold our merchant.

Go ahead and create a new area resource, and set the module to Core Game Resources.  I’m not 100% positive this is required, as I didn’t test it the other way, but let’s just go the safe route.  Once the new area is created and loaded up, you will see pretty much a black screen with some controls on the left.  The reason the screen is black is because our new area has no area layout.  The area layout defines the static geometry of the area.  Over on the bottom right you will see your area’s properties. Open up the area layout and choose “lak105d”.  This is a nice small indoor area.  We want to keep it small so it loads fast and doesn’t use a lot of memory.  Since we won’t actually be sending the player here, it doesn’t matter what it looks like.  They will never see it.

Once you have set the area layout you should actually see it in the main window.  Quick controls:

  • CTRL-LEFT MOUSE DRAG will pan the view
  • MOUSEWHEEL will zoom the view
  • CTRL-RIGHT MOUSE DRAG will rotate the view

If you are like me and used to most 3D applications that use ALT plus mouse buttons, this will drive you absolutely insane 🙂

Putting our merchant in here is simple.  Just left click once on the merchant resource on the right, then click to place it in your area.  Put it inside the room, wherever.  It doesn’t matter.

Once you have placed your merchant, go ahead and save the area, check it in, and export it.  Do the same with the merchant.  We’re done with them.

Hook the Merchant to our NPC

Now that we have our merchant resource, we need a way for the player to actually open it up.  What we need to do is hook it into the NPC that we already made.  We will tie it into the conversation that we made last time.  This is extremely simple to do.

Create a new script resource, and call it something like “blah_openstore” or whatever you want.  Below is the script we will use.  Remember to change your tags to match what you have, and if you copy and paste the script, make sure you retype any quotes or it wont’ compile.

void main()
{
object oPlayer = GetMainControlled();
// This gets our custom area that we made. Use your area’s tag here
object oArea = GetObjectByTag(“tut_merchant_area”);
if (IsObjectValid(oArea))
{
DisplayFloatyMessage(oPlayer, “Custom area found.”, FLOATY_MESSAGE, 16777215, 20.0);
}
else
{
DisplayFloatyMessage(oPlayer, “Custom area NOT found.”, FLOATY_MESSAGE, 16777215, 20.0);
}
// This gets our merchant resource. Again use your tag here
object oStore = GetObjectByTag(“tut_merchant_001”);
if(IsObjectValid(oStore))
{
DisplayFloatyMessage(oPlayer, “Valid store found. Opening store.”, FLOATY_MESSAGE, 16777215, 20.0);
OpenStore(oStore);
}
else
{
DisplayFloatyMessage(oPlayer, “Could not find valid store!”, FLOATY_MESSAGE, 16777215, 20.0);
}
}

What this script will do when run is first look to make sure the dummy area we made is loaded. This isn’t necessary but it is there for debugging. If the area isn’t loaded we won’t be able to use the store, so this check helps us find whats going wrong in that case. Then it looks for the merchant resource, and calls OpenStore() to actually open the store for the player to use.

You may note that i’m starting to put more debugging into our scripts. This is for two reasons. The first is that our scripts are just naturally getting more involved, so its good to be able to know what is working and what isn’t. The second is to make it easier to help you all when problems do occur. Once you have everything working, you can always go back and just remove the debug code.

Go ahead and get that saved and exported, and then we need to hook it to our conversation, so open up the conversation we made last time.

In the conversation, select the nodes that we want to open the store and down at the bottom select the Plots and Scripting tab.  This is broken into two main sections.  Condition and Action.  Each of those sections is then broken up into Plot and Script.  The condition section allows you to define either a plot requirement or a scripted requirement for that dialog option to be displayed.  The action section allows you to assign a plot or a script that is executed when the player chooses that line of dialog.  This is what we want.  We want to assign our openstore script as the script action for the dialog.

Once you have done that, export your changes to the conversation.  Your merchant is now hooked to the NPC.  When the appropriate dialog options are chosen, the openstore script will be run, opening the store up for the player to interact with.

Now comes the slightly hacky part.

Putting our Dummy Area into the Camp’s Area List

This is the part where we have to override one of the core game files.  What we need to do is get our new dummy area inserted into the player camp’s area list, so that it will get loaded with it. This involves editing the core area list, so please follow along closely.

In the toolset go to FILE->OPEN and browse to wherever you installed Dragon Age.  Go to Modules\Single Player\Data and open the file designerareas.erf.

ERF files are essentially archives.  They pack all the game files into these ERF files.  When you load this into the editor you will see all the files that are in it.  What we want to do is find cam100ar_camp_plains.lst in the list.  This is the area list file for the single player camp.  We know this because the filename matches the camp’s tag and it has the .lst extension. Once you find the file, RIGHT CLICK->EXTRACT RESOURCE and specify where to save it. For now I just save it to my desktop as it makes it easy to access. We’ll put everything where it needs to go when we’re done.

Once you have extracted it, then open that extracted file into the toolset. What we’re now looking at is a compiled file. You’ll note that we don’t actually have the normal editor view of the resource. Instead we are literally seeing the raw data that is in the file. However, the toolset does let us edit this in a way, so we can do what we need to do. You should be seeing something like this:

Go ahead and click the plus button next to Area_List and you will see a new entry “0”. Click its plus button as well and it opens up to show “Area_Name” and you can see the tag for the camp in there.

This is essentially an area list with only one area in it. What we are going to do is insert another area, our area, into the list. Left click to select “Area_List” then right click it and choose INSERT->STRUCTURE. When you do this you will see a new entry has appeared, and it should be “1”. Now Right Click on the “1” and choose choose INSERT->RESREF. Again a new entry will be created. At this point yours should look EXACTLY like this:

Now what we have done is add a new entry to the Area List, but we need to clean this up a bit. Double click on FIELD1 to edit it and change it to “Area_Name”. Exactly that (without the quotes). You essentially want it to match the one that appears under “0”. Once you have done that move over to the right side, the Vlue column and double click that to enter a new value. In here enter the tag of the area you created. This is what mine looks like now:

Yours should look exactly the same except for the area’s tag.  Go ahead and save that file.  Since this isn’t a normal resource, there is no checking in or exporting.  Its like a normal file on your computer.  Just save it.

Ok that’s it.  That is all the “hacking” we need to do.

Exporting and Moving Files

Ok we should be all set at this point, so go ahead and make sure everything is saved, checked-in and exported.  Export your module and manifest XMLs, etc.  You know the drill by now.  The last thing we’re going to need to do is physically move one file to the right location.  The area lis file that we modified, cam100ar_camp_plains.lst needs to be placed into <youraddin>\core\override

With that you should be good!  Go ahead and fire up the game and test it out.  Remember that all of this will only work if the NPC hasn’t already spawned.  So its best to keep a save game right before you enter the camp for testing.

Advertisements
Categories: Tutorials
  1. NewYears1978
    November 18, 2009 at 2:05 pm

    Yay, finally =)

  2. NewYears1978
    November 18, 2009 at 2:19 pm

    Is there a variable that can be used in the Name field that shows the name of the PC character?

    Like %name would show the name chosen by the player?

    • John Vanderbeck
      November 18, 2009 at 2:28 pm

      No

      • Dark_Balor
        November 22, 2009 at 5:37 pm

        yes there it is

        found here : http://social.bioware.com/wiki/datoolset/index.php/Conversation

        i think that all the Dragon Age toolset (and game ) work with XML.

      • Dark_Balor
        November 22, 2009 at 5:39 pm

        sorry, i forgot to add the balise for the first name of the player :

        <FirstName/>
  3. NewYears1978
    November 18, 2009 at 3:02 pm

    It worked the first time, awesome job man thank you. (Actually it didn’t work the first time, but I had forgot to renameto “Area_name” in the list file.

    Look forward to whatever is next, these are so great for learning.

    • John Vanderbeck
      November 18, 2009 at 3:17 pm

      Most likely be a few smaller tutorials for a bit. The bigger ones like this take a whole heck of a lot of work!

  4. NewYears1978
    November 18, 2009 at 3:21 pm

    I can sure see how they are a lot of work.. I got this working and figured it’d be easy to add in say another crate or placeable with my other crate so I simply added some lines to my script..but it won’t show up no matter what…

    #include “wrappers_h”
    void main()
    {
    // The first thing we want to do, before anything, is look around and see
    // if we have already spawned this merchant
    object oPlayer = GetMainControlled();
    DisplayFloatyMessage(oPlayer, “merchant”, FLOATY_MESSAGE, 16777215, 20.0);
    object oMerchant = UT_GetNearestObjectByTag(oPlayer, “jlp_npc_hoarder”);
    if (!IsObjectValid(oMerchant))
    {
    // If we get to this code, it means the merchant has not been placed yet
    // So let’s do that

    // get an object pointer to the party camp area
    object oArea = GetObjectByTag(“cam100ar_camp_plains”);
    // create a location for where our merchant NPC will be placed
    location lMerchantLocation = Location(oArea, Vector(134.270264, 111.795937, -0.781055), -142.727050781);
    // Spawn the NPC
    CreateObject(OBJECT_TYPE_CREATURE, R”jlp_npc_hoarder.utc”, lMerchantLocation);
    //Now lets create a location for our crate
    location lCrate1Location = Location(oArea, Vector(132.385178, 109.582336, -0.948085), -135.615631104);
    // and spawn the crate
    CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_crate_wd_large_stat.utp”, lCrate1Location);
    //Now lets create a location for our barrells
    location lBarrell1Location = Location(oArea, Vector(129.581039, 107.992043, -1.054222), -127.816696167);
    // and spawn the barrells
    CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_barrel_stack.utp”, lBarrell1Location);
    }

    }

    I have my save game saved when the addon wasn’t active, and not in the camp…. I have so many issues when I try to chagne things it really throws me..

    • NewYears1978
      November 18, 2009 at 3:24 pm

      Secondary question to the above, I unloaded my addon saved outside camp, went to camp..my NPC dissappeared as I expected, but my crate is still there..

      How can I get a “true clean” save file to work when when testing my mods..I assume this is my problem is that my saves had the mods active and such..

      (Aside from just going to a much older save…although I will see if I have one that will work)

      • NewYears1978
        November 18, 2009 at 3:27 pm

        Sorry to spam your bog. I loaded back a blank camp save, left camp, saved this as my BLANK CAMP test save..and this worked…things working as intended.

  5. PokeyPenguin
    November 18, 2009 at 3:41 pm

    Hey, couldn’t help but notice you were messing around with Talmud….did you manage to get it to work in your mod (not installing it with updater) without it breaking all your companions? The chest appears to work fine, but all my companions act like I never met them before. Cant seem to figure out why.

    • John Vanderbeck
      November 18, 2009 at 3:57 pm

      I never actually installed it like normal. I downloaded the Build to Builder package to dissect it for knowledge, and then rebuilt it myself.

  6. NewYears1978
    November 18, 2009 at 3:49 pm

    I wanted to PM this but there is no capability on your blog..

    On your showlocation is there a way to make this export to a file rather than just a floaty message?

    Currently I am taking a screenshot but its quite a pain whenyou want to place multiple items.. if I was creating my own “area” this wouldnt be so bad as I would just drag them in..but since you cant do that in existing areas …figured making it easier in any way possible would be nice.

    • John Vanderbeck
      November 18, 2009 at 3:59 pm

      You could try LogTrace() or PrintToLog() which are some debug functions used elsewhere in the scripts, but they may or may not work. I believe most of the debugging functions were compiled out of the engine before release. Which to be honest is a real shame for us 😦

  7. NewYears1978
    November 18, 2009 at 4:08 pm

    Seems completely stupid to release the toolset, but break most of it’s functonality or debugging tools…odd.

  8. weriK
    November 18, 2009 at 4:26 pm

    So the secret is out 🙂

    Good job on the tutorial!

    • John Vanderbeck
      November 18, 2009 at 4:39 pm

      Secret is out? Damn, I thought I was the first to manage this! Oh well 🙂

  9. Sinistral
    November 18, 2009 at 4:52 pm

    Could you post the script you use for the 3rd option you found for the merchant?

    • John Vanderbeck
      November 18, 2009 at 4:55 pm

      I never actually wrote it. I worked it all out, and wrote some pseudo code, but never the final script. Its pretty darn complex, involving trapping a lot of events, and some trickery to shuffle inventories around. The main reason it gets tricky with the events is because I could find no direct way to tell when the store is closed. So my plan was to trap the GameMode change event to tell if i’m coming OUT of a GUI into Exploration mode, AFTER having gone into the store.

  10. Sinistral
    November 18, 2009 at 5:51 pm

    Whole reason I asked was because I didn’t find kind of event for closing a store either.

    Interesting idea though. I’m still not 100% comfortable with this game’s event handling to tell the truth.

    • John Vanderbeck
      November 18, 2009 at 6:12 pm

      I learned from the NWN days that you often need to think creative 🙂

  11. DSavant
    November 18, 2009 at 5:57 pm

    This is a good solution, but it might be more compatible to just put another creature in the new area we created and teleport there and back. Anyone know how to do a teleport from a script? Do you just setlocation or is it something more difficult?

    • John Vanderbeck
      November 18, 2009 at 6:12 pm

      I don’t know what you mean more compatible. What we did is perfectly fine. The only thing about this entire project that could cause any issues is overriding the area list, and that’s highly unlikely.

      • DSavant
        November 20, 2009 at 10:12 am

        I just mean that if everyone followed this approach some areas would end up with a long list of additional areas loaded – instead of just loaded as needed.

      • John Vanderbeck
        November 20, 2009 at 10:59 am

        Obviously it isn’t something you want to do all over the place. Its merely an example of how you can do things and how you can get around problems. If I was making this module FOR RELEASE, I wouldn’t use an area list. I would use Option 3 that I mentioned.

      • Thynwar
        November 25, 2009 at 9:19 am

        Hello guys ,
        how can i put my own created Armory sets in the Merchants inventory ?

        Please help 🙂 thank you

  12. NewYears1978
    November 18, 2009 at 6:55 pm

    I agree with John, I would much rather have the person in the camp…that was the whole point. Had we just wanted an area transition..that woulda been easier..but a big hassle to have to transition back and forth.

    Although a new area should would make decorating it easier..this placement item by item is horrendous..items end up overlapping or being just off etc etc..nearly impossible to stack them without more knowledge of coordinates..etc…

    • DSavant
      November 20, 2009 at 10:18 am

      It’s a toss up in my mind. I’ve started creating a separate area based on the inside of Flemeth’s hut and then linking to it from a number of areas (camp, soldier’s peak, orzammar, alienage, etc.)

      I’ve got to say though, I’m impressed with how John figured this out – I’d given up on merchants in existing areas until reading this.

  13. Caladon
    November 18, 2009 at 8:12 pm

    Sweet John, Streight, to the Point and it Works! as usuall!

  14. Caladon
    November 18, 2009 at 8:26 pm

    Now how can we add an enchanter to Soldier’s Peak? lol

    • John Vanderbeck
      November 18, 2009 at 8:44 pm

      I haven’t even gotten to Soldier’s Peak yet. Too busy doing this stuff lol. However, you have all the knowledge now to do it yourself! Or most of it anyway.

      • Caladon
        November 18, 2009 at 9:22 pm

        Ya just need to figger out the correct area tag name i.e. cam100ar_camp_plains for Soldier’s Peak

      • John Vanderbeck
        November 18, 2009 at 9:41 pm

        GetTag(GetArea(GetMainControlled()))

      • Caladon
        November 18, 2009 at 10:46 pm

        How do I Place That in your get item script? this is what I’ve Tried

        /—start script—/

        object oPC = GetHero();
        location lLoc = GetLocation(oPC);
        vector vPos = GetPositionFromLocation(lLoc);
        vector vOrientation = GetOrientationFromLocation(lLoc);
        location oArea = GetTag(GetArea(GetMainControlled()));
        float fAngle = GetFacing(oPC);

        DisplayFloatyMessage(oPC, FloatToString(oArea), FLOATY_MESSAGE, 16777215, 20.0);
        DisplayFloatyMessage(oPC, VectorToString(vPos), FLOATY_MESSAGE, 16777215, 20.0);
        DisplayFloatyMessage(oPC, “—–“, FLOATY_MESSAGE,16777215, 20.0);
        DisplayFloatyMessage(oPC, FloatToString(fAngle), FLOATY_MESSAGE, 16777215, 20.0);
        }

        /—end script—/

        and I get this when Exporting

        E: 22:43:19 – showlocation.nss – showlocation.nss(8): Mismatched types (while compiling var_constants_h.nss)

      • Caladon
        November 18, 2009 at 10:48 pm

        sorry ment in your showlocation script

      • John Vanderbeck
        November 18, 2009 at 10:59 pm

        The function I specified returns a string not a location.
        string sAreaTag = GetTag(GetArea(GetMainControlled()));
        DisplayFloatyMessage(oPc, sAreaTag……….
        Or you could even do it all in one line:
        DisplayFloatyMessage(oPC, GetTag(GetArea(GetMainControlled())), FLOATY_MESSAGE, 16777215, 20.0);

      • NewYears1978
        November 19, 2009 at 2:35 am

        New question for CreateObject.

        What is the point of the 3rd coordinate. I THOUGHT it was a Z coordinate..but it seems when placing placeables this way..it is actually ignored.

        Vector(186.751175, 117.634857, -0.290587), 173.639663696);

        On this item I put any value in the 3rd slow and it puts my item in the same spot no matter what. I put 5.0 I put -5.0 etc. It seems this value doesn’t work for CreateObject and instead it puts the object at ground level.

        How this came about was I was trying to stack two crates..but it wouldn’t work..it just overlapped them on the ground.

        Any thoughts?

      • NewYears1978
        November 19, 2009 at 3:23 am

        So I confirmed it..X and Y and the orientation work..but Z coord is ignored.. I couldn’t figure out how to stack them..maybe you have an idea..

      • Newyears1978
        November 19, 2009 at 4:49 pm

        Well I figured this out (thanks to helpful person on the forums) and am posting here for anyone else who might want items to be not on the ground:

        vector vCrate3Position = Vector( 186.0, 118.0, 0.6 );
        location lCrate3Location = Location(oArea, vCrate3Position, 90.0);

        CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate1Location);
        CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate2Location);
        object oCrate3 = CreateObject( OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate3Location );
        SetPosition( oCrate3, vCrate3Position, FALSE );

        (The 3rd crate, is the one floating..if you want something not on the ground you have to use SetPosition to move it once it is spawned)

      • Caladon
        November 20, 2009 at 9:36 am

        Should I use .are and .utm on the names in the script?

      • Caladon
        November 18, 2009 at 9:23 pm

        is there a call I can add to the showlocation script that would add that info to floaty?

  15. Caladon
    November 18, 2009 at 9:18 pm

    Hmmm tried to use the same open_store script and Merchant for a 2nd creature in the same mod, but it would not open, Do I have to make a seperate script\merch for both creatures?

    • DSavant
      November 20, 2009 at 10:20 am

      actually, if you name the merchant the npc name with “store_” in front of it, the generic open script will allow you to open it – no custom script required.

      • John Vanderbeck
        November 20, 2009 at 10:58 am

        That requires you to use a generic plot point which will currently corrupt your single player game.

      • DSavant
        November 20, 2009 at 3:11 pm

        Wow – thanks for the info. I had no idea this was broken from reading the DA wiki.

  16. Caladon
    November 18, 2009 at 9:19 pm

    I realize that with only 1 Merchant they would both have the same inventory

  17. Caladon
    November 18, 2009 at 9:47 pm

    Thanks! HaHa! The World is Mine To Edit! Hahahahahahahahahchokegaspgcough

  18. Caladon
    November 18, 2009 at 11:16 pm

    Awesome You the Man!

  19. NewYears1978
    November 19, 2009 at 12:07 am

    Caladon, stop causing trouble 🙂

  20. NewYears1978
    November 19, 2009 at 1:39 am

    I’ve noticed when creating objects, we are using vector coordinates only. IN other places I’ve notices an orientation setting (quaternsomething?)..is that something we can set also..or does simply turning the direction of our player and using showloc work the same way?

  21. reanor
    November 19, 2009 at 4:34 pm

    John! You’re a god! Not because you do miracles or something lol, but because all of the time you’ve spent and keep spending on writing all this up for us. I deeply appreciate all that you do and look forward for more tutorials. I was able to figure couple things out myself here and there but merchant and spawning part is really helpful in my new module project.

    Makes it easier since its gonna be “Other Campaign”. Just kudos to you man for all that you do and please don’t stop thinking that we all really appreciate your efforts. YOU DA MAN, man! =D

  22. Newyears1978
    November 19, 2009 at 4:49 pm

    Well I figured this out (thanks to helpful person on the forums) and am posting here for anyone else who might want items to be not on the ground:

    vector vCrate3Position = Vector( 186.0, 118.0, 0.6 );
    location lCrate3Location = Location(oArea, vCrate3Position, 90.0);

    CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate1Location);
    CreateObject(OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate2Location);
    object oCrate3 = CreateObject( OBJECT_TYPE_PLACEABLE, R”genip_crate_wood_large.utp”, lCrate3Location );
    SetPosition( oCrate3, vCrate3Position, FALSE );

    (The 3rd crate, is the one floating..if you want something not on the ground you have to use SetPosition to move it once it is spawned)

    • SylvrWynd
      February 22, 2010 at 3:50 pm

      Very nice contribution. Thank you! I was able to position a chest on the ‘tailgate’ of the wagon I added to the camp for the player.

  23. John Vanderbeck
    November 19, 2009 at 4:51 pm

    So essentially the Z location for CreateObject is either ignored, or bugged 🙂

    • Newyears1978
      November 19, 2009 at 5:27 pm

      I was told on the forums that CreateObject creates objects in “safe” locations only..so it will default to the ground level always..

      Setposition allows you to bypass this.

      So I have everything going my way now..the only issue I have now is getting the right figures for stacking..

      What would really help is if I could put something in the showlocation script (or another script) that would show locations for other objects. Is this possible?

      Reason being, so I could get the z value for a crate that is placed (since It isn’t actually using the coords from showlocation…showlocation on the PC givse you correct X and Y but the Z tends to be up near his chest or something..if this makes sense.

      I have a workaround right now..but woulda been easier if I could pull an object i placed locations

      • SylvrWynd
        February 22, 2010 at 3:52 pm

        The only suggestion I could give it this – create a duplicate of the area you are working on and ‘decorate it’ how you want. DO NOT EXPORT THIS. Once you have everything how you want, you can check the properties of each object and get is X/Y/Z and ORIENTATION. The X/Y/Z are accurate, but have noticed orientation is different. Hope this helps.

  24. Caladon
    November 20, 2009 at 9:31 am

    Hmm this make no sence, the Tutorial worked correctly the first time untill T tried to update some VO files then it broke, so I decided to rebuild the entire Mod from scrath new mod name ect. The Creature spawns, the conversation works with the VO but when I click any of the end dialog lines I get Custom area NOT found and Could not find valid store, here is my open store script and the area and merchant names do match the accuall area and merchant

    /—–start script—–/

    void main()
    {
    object oPlayer = GetMainControlled();
    object oArea = GetObjectByTag(“cdon_suc_merch_area”);
    if (IsObjectValid(oArea))
    {
    DisplayFloatyMessage(oPlayer, “Custom area not found”, FLOATY_MESSAGE, 16777215, 20.0);
    }
    else
    {
    DisplayFloatyMessage(oPlayer, “Custom area NOT found.”, FLOATY_MESSAGE, 16777215, 20.0);
    }
    object oStore = GetObjectByTag(“cdon_suc_storeitems”);
    if(IsObjectValid(oStore))
    {
    DisplayFloatyMessage(oPlayer, “Valid store found. Opening store.”, FLOATY_MESSAGE, 16777215, 20.0);
    OpenStore(oStore);
    }
    else
    {
    DisplayFloatyMessage(oPlayer, “Could not find valid store!”, FLOATY_MESSAGE, 16777215, 20.0);
    }
    }

    /——end script—–/

    Can you see anything wrong?

    • John Vanderbeck
      November 20, 2009 at 11:00 am

      Did you remember to add your custom area to the camp’s area list?

  25. Caladon
    November 20, 2009 at 9:35 am

    do I need the .are and .utm in the names in the script?

  26. VinnieMc
    November 20, 2009 at 11:26 am

    Most excellent work my friend!
    Well written, easy to follow and outcome is exactly as advertised!
    Could not ask for much more..lol

    Keep it up bud as we all appreciate the effort.

    Vinnie

  27. John Vanderbeck
    November 22, 2009 at 6:03 pm

    Dark_Balor :

    yes there it is

    found here : http://social.bioware.com/wiki/datoolset/index.php/Conversation

    i think that all the Dragon Age toolset (and game ) work with XML.

    We weren’t doing a conversation in this part, so i’m not sure what this is in response to?

  28. Sven Boogie
    November 23, 2009 at 12:33 am

    Having an issue here… once I’ve done everything, as far as I can tell, exactly the way it is outlined in the tutorials… I load up camp, and although I have the floaty text over my head as if the NPC properly spawned… shes not there… ?

    • Sven Boogie
      November 23, 2009 at 12:56 am

      I somehow fixed that, and now, the NPC is there. I even get the ‘area found… opening store…’ text… but then… no store dialog opens, and the conversation just ends…

      • John Vanderbeck
        November 23, 2009 at 11:28 am

        @Sven Boogie
        Is the text says “opening store” then it should be good. Most likely the problem is with the conversation, where it is supposed to call the merchant. Did you remember to hook that in? Double check that section.

  29. Rycor
    November 23, 2009 at 6:10 pm

    Hi, I gotta say these are some amazing tutorials. I’ve never really modded like this so my eyes are swimming in script.
    I’ve managed to get everything running the way it should be (I think). When I go to the camp I get the message saying the merchant has loaded. When I click on her I get the dialog boxes I set up. When I click on the message to open the store it closes the dialog box, then I get the debug message saying Custom Area NOT Found. Under that I get a message saying Valid store found. Opening store. So it seems like its half right. Of course it dosent work since the area dosent link.
    I made sure the LST file was modified right and put in the core\override folder. One thing I noticed is that I named the NPC file and the merchant file the same thing without realizing it, im not sure if that would cause a issue.

    • John Vanderbeck
      November 23, 2009 at 6:17 pm

      @Rycor
      Honestly that is a bit weird. If the custom area could not be found, then it shouldn’t be finding the merchant resource either. Same file names wont’ cause an issue because they have different resources. However if the TAGS are the same, that WOULD cause this issue. It would be actually finding the Creature, not the Merchant.

      Double check your area list. You need to get that custom area loading. Also double check your area tag.

      • Rycor
        November 23, 2009 at 6:50 pm

        Thanks for the quick response, I rechecked the LST file and it hadent been updated apparently.
        Now when I talk to the merchant I get the messages “Custom Area Found”, “Valid Store Found, Opening Store”. Then it dosent do anything. I origionally only had one item listed on the merchants inventory just for testing, I cleared that one out, added a pile of random junk, saved, exported then generated the xml files and it still does the same thing when I talk to her.

  30. Reverend80
    November 25, 2009 at 4:03 am

    John,

    Great tutorial man. It really has helped me a lot. Ive got my own variation going, and running into a little snag concerning a usable storage chest in conjunction with this. I have the merchant going fine, I have the storage chest spawning ok. Its interactive, opens the players inventory. You can take out the objects Ive placed in it, and like-wise put items in it.

    But upon testing saving/loading and item storing functionality, I ran into some weird things.

    First test: Put a lesser healing potion in the chest from my inventory. Quick saved. Quick loaded. Potion was gone.

    Second test: Another potion in. Changed areas (quick, no map travel). Came back and opened the chest. Potion was there!

    Third test: Potion in. Changed areas (including map travel, random merchant encounter, then saved and closed game to main menu, then loaded and traveled back, including a random bandit encounter this time, then finally back to camp). Opened up the chest. Potion was there again!

    Fourth test: Quick saved. Quick loaded. Potion was gone.

    Any ideas?

    I know you didnt cover any of this in your mod (usable storage, saving chest state), but you are one of the first people (or THE first) person to get this level of information out to the public, so I humbly seek your advice oh grand master.

    😉

    Thanks!

    • Reverend80
      November 25, 2009 at 4:37 am

      Another quick test: Potion in the chest. Quick traveled to RedCliffe (I entered camp from there originally, thats why i say quick. No map travel). Then map traveled to Haven, and back to RedCliffe. then entered camp and the potion was gone. No saving or loading required. Im guessing there is something that needs to happen to save the state of the chest? Perhaps what you have referred to as a trap? I know its got to be something simple I am missing here.

      • Reverend80
        November 25, 2009 at 4:44 am

        And sorry to muddy up your comments but I meant to say on the 3rd test that it was NOT there. Just wanted to clear that up because that would certainly make the matter even more befuddling.

    • John Vanderbeck
      November 25, 2009 at 10:40 am

      I’m not sure about “saving” the chest contents. It might have something to do with the chest’s core script. I pretty much just copied the one from Tal’s sample chest:

      #include "placeable_h"
      
      
      void main()
      {
          event ev          = GetCurrentEvent();
          int nEventType    = GetEventType(ev);
          int bEventHandled = FALSE;
      
          switch (nEventType)
          {
              //----------------------------------------------------------------------
              // Sent by engine when a creature uses the placeable.
              //----------------------------------------------------------------------
              case EVENT_TYPE_USE:
              {
                  object  oUser           = GetEventCreator(ev);
                  int     nAction         = GetPlaceableAction(OBJECT_SELF);
                  int     nVariation      = GetEventInteger(ev, 0);
                  int     nActionResult   = TRUE;
      
                  OpenInventory(OBJECT_SELF, oUser, TRUE);
                  bEventHandled = TRUE;
      
                  break;
              }
          }
      
          if (!bEventHandled)
          {
              HandleEvent(ev, RESOURCE_SCRIPT_PLACEABLE_CORE);
          }
      }
      • Reverend80
        November 25, 2009 at 2:16 pm

        Yeah I also have that script, but was wondering if its the whole script? Do I need to point it to my mods files specifically? Or is it good the way it is? Also, this script is what is use on the chests placeable script field correct? If so I have done all of that but still no success.

  31. Dragmahr
    November 25, 2009 at 5:16 am

    Heyho, well i have a simpley but important Question.
    How is it possible to sell my own created items in the store ?

    I not need to sell the random items from the data base.. i want so sell my own created weapons instead on having them spawned in my inventory.

    Is there any possibility to insert some own weapons ?
    If yes, how ?

    Greetings

    • Interitus
      November 29, 2009 at 5:45 am

      You can insert your custom items in just as you would any other item. Should show up in the item list.

  32. John Vanderbeck
    November 25, 2009 at 10:42 am

    I haven’t actually tested this, but placing custom items into the merchant for sale should simply be a matter of using a script to add the items to the merchant’s inventory.

    • Dragmahr
      November 25, 2009 at 10:53 am

      Hello John, thanks for answering me.
      Hmm, do you think it’s possible to write a code for testing that ?
      Guess would help a lot of more players who use your incredible tut’s 🙂

      I guess i also would have to export the created Item in a special way
      to add it to the database, right ?
      greetings

      • Thynwar
        November 25, 2009 at 3:42 pm

        Hm, would be very nice if you could try a code to get this started 🙂

  33. Interitus
    November 29, 2009 at 6:08 am

    I’ve got pretty good conversation for my merchant, and I can get into the conversation and access the store with no problems. But how would you the merchant to leave the area? or attack you? If I want the merchant to leave, I tried putting the generic actions for Plot, with the flag “GEN_OWNER_DISAPPEARS”. But my merchant didnt go anywhere. And the action “GEN_OWNER_TURNS_HOSTILE” didn’t work either. With the sorta hacked way that we added in the merchant, do I have to do something different to get those effects?
    And my merchant prices don’t seem to be working properly. I first made a script to adjust the prices based on your initial responses seen here: http://www.pastebin.ca/1692323 But when I went in-game the prices of everything were negative copper! ranging from -0 to -70! So I removed the script from the merchant, and every price was at its base value. I do have the markup/markdown prices set to 15. Whats going on here?

  34. Jamie
    November 30, 2009 at 6:31 pm

    Hey 🙂

    Thanks for your awesome tutorials, just wondering if there is a way to put items I created into the merchant store? Thanks 🙂

  35. Mary Quite Contrary
    December 1, 2009 at 5:15 pm

    John, thanks a bunch, everything you’ve explained has worked perfectly for me, and even better, I understand HOW it works now. So thank you a lot.

    I do have a question though. Do you know know much about the variables attached to the Merchant Resource, like “MERCHANT_IS_SCALED”, “MERCHANT_LEVEL_OVERRIDE”, “MERCHANT_LEVEL_MODIFIER” “MERCHANT_COUNTER_#” etc.?

    I ask because I want to have armor and stuff sold by my merchant to be level appropriate and scaled, but right now, everything spawns at level 1 (Iron). Do I just need to toggle ‘IS_SCALED’ from 0 to 1?

    • John Vanderbeck
      December 1, 2009 at 7:16 pm

      Possibly. The variables aren’t defined on the wiki (sometimes they are, but these ones aren’t). I’d have to check the code to be sure.

  36. Mary Quite Contrary
    December 2, 2009 at 9:14 am

    Hi, John, it’s me again!

    I was wondering, how intensive is the loading of this sort of thing? Like if I wanted to add another merchant or two to the same area created, would it increase the burden on the player?

    And is there any reason why I couldn’t create a crate or box that could be interacted with as a merchant? (No, not a party storable chest)

    • John Vanderbeck
      December 2, 2009 at 9:17 am

      Mary if you use the same area you already have and just add a few more creatures or NPCs, it shouldn’t be any real hit. You could use a crate, but you would still need to tie the merchant’s OpenStore() to the crate somehow, probably in its OPEN event.

      • Mary Quite Contrary
        December 2, 2009 at 10:52 am

        Alright. I’ll see if I can get that to work. I am not sure how the game will handle that, but worth finding out.

        I want to have one merchant NPC with a few different ‘stores’, if only to limit clutter, and having objects that are their own stores is one of the easiest ways to do that.

  37. alpha91
    December 3, 2009 at 9:27 pm

    Thynwar :Hello guys ,how can i put my own created Armory sets in the Merchants inventory ?
    Please help thank you

    This question got me interested as well so I messed around a bit, I cannot verify that it works however I believe I need to reinstall the mod to get the mod to update the merchant store correctly.

    To get your own items into the merchant store first create the item in your custom merchants folder. After that change the folder options for the custom items from your custom merchants folder to say for example \_Global\Weapons, Ranged\Longbows\
    and then change the owner module to core game resources.

    This is important to avoid game breaking mistakes first create them in your custom merchants folder.

    To change the folder to \_Global\Weapons, Ranged\Longbows\ you may need to copy paste. You can change the folders by clicking on properties for the item you want.

    now after you have changed the folders for the items your custom merchants window will have them as selectable add them to the store inventory.

    now here is where I ran into problems, I could change the item folders back to my merchants folder which is what I tried first, or leave them as they are which is what I currently have. I am unsure as to why the items still do not appear in store after I start the game. It is possible that they will appear on a fresh install.

    I will try that when I have more time to mess with it. and any advice on tackling this is welcomed.

    • alpha91
      December 4, 2009 at 3:37 pm

      I got it working, I moved the custom Items back into the Custom Merchants folder, creating a sub folder so it looks like \mycustom_merchant\custom_items\

      to create the sub folder right click on the item you want to move then click properties. Once properties is up change the owner mod, you will need to type this in manualy at first after that you can copy paste.

      Once you have done this for all of your items open up the custom store again and remove its inventory. Then reselect the items from your custom merchants folder that should now be available.

      After this save and export your mod, once thats done go to mydocuments\bioware\dragonage\packages\core\override\toolset export and copy only the files for your custom items ignore the others.

      Paste the files into mydocuments\bioware\dragonage\addins\mycustommerchant\core\override\toolsetexport

      now your almost done, only things left to do is delete the remaining files in mydocuments\bioware\dragonage\packages\core\override\toolset export and then start the game.

      I found from my own trials that no matter what I did, including uninstalling and reinstalling. that the store will not update unless I go back to an earlier time before the spawn. So you need a fresh start or an earlier save point such as lothering.

  38. Nitro9a
    December 9, 2009 at 12:15 am

    Hello again,
    I’m getting “Custom Area Found” and then “Could not find valid store!”
    I’m not getting any error messages in the toolset. Any idea what could be causing this?
    Thanks!

    • Nitro9a
      December 9, 2009 at 12:54 pm

      Nevermind, I fixed it. I dropped the character, not the store into the area.
      Thanks again for the tutorials. They are very easy to follow and it’s great that you don’t assume that we know anything. The way you write actually helps us learn rather than having us just following instructions. Well done, all around. Also, I think the way you decided to do this mod is very clever. I look forward to learning more from this site.

  39. Nitro9a
    December 10, 2009 at 11:19 am

    I’m pretty much done with this mod as is with a few minor changes of my own for my own learning purposes. There’s one last thing I’d like to do. Perhaps you can advise? I’d like to modify the script to either not load the character (the next time the player enters the camp) if certain plot flags in the dialogue are set (like telling the merchant to leave) or to actually have her walk away and not come back. I’ve been combing pre-existing code for an example of this since I don’t know c++ but haven’t found anything. I imagine it’s a couple of simple lines but I don’t know the correct syntax. I’m wondering if you can set up two conditions for spawning in the script, like: if the merchant isn’t already there AND if the flag TOLD_HER_TO_LEAVE is false then spawn the merchant. If that’s even possible, I don’t know how to write it in this crazy moon language. 😛 Can anyone help? Thanks!

  40. scott
    December 12, 2009 at 12:30 pm

    hey, i have done everything that the tut said to. but im running in to some problems. my npc will spawn but when i try to open the shop up i get the error messages from the script posted. “custom area not found” and “could not find valid store” i have checked and checked again and the cam100ar_camp_plains.lst file does have the new area in it but yet i still cant get into the store could anyone help me?

    • Yite
      December 21, 2009 at 4:55 am

      Do you have any other merchant mods for your camp loaded (like Misha, Vishala, Quartermaster Tolby)? If so try disabling them and then try to access your store again.

  41. Gotcha!
    January 13, 2010 at 2:34 pm

    Everything works! I can’t thank you enough, John. Thank you for your effort to write these guides. 😀

  42. Megatron
    February 9, 2010 at 10:23 pm

    Hey John,

    I have a problem I got my merchant to spawn and everything ok but she keeps popping up outside of camp like random battles and such also I cant update her inventory I was able to once and then it stopped working can you please help

  43. Megatron
    February 10, 2010 at 3:55 am

    OK BIG PROBLEM: I had a merchant before with this inventory that I couldnt change, so I went in and made a new merchant with a different inventory but when I load the game it has the same inventory as the last one can anyone please! help its really bugging me

  44. SylvrWynd
    February 22, 2010 at 8:28 am

    I have a simple question (hopefully). I have gotten the merchant to work (in Denerim Market, mind you, not the camp) and created a bunch of deeds and put them in her inventory. What I am trying to do is create multiple “merchants” and hook the the same creature through different options in dialog. I essentially duplicated the merchant, updating the TAG to be unique. Dropped the NEW merchant into the same custom area (so now both are there), and duplicated the script changing the TAG call to be the second store. I then updated the DIALOG to hook the second script to open the second store and I get “CUSTOM AREA FOUND” but “CUSTOM STORE NOT FOUND” and exits from conversation. I cleared out all the export directories and re-exported everything, just to be safe. This is baffling me because logically, it should work. (I don’t want the second store visible unless the player purchased ALL of the items from the FIRST store.)

    Here is the lowdown of what I am doing. For now, I placed the merchant in Denerim and sell the player “PLOT” specified ‘deeds’ for the various objects I want to add to the camp. The first store entails the wagon, 2 oxen, and a contract for a caravan master. I have a script that activates when the player enters the camp and checks to see what “PLOT” items they possess, spawns the corresponding object, then deletes the “PLOT” item so it will not respawn again later. I also changed all deeds/contracts/receipts to UNIQUE so only one will exist ever.

    The spawning is working fine, but I am adding a bunch of chests/crates/barrels/sacks/weapon racks/armor stands to the camp, but I don’t want the user to be able to buy those until they have bought the wagon AND oxen AND hired the wagon master. So I am working on a script that checks it the deed exists (anywhere) and then if it is in the players inventory in a nested IF statement to make sure it hasn’t been spawned already (when it is spawned it will not exist in the players inventory, or in the merchants store).

    I also have a question about how I would go about limiting WHAT TYPES of items can be put into a specific container. I am trying to create an organization system in camp so LIGHT ARMOR is on one armor stand, MEDIUM ARMOR on another and those stands will only allow that type of item to be dropped into it.

    I have gotten all of the items to spawn right where I want them, and they are all INTERACTIVE (I am appending the storage scripts to them next). Any advise/tips/direction to take would be much appreciated. Thanks for reading to the end and letting me really ask a doozy of a question.

    • SylvrWynd
      February 22, 2010 at 2:19 pm

      Alright, I got the second “STORE” from the same “CREATURE” fixed. I had to duplicate the area and add it to the area list again. Once I did that, it found the “STORE” and loaded.

      I would still like to know if I can limit what types of items can be put into a container. I anxiously await feedback 🙂

  45. SylvrWynd
    February 22, 2010 at 9:41 am

    Thank you for such detailed tutorials/walkthroughs on how to work around the limitations of the Dragon Age engine. I was able to follow these tutorials for my own project that I am working on, tailoring them to my own needs, of course. They are all working just as you intended.

    I am, however, running into issues with having a second ‘store’ attach to the same character through a different branch of the conversation. I want it to be sort of like the quartermaster in Ostagar. Before I get into the error though, let me explain what I am doing.

    First, I am a neatnik and am obsessive over organization in games like this. The Camp Party Storage chest by Tal gave me some wonderful ideas which led me to this project. (I will be using a PLOT to help me on this, but that is not what the question is about. I *should* be able to muddle my way through that part of this equation.) What I have done so far and intend to do is this. I created a street hawker in Denerim Market (for now) who I was able to successfully spawn and populate with custom items by following your tutorials (thanks again!). What she is selling are “deeds” to items the player can purchase to add to their camp for storage. In the future I will be adding other things (via the PLOT and a few adventures) that will allow crafting to take place by the player. But that is not relevant to STAGE 1. I want there to be 2 sets of items offered by the vendor, the initial set, which is currently working perfectly, and a second ‘store’ which is only available after the player has purchased ALL of the items from the first. (I will handle the ‘available after’ part with PLOT flags later. Tier 1 is comprised of 4 “deeds” which are a wagon, 2x oxen and a caravan handler (NPC). I don’t want the player able to purchase the chests, etc. until AFTER they have bought those four prerequisites. Again, I will handle that with PLOT FLAGS.

    The problem is, I duplicated my initial store, changing the name and TAG for it to make it unique, dropped it in the same CUSTOM AREA from the first one, duplicated the OPENSTORE script and modified it to point to the NEW store, and hooked that script into the conversation along a different branch. I am not implementing the PLOT conditionals yet until I get this part working. What is happening is that I can still reach the initial store no problem, but then when I take the other conversation branch, I get the debug codes “CUSTOM AREA FOUND”, and then “CUSTOM STORE NOT FOUND”. I exported everything and regenrated the XML for the module already. Any ideas/suggestions? I am truly baffled unless it will not allow 2 stores to be generated on the same creature in this fashion.

    On a side note, I have a separate script which is triggered on the loading of the camp which will spawn the appropriate items in camp based on the items in the PLOT category of the players inventory, and then destroy the deed so it won’t respawn when they re-enter camp later. Each item is flagged “PLOT” and “UNIQUE” so it won’t regenrate or be duplicated once purchased/used. That aspect is working perfectly so far. Each of the four primary items spawns exactly where I wanted them and even facing exactly how I wanted (along the back of the camp along the tree line.) I will keep debugging on this and checking back frequently. If you have any ideas or suggestions, please help. If you would like the module, I would be happy to package it in a builder to builder and email it to you. Once again, thanks for all you have done!

    • SylvrWynd
      February 22, 2010 at 2:20 pm

      As stated above (sorry for the repetition, the first post didn’t show up until after I had posted this one!)

      Alright, I got the second “STORE” from the same “CREATURE” fixed. I had to duplicate the area and add it to the area list again. Once I did that, it found the “STORE” and loaded.

      I would still like to know if I can limit what types of items can be put into a container. I anxiously await feedback 🙂

  46. Bill
    April 9, 2010 at 9:18 pm

    Gosh can someone help me please? I have followed this tutorial once before and made a merchant in the party camp that I was pleased with, selling all my custom weapons and all went well.
    I’ve recently reinstalled the game and followed it once more, and all works perfectly apart from every time I go the npc it says ‘the store is empty’
    I’ve zoned in and out a couple of times, tried adding global weapons etc instead of my own but still the damned thing is always empty. He does buy my goods if I sell them and I can buy them back so it’s working kinda, so I have no clue 😦

  47. Section8
    May 15, 2010 at 7:01 am

    Not sure if you still update this page but I’m still stuck on your part 1 been at it all night for some reason it wants to spawn numerous of my npc / merchant right next to each other and colliding. Heres my script just left out the Float Message this time. Other then that everything else the .GDA created fine and stuff I am trying to place a mob a succubus instead of human doubt the model makes a difference though as long as all the properties are correct

    #include “wrappers_h”
    void main()
    {
    {
    object oArea = GetObjectByTag(“cam100ar_camp_plains”);
    location lMerchantLocation = Location(oArea, Vector(150.308090, 158.606354, -0.741238), -27.122547150);
    CreateObject(OBJECT_TYPE_CREATURE, R”creatures_lilith.utc”, lMerchantLocation);
    }
    }

  1. April 4, 2011 at 8:35 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: