Home > Tutorials > A Start: Creating a Module to Give Your Player an Item

A Start: Creating a Module to Give Your Player an Item

In this tutorial we’re going to look at something pretty basic, but that will give you a good overview of the toolset.  It is also something a lot of people are wanting to do.  You cheaters you!

We are going to create a new module that extends Single Player.  Bioware would call this an add-in.  What this basically means is we are not going to modify the single player campaign at all.  Our add-in will instead extend the original campaign by adding new content to it.  This is vital, because if we tried to change the original campaign by editing it we could, and probably would, break it in some way.  The toolset is like that.  Think of this like a mini Shale Tower in a way.  We’re simply adding new content.

For the purposes of this tutorial i’m going to assume you already have the toolset installed.  Unfortunately there have been lots of issues with the installation, but I can’t really help you with that.  Check out the wiki and the forums for answers to the more common problems.

Now another thing i’m going to assume is that you’ve been messing around in the toolset, and quite possibly with the Single Player module, which is the game’s original campaign.  This quite honestly is a bad thing and can break the campaign.  The first thing you should do, is in the toolset go to TOOLS -> EXPORT -> EMPTY EXPORT DIRECTORIESThis will wipe out any modifications you’ve made.  It will reset all overrides on Single Player but its important to keep the campaign running properly.  After you’ve done that, never ever open the Single Player module again 🙂.

 bab927a0bd471af413bcfe0093b1698f 

Create a New Module

Ok to get started we need to create our own module.  FILE -> MANAGE MODULES will open up the window we need.  Click on NEW to create a new module. 

995f5f3fc491c4a07edb982662029189

The window that pops up is the “Module Properties” window.  In here we need to set a few things.  First, give your module a name.  For this tutorial i’m calling mine “Bow of Athena”.  Call yours whatever you want.  The next thing to set is UID.  This is a Unique Identifier, so it has to be unique amongst every module you create and unique amongst every module anyone else makes or their may be conflicts.  This must be in lower case, and you can use letters and underscores.  Possibly numbers and other symbols, but i’ve not tried.  A great way to help ensure your UIDs will be unique is to come pu with some 3 or 4 letter prefix sort of unique to you and always use that plus some identifier for the module.  In may case, I do a lot of things under the online name “Agathorn” so I tend to prefix my stuff with “aga_”. 

The last thing you need to do is set this module to extend the original campaign, which is the “Single Player” module.  to do this, scroll down the properties window to the next section “Info” and change the “Extended Module” property to “Single Player.  Once you’ve done this, click OK

f3fae2c0ab2a973d8cf31c2a694baa68

You will find yourself back in the Manage Modules window, and your new module will be in the list, and should be selected.  If it isn’t selected, select it.  Now click OPEN to open your new module.  There is one last thing we need to do with the Manage Modules window, so go back to FILE -> MANAGE MODULES one last time.  Select your module and click on HIERARCHY…  In here place a checkmark next to Single Player.  NOTE: If all the modules in this window are greyed out, and you can’t select them then it means you didn’t open the module first, as mentioned above. 

Click OK to close the Hierarchy window, then close the Manage Modules window as well.  We’re done here for now.

Create Your Item

The next thing we need to do is actually create the item we want to give the player.  If you want to give your player some item that already exists in the game you can skip this section.

For this tutorial we’re going to create a nice bow, useable at low level but one with a bit of power to it so that it shows you some of the options.  In the pallete window on the right side, click the sword icon to switch to Items.  When you do this, you will see under that a bunch of folders open up.  These folders mean nothing to the game, but are there simply for organization.  However, i’ve not yet figured out how to actually add your own folders, so for now i’ve been putting everything in the root.

Right click anywhere in the empty space below the folders, and choose NEW -> ITEM.  In the window that pops up we have a few things to do.  First we need a Resource Name.  Like your UID this needs to be unique, so bear that in mind.  Folder is just where in the folder tree above it will sit.  Again this is meaningless to anything but your orginization.  I put mine in root “\”.  You decide.  Next is Module and this is very important.  Right now Module will be set to your module that you are creating, but we want this to instead be added to the games “Core Resources”.  The reason for this is that way we are properly extending Single Player and our module canb co-exist with others that do the same thing.  By putting this item into Core Resources, any other module that extends Single Player can also use it.  so in the Module property choose “Core Game Resources”.  Everything else can remain at the defaults, with Owner Module being your module.  Click OK and the item will be created and checked out so you can edit it.

84740a28b022ec3a7570334918337883

Let’s talk a minute about this checking out thing.  This toolset is essentially what Bioware used to create the Single Player module, and of course the module wasn’t writtem by just one person.  There were many people who worked on it.  In any group project there is a concept of “Version Control”.  In a nutshell its a way for multiple people to work on the same files without getting in each other’s way.  The process is simple.  If you want to work on a file you first check it out of the control library so to speak.  This tells the system that you are working on this file, and it gives you a local copy for you to modify.  Then when you are done editing it, you check it back in to the library, at which time it compares your new copy to its own copy, and sees what you changed, and builds a new version by combining them.  This way if you and someone else were editing the same file at the same time, your changes get merged together to create a final file. 

Now most of that you don’t really need to worry about or even remember, but what you do need to take form that is that anytime you want to edit a resource you must check it out, and then when you are done you save, and then check it back in.  In this case the system automaticly checks out the new resource for us.  If this was an existing resource, we could right click on it and choose CHECK OUT.  In either case you will now see the new item open in the main window of the toolset.  On the left hand side are its properties and on the right is a 3d model of the item.  In the 3d view, mousewheel will zoom in or out, and CTRL+RIGHT MOUSE will rotate the model.

What we want though are the properties on the left side.  Base Item Type indicates what type of item it is.  Is it a longsword (default) or perhaps some Light Armor?  The base type is where a lot of its properties come from.  For example a longsword has certain base damage values, speed values, crit chance values, etc.  In our case we’re making a bow, so I chose “Weapon – Longbow”.  You’ll notice this also affects the 3d model.  Next you can give it a Description. You can just type directly into thebox, or if you click the 3 dots on the right of the field it will open a larger edit box for multi-line editing.  It also has a built in spell check 🙂

Once you’ve described your object, it needs an icon, so click on the icon property then click the 3 dots to open a file browser.  Unfortunately this file browser doesn’t let you see thumbails of the images and theres a lot of them.  We want an icon file though, and they all start with “ico_”.  I chose “ico_longbow”.

The next field is Inventory Subgroup.  I’m not 100% sure what this affects, but the best thing to do is just make it the same as another item of this basic type.  So on the right, open the _Global folder, then the Weapons, Ranged folder, and finally the Longbows folder.  Left click on any of the bows in there.  I clicke don the bottom one which is the generic Longbow.  When you do this its properties will be displayed in the window below it.  You can see it has a subgroup value of 21200 so we just put that same number in on ours.

Item Variation lets you choose from a few different 3d models for your item.  Choose whatever you want. 

Next up is Material Progression and Material Type.  These determine the tier of the weapon, and the texture of the 3d model.  I set both to “Bow, Horn” which is tier 1.

An Aside on Material Progression and Item Scaling: You may have noticed in the items list that there is only one base Longbow.  You don’t see a Horn Longbow, Ash Longbow, etc.  Just the one “Longbow” along with a few special types like Darkspawn or Dalish Longbows.  The reason for this is that Dragon Age works on a different basis than what you may be used to if you ever created modules in say Neverwinter Nights like I did.  In NWN you created every single item.  If you wanted lower and higher versions of an item, then you created multiple versinos and tweaked the stats on each.  Dragon age though works by automaticly scaling items to be appropriate for the player.  You will also notice that nowhwere in these properites for our bow can you set things like Damage, Critical Chancem, etc.  This is all built into the base item and the material tiers. A base longbow has a damage value of 6, and then each material tier applies a multiplier to that.  For example an Elm bow has a 1.0 multiplier, but a Dragonthorn bow has a 1.6 multiplier.  So how does all this tie in?  The way I believe it works is that the Material Progression property tells the game scripts what possible material tiers the item can be when it does its autoleveling.  You’ll note that one of the options is “All Woods”.  I think this means the script can set it to any level as appropriate.  On the other hand if you set Material Progression to “Bow, Ironbark” I think that would tell the script that Ironbark is the minimum tier it can be.  Where does all this come from? It is in the 2da’s, which are really beyond the scope of this tutorial but i’ll talk about them in a future tutorial.  I just wanted to introduce the bsic concepts a bit here.

Ok now that we have our material tier set up, we need to give our item its Name and Tag.  The name is pretty obvious.  The tag is an identifier you can use in scripts to reference this item.  By default it sets the tag to be equal to the Resource Name and I just leave it that way.

The next section, Attributes, allows us to apply some fun things like modifiers and on-hit effects to our item, as well as set its cost.  Cost is first and is simply what the item should cost, in copper.  100 copper = 1 silver.  100 siver = 1 gold.  Let’s give our bow a couple of cool modifiers.  Click on the Item Properties field, then click the 3 dots.  This will open up the Item Properties window where you can assign up to 5 “abilities” to the item.  I remember in NWN the more abilities you added to an item, and th emore powerful they were, the higher level the item became.  I don’t know if it works the same in Dragon Age or not.  In our case we’re going to give it two abilities.  On the left is all the abilities you can assign.  First select the one that says “Faster Aim (0.1s per power)”, then click on the ADD-> button to add it to the item.  When you do this you will see it appear over on the right side of the window.  On the right side you will see three columns, and the far right one is cut off and just says “Po…”.  This is actually “Power” and indicates how powerful this ability is.  By default its 0.  Notice how the name of our ability indicates “0.1s per power” ?  This means that each power level will make the aim time 0.1 seconds faster.  To set the power level simply click the 0 and change it to 1 and press enter.  Next add one more ability, “Increase Electricity Resistance (5 per power)” and set it to a power of 1 as well.  Once you are done click OK to close that window.  Now the next property right below that is OnHit Effect and we’ll use this to give our bow the ability to do electrical damage.  Click the dropdown arrow and select the one that says +electricty damage.

093ea29d7c918a9eac269f7f76900e9a

Now, we’re done with editing our item.  So what do we do? Save, and check in.  SAVE is just like most any Windows application, and has a hotkey of CTRL-S or you can go to the FILE menu, or click the little floppy disk icon on the toolbar.  Whatever works for you.  Go ahead and save the item.  Now we need to check it in.  You can do this either by right clicking the item in the tree view on the right, or you can actually also do it by right clicking the item’s filename in the tab list up top.  Again whichever works for you.  Right click and choose CHECK IN.  The checkin window will come up.  Entering a comment is pretty pointless for the average user, but its up to you.  If you dont’ want to enter anything, just click the box that says “I do not wish to enter a comment” then click OK.  This will check in the item.  Notice two things.  First that the top now has a red border and indicates a READ ONLY COPY.  You can no longer edit this item right now.  Also note that on the right, in the tree view, when the item is checkd OUT it has a green checkmark on it, and now that it is checked IN the checkmark is gone.

If for any reason you want to edit this again, simply right click on it and choose CHECK OUT.  Again that whole check out, check in, process is important to be aware of.

Creating an Event Script to Give the Item

We’re almost there.  One last resource to create, and then we can start exporting everything to play with it!  Now that we have the item, we need a way to actually give it to our player.  We’re going to do this through the use of an event script, or module core script.  You see, for certain things that happen in game that affect your module, the game engine calls this module core script and passes it an event to handle.  What we will do is use this to tap into an event that is called when the module loads, and at that point stick the item into our player’s inventory.

Scripts in Dragon Age are in standard C++ and teaching that language is really beyond the scope of this tutorial, so what i’m going to do is simply provide you with a script that you can use that is heavily commented.  First we need to create a new script.  On the pallete window click the icon in the second row, just to the left of the paper icon with a C in it.  It is the paper icon with all the lines on it.  Just like before, right click an empty space and choose NEW -> SCRIPT.  This will pop up the same new resource window we saw before.  Give your script a name, i’m calling mine “module_core_bowathena”.  Set a folder like before as well.  The one thing we need to do differently this time is the Module script shoudl be set to your module, not Core.  Both Module and Owner Module shoudl be your module.  Click OK to create and checkout the new script.

// All module events
#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
    event ev   = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events("", ev);
    switch (nEvent)
    {
        ////////////////////////////////////////////////////////////////////////
        // Sent by: The engine
        // When: The module loads from a save game, or for the first time. This event can fire more than
        //       once for a single module or game instance.
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_MODULE_LOAD:
        {                           
            // this event can fire multiple times, and we only want to do this once
            // So we save a flag inside a number variable.  We check it here and if its
            // set already then we know we've already done this before.  The name of the
            // variable in quotes can be whatever you want.
            int iModuleLoaded = GetLocalInt(OBJECT_SELF, "aga_bowathena");
            if (iModuleLoaded == 1)
                break;

            // get the object which contains the player
            object oPlayer = GetHero();

            // The flag we save won't persist beyond the game session, so its a good idea to actually
            // look to see if the player already has the item, unless you WANT them to get another one
            // The name in quotes is the TAG of the item.  So what we do is see how many of the item
            // the player already has, and if its 0, we know we haven't given it to them yet (or they sold it :p)
            int iItemCount = CountItemsByTag(oPlayer, "aga_bowofathena");                                       
            // if its 0, then let's give them the item.  Now this first parameter is a RESOURCE identifier.  Note
            // how its formatted.  R"resource_file_name"
            // The "R" part is important and identifies it as a resource.  The filename is just the filename of the
            // resource.  You can see this in the toolset on the tabs up top.
            // The number 1 means give 1 item.
            if (iItemCount  == 0)
                UT_AddItemToInventory(R"aga_bowofathena.uti",1);

            // lastly we set that number variable we talked about earlier, to save the fact that we've
            // done this already.
            SetLocalInt(OBJECT_SELF, "aga_bowathena", 1);
            break;
        }
        default:
        {
            break;
        }
    }
}

Editors Note: In the time since I wrote this original tutorial, better ways of doing things have emerged. While the above is a great simple introduction, its not the best way to do it in a released mod. Please follow up with this article.

Once you have entered the script, save it.  In the case of a script it will take a bit longer to save.  It has to compile the script for you.  Once it is done, check this in as well.  Now we need to set the module to use this script as its core script.  To do this we need to edit our module properties again, so go back to FILE -> MANAGE MODULES and select our module, then click on PROPERTIES.  Click the Script property, click the 3 dots, and select the script you just made.

If you skipped creating a new item, and want to just give yourself an existing item then you will still need to know the “tag” and “resource filename” of the item.  You can find that by simply selecting the item in the tree view on the right.

Exporting Your Module

We’ve now come to the final step.  All the hard work is done, now all you need to do is export your resources and your module so that it shows up in game.  To do this, we first need to export each resource we made.  If you made an item, you need to export that.  Click the sword icon again to go back to items, then right click your new item and choose EXPORT -> EXPORT WITHOUT DEPENDENT RESOURCES.  Then go to the scripts and do the same thing for your script.  Lastly, to export your module go to the menu, TOOLS -> EXPORT -> GENERATE MODULE XML and then TOOLS -> EXPORT -> GENERATE MANIFEST XML. 

Now go ahead and run the game, and you should see your module in your downloaded content.  Start a new game or load an existing save and you should find your new item in your inventory.  Enjoy!

FOLLOW-UP: A followup to this article covers some of the more common problems and mistakes people ran into.

Advertisements
Categories: Tutorials
  1. Reynen Starfyre
    November 11, 2009 at 12:26 am

    Great job on the guide.

  2. November 11, 2009 at 12:45 am

    Nice tutorial. 🙂

    I look forward to reading this blog regularly.

  3. ExplosiveCoot
    November 11, 2009 at 5:14 am

    I found this tutorial to be a great way to get get my feet wet with the toolset, many kudos!

  4. Lance
    November 11, 2009 at 5:58 am

    Thanks for the great guide. I made a massive armor for myself and I noticed that ingame there was a () below the name of the item in my inventory.. whats up with that? Also, is there a -XX% fatigue item property somewhere? One final question, if I want to edit the item, do I have to do the whole exporting thing again?

    • November 11, 2009 at 2:18 pm

      I havent’ seen the () issue, so I really have no idea. I’ll keep an eye out though. As for -fatigue, there isn’t any way to assign that by default, so it would require some custom scripting.

      If you make changes, all you have to do is re-export what you changed.

  5. Fren
    November 11, 2009 at 7:03 am

    Very nice tutorial, helped me a lot. Many thanks.

  6. tal
    November 11, 2009 at 12:49 pm

    is there an even that fires when XP is awarded?

    • November 11, 2009 at 2:16 pm

      I’m not certain if there is an event for XP gain. I’ll have to dig a bit. There is an event for leveling up.

  7. tk
    November 11, 2009 at 2:28 pm

    Hey, get tutorial but i’m having problems exporting the script. states –

    E: 19:17:23 – module_core_chest.nsc – Exporter FAILED for resource: module_core_chest.nsc
    E: 19:17:23 – module_core_chest.nsc – Unable to get the resource information for “utility_h” of type “nsc”

    any idea what i did wrong?

    thanks

  8. November 11, 2009 at 2:54 pm

    Thanks to everyone who provided feedback. Some of you had some problems, but I think we’ve worked most of them out. In the process i’ve seen some “common mistakes” so to speak, so i’m going to do a follow up article and talk about those. Stay tuned.

  9. tg
    November 11, 2009 at 3:03 pm

    Can we get permission to post this directly on daofanatics.com All credit will be given as well as a link back directly to this article. Please contact me.

    • November 11, 2009 at 3:56 pm

      Because this article may change based on things found and what not, I would prefer that you instead link back to it here from your own article.

  10. Zac
    November 11, 2009 at 3:45 pm

    I was just curious… I followed a tutorial similar to this and everything worked. My item was created and it loaded in my inventory. However, when I engaged in combat my companions just sat there and did nothing. If they were killed – they just popped back up like I had rezzed them (which, of course, I didn’t). I didn’t save just to be safe but I loaded an older save. I quickly found out that I could not area transition. Basically I’m trying to figure out if A) you or anyone else that has tried this tutorial has experienced these problems and B) I’d love to keep playing with the toolset but after my last experience it left a bitter taste in my mouth and am looking for any enlightenment on the issue.

    Thanks!

    • November 11, 2009 at 3:54 pm

      These things happen due to you having at some point opened up the Single Player module. The very beginning of this tutorial I talk about that, and how to fix it.

  11. Re
    November 11, 2009 at 4:01 pm

    I’m having the same problem tk is, when i save the script i see a message at the bottom of the screen saying
    E: 07:59:10 – module_core_bowathena.nsc – Unable to get the resource information for “utility_h” of type “nsc”

    and im guessing this is the reason why the item is not showing up in any of my games.

    • November 11, 2009 at 4:26 pm

      I’m going to guess you are trying to do the same thing they were, creating multiple items? If you are, you have to make multiple calls to the various functions. You can’t combine them all in one. also make sure your resources in UT_AddItemToInventory reference the FILENAME not the tag. They shoudl end in .uti
      I just finished the 2DA tutorial so i’m going to start on that follow-up I promised, covering the more common problems people are running into.

      • Re
        November 11, 2009 at 4:36 pm

        I was only trying to make the one item from the tutorial. When i got to the script part i just coppied and pasted what you had typed, im not sure if this was the correct thing to do or not. Also i get this message when i try to export the script.

        S: 08:22:36 – Export Summary, 1 Requested, 0 Success, 0 Skipped, 1 Failed. Please see below for more details.
        I: 08:22:36 – Offers.xml file has been updated successfully.
        I: 08:22:36 – AddIns.xml file has been updated successfully.
        I: 08:22:36 – Generated the campaign file.
        W: 08:22:36 – No starting area specified for campaign.
        I: 08:22:36 – PostProcessing
        E: 08:22:36 – module_core_bowathena.nsc – Exporter FAILED for resource: module_core_bowathena.nsc
        E: 08:22:36 – module_core_bowathena.nsc – Unable to get the resource information for “utility_h” of type “nsc”

  12. John Vanderbeck
    November 11, 2009 at 5:04 pm

    Very odd. I just went and double checked, and mine compiles and exports fine. Perhaps when you copy and pasted you missed a bracket, or there might have been some stray text or something?

    • Re
      November 11, 2009 at 6:04 pm

      Still having the same problem, tried numerous times coppying and pasting and keep getting

      E: 09:59:33 – module_core_bowathena.nsc – Unable to get the resource information for “utility_h” of type “nsc”

      when i try to save the script. This is the coding i have (instead of aga_bowathena it is test_bowathena)

      // All module events
      #include “utility_h”
      #include “wrappers_h”
      #include “events_h”
      void main()
      {
      event ev = GetCurrentEvent();
      int nEvent = GetEventType(ev);
      Log_Events(“”, ev);
      switch (nEvent)
      {
      ////////////////////////////////////////////////////////////////////////
      // Sent by: The engine
      // When: The module loads from a save game, or for the first time. This event can fire more than
      // once for a single module or game instance.
      ////////////////////////////////////////////////////////////////////////
      case EVENT_TYPE_MODULE_LOAD:
      {
      // this event can fire multiple times, and we only want to do this once
      // So we save a flag inside a number variable. We check it here and if its
      // set already then we know we’ve already done this before. The name of the
      // variable in quotes can be whatever you want.
      int iModuleLoaded = GetLocalInt(OBJECT_SELF, “test_bowathena”);
      if (iModuleLoaded == 1)
      break;

      // get the object which contains the player
      object oPlayer = GetHero();

      // The flag we save won’t persist beyond the game session, so its a good idea to actually
      // look to see if the player already has the item, unless you WANT them to get another one
      // The name in quotes is the TAG of the item. So what we do is see how many of the item
      // the player already has, and if its 0, we know we haven’t given it to them yet (or they sold it :p)
      int iItemCount = CountItemsByTag(oPlayer, “test_bowathena”);
      // if its 0, then let’s give them the item. Now this first parameter is a RESOURCE identifier. Note
      // how its formatted. R”resource_file_name”
      // The “R” part is important and identifies it as a resource. The filename is just the filename of the
      // resource. You can see this in the toolset on the tabs up top.
      // The number 1 means give 1 item.
      if (iItemCount == 0)
      UT_AddItemToInventory(R”test_bowathena.uti”,1);

      // lastly we set that number variable we talked about earlier, to save the fact that we’ve
      // done this already.
      SetLocalInt(OBJECT_SELF, “test_bowathena”, 1);
      break;
      }
      default:
      {
      break;
      }
      }
      }

      • John Vanderbeck
        November 11, 2009 at 6:44 pm

        Unfortunately at this point i’m unable to reproduce your error. I copied and pasted your script, fixed the quotes (I think that was just the blog formatting them funny) and then it compiled fine.

        The error you are receiving means that the script compiler was unable to locate the script “utility_h” which should be in the core game resources. If you go to your pallete and select scripts, the in the tree view below , expand “_Core_Includes”, do you see a file called “utility_h”? If so can you open it up?

      • Tm
        April 16, 2010 at 7:29 pm

        actually Re, the problem is most likely the spacing. i had the same problem, but the thing is, when i copied the tutorial’s script, to change the item and all, the format was messed up, and it used no spacing or indentation for the lines. when i fixed the indents, it worked fine. scripting’s just like that. the tiniest thing bugs it up.

  13. John Vanderbeck
    November 11, 2009 at 5:05 pm
    • Re
      November 11, 2009 at 7:19 pm

      Found utility_h in _Core_Includes folder and am able to open it up.

      • John Vanderbeck
        November 11, 2009 at 7:34 pm

        I’m afraid at this point i’m really at a loss as to say what is going on with your problem. As I said, the error indicates it can’t find the file yet you obviously have it, so i’m clueless. If I find a solution i’ll let you know, but i’m out of ideas at this point, sorry 😦

      • John Vanderbeck
        November 11, 2009 at 7:49 pm

        Try this: Edit your script and DELETE the line:
        #include “utility_h”
        Insert this BETWEEN the line that says #include “events_h” and void main()
        object UT_AddItemToInventory(resource rItem, int nNumToAdd = 1)
        {
        object oInvOwner = GetPartyLeader();
        return CreateItemOnObject(rItem,oInvOwner,nNumToAdd);
        }

        so the top of the file should look like this:
        // All module events
        #include “wrappers_h”
        #include “events_h”
        object UT_AddItemToInventory(resource rItem, int nNumToAdd = 1)
        {
        object oInvOwner = GetPartyLeader();
        return CreateItemOnObject(rItem,oInvOwner,nNumToAdd);
        }
        void main()
        {
        event ev = GetCurrentEvent();

      • Re
        November 11, 2009 at 7:53 pm

        did that and got the msg when i tried saving

        I: 11:51:54 – Compile failed
        E: 11:51:54 – module_core_bowathena.nsc – module_core_bowathena.nsc(2): After compound statement at end

  14. Kell
    November 11, 2009 at 7:29 pm

    How do I get multiple items into the game?

    • John Vanderbeck
      November 11, 2009 at 7:30 pm

      Take a look at the followup article

  15. John Vanderbeck
    November 11, 2009 at 8:05 pm

    Re :

    did that and got the msg when i tried saving

    I: 11:51:54 – Compile failed
    E: 11:51:54 – module_core_bowathena.nsc – module_core_bowathena.nsc(2): After compound statement at end

    You’re getting that error because the quotes are formatted funny by the blog when you copy and paste. Just delete all the quote makrs and re-type them.

    • Re
      November 12, 2009 at 12:41 pm

      Well just retyped all the quotes ( ” ) (hope thats what you ment by quotes) and now recieve this message.

      E: 04:40:30 – module_core_bowathena.nsc – Unable to get the resource information for “wrappers_h” of type “nsc”

      • John Vanderbeck
        November 12, 2009 at 12:47 pm

        Ok something is very screwed up in your toolset 😦 Now its complaining that it can’t find that file either. Seems every include file is not being found by the toolset.

      • Re
        November 12, 2009 at 12:48 pm

        Ohh well im gonna try reinstall toolset then and do it all over again. i’ll get back to you once im done if it doesn’t work.

      • Re
        November 12, 2009 at 1:22 pm

        Sighhh just reinstalled, coppied your tutorial to the letter (even naming item the exact same thing in all cases) and got the message

        E: 05:21:30 – module_core_bowathena.nsc – Unable to get the resource information for “utility_h” of type “nsc”

        when trying to save.

      • Re
        November 13, 2009 at 12:34 am

        Wow, so sorry for wasting your time, i figured out what the problem was. I was typing the script into the Client Scripts, not “Scripts” and now it has no problem saving or exporting. However the issue now is i am not recieving my item when i load a saved game, any ideas on why that is?

      • Re
        November 13, 2009 at 1:05 am

        XD got the item now to show up in game, i missed the last step of tutorial this time. Although i was originaly trying to add one of the +attribute books to inventory yet it wasn’t showing up, when i changed the item to a weapon it did. Im not sure if thoes books get auto used up when they enter inventory or not or perhaps i had done something wrong.

  16. tal
    November 12, 2009 at 4:24 am

    >>I’m not certain if there is an event for XP gain. I’ll have to dig a bit. There is >>an event for leveling up.

    were you able to find anything? i checked toolset wiki and searched in scripts but found nothing

    • John Vanderbeck
      November 12, 2009 at 12:47 pm

      I was not

  17. Rob
    November 12, 2009 at 2:51 pm

    My script is not working correctly either. The game sees the module, but does not add the item to inventory.

    Here is the code:

    // All module events
    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    ////////////////////////////////////////////////////////////////////////
    // Sent by: The engine
    // When: The module loads from a save game, or for the first time. This event can fire more than
    // once for a single module or game instance.
    ////////////////////////////////////////////////////////////////////////
    case EVENT_TYPE_MODULE_LOAD:
    {
    // this event can fire multiple times, and we only want to do this once
    // So we save a flag inside a number variable. We check it here and if its
    // set already then we know we’ve already done this before. The name of the
    // variable in quotes can be whatever you want.
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “ItemsGiven”);
    if (iModuleLoaded == 1)
    break;
    // get the object which contains the player
    object oPlayer = GetHero();
    // The flag we save won’t persist beyond the game session, so its a good idea to actually
    // look to see if the player already has the item, unless you WANT them to get another one
    // The name in quotes is the TAG of the item. So what we do is see how many of the item
    // the player already has, and if its 0, we know we haven’t given it to them yet (or they sold it 😛 )
    int iItemCount = CountItemsByTag(oPlayer, “bobo_marowynsstaff”);
    // if its 0, then let’s give them the item. Now this first parameter is a RESOURCE identifier. Note
    // how its formatted. R”resource_file_name”
    // The “R” part is important and identifies it as a resource. The filename is just the filename of the
    // resource. You can see this in the toolset on the tabs up top.
    // The number 1 means give 1 item.
    if (iItemCount == 0)
    UT_AddItemToInventory(R”bobo_marowynsstaff.uti”,1);
    // we can repeat this for each item to give

    // lastly we set that number variable we talked about earlier, to save the fact that we’ve
    // done this already.
    SetLocalInt(OBJECT_SELF, “ItemsGiven”, 1); break;
    }
    default:
    {
    break;
    }
    }
    }

    I get this message when “saving” the script:
    W: 14:47:57 – No starting area specified for campaign.
    Is this normal?

    • John Vanderbeck
      November 12, 2009 at 3:21 pm

      You’re script looks ok. At a guess, I would say double check that you are using the right tag/resource names and make sure you exported the item you created. Go back through the steps and double check everything. Missing just one piece will cause it to not work.

      • Rob
        November 12, 2009 at 4:13 pm

        What does this message mean?

        “No starting area specified for campaign.”

        my tag and resource names are correct and yes i’ve exported the item and script and generated the module/manifest xml.

  18. John Vanderbeck
    November 12, 2009 at 4:17 pm

    Rob :

    What does this message mean?

    “No starting area specified for campaign.”

    my tag and resource names are correct and yes i’ve exported the item and script and generated the module/manifest xml.

    That warning is normal in this case. It is simply letting you know that your module doesn’t have any actual areas, and no place for the player to start. Since we’re just extending the single player module, it doesn’t matter.

    • Rob
      November 12, 2009 at 4:22 pm

      Thank you for the information. This is frustrating. What about other variables, such as do i need to exit the toolset before loading the game? Is it possible when re-exporting one of the files it left duplicate copies, or merged copies instead of overwriting? What if I export the file before checking it back in?

  19. Juice
    November 12, 2009 at 5:22 pm

    I loved the tutorial, I followed it exactly to the T. I checked my dlc and my item was there. Mysteriously though, when i load up my game the item i created is not in my inventory. Any ideas on what the problem may be?

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

      Could be several things unfortunately. The toolset is so complex that one mistake along the way can be enough. Go back and re-export everything, and check the log for any errors that may have prevented the export. Compile the script again and check the log, make sure it actually compiles. Double check your item tags and resource names, resource file names.

  20. John Vanderbeck
    November 12, 2009 at 5:59 pm

    Rob :

    Thank you for the information. This is frustrating. What about other variables, such as do i need to exit the toolset before loading the game? Is it possible when re-exporting one of the files it left duplicate copies, or merged copies instead of overwriting? What if I export the file before checking it back in?

    You do not need to exit the toolset, and re-exporting has never given me a problem. You do need to save, and check-in before exporting or else you will export an older copy.

    • Rob
      November 17, 2009 at 1:06 pm

      I found the problem with my script. This is not outlined in your tutorial: after you create your script, you then have to open module manager and open properties to your module and change the field “script” to point to your new script instead of the default “module_core”.

      • John Vanderbeck
        November 17, 2009 at 1:14 pm

        This is covered in the tutorial unless some dwarves came in and edited it 🙂

  21. -Lücidity-
    November 12, 2009 at 6:59 pm

    The first time I used this guide, I missed a line (due to all the switching back and forth between here and the toolset) and I ended up saving my item improperly. The game recognized the file, but it wouldn’t show up in my inventory. Now I know why! 🙂

    The second time I followed this guide, I saw my mistake. And sure enough, when I created the new item, it worked perfectly! My mage is now the proud owner of Morrigan’s outfit (it’s MY story – I get the best looking outfit!) only with better stats. 😛

    Thanks for the great guide! I’ve bookmarked this page, and plan to come back often. 😀

    • John Vanderbeck
      November 12, 2009 at 7:50 pm

      Can I ask what it was that caused the problem the first time around?

      • -Lücidity-
        November 13, 2009 at 10:01 pm

        Instead of exporting the item and script without dependent resources and then generating module XML and manifest XML, I generated the module XML via the item and script, then the manifest XML through the tool tab.

        I guess I just skipped part of a line and continued reading on the line below it. Late night, tired eyes. 😛

  22. Calaelan
    November 12, 2009 at 9:00 pm

    Ok.. so I’m new to the whole C++ modding thing that Bioware decided to use for their toolset but I’ve done some basic mods before in Morrowind and a few others. I followed this tutorial and ran into some problems with the scripting. I had no issues creating the items or anything, just trying to make the script to add the items to my inventory. I copy and pasted the entire script you posted into the toolset and only changed what was in between the quotes, regarding the item resource file, to what I had named my item. I didn’t remove anything else, I then followed the rest of the tutorial to export and everything seemed to compile correctly so I tried it out, and nothing, my item wasn’t in my inventory, I know you mentioned C++ was a picky language so I was wondering where I screwed up.

  23. Calaelan
    November 12, 2009 at 9:10 pm

    So I deleted my old script to start fresh, and now i noticed there was an error when it tried to compile. Here’s the log

    I: 18:06:53 – Generated the campaign file.
    W: 18:06:53 – No starting area specified for campaign.
    I: 18:06:53 – Compile failed
    E: 18:06:53 – module_core_warriorlong.nss – module_core_warriorlong.nss(41): Unknown error
    I: 18:06:53 – Compiling module_core_warriorlong.nss…

    • John Vanderbeck
      November 12, 2009 at 9:27 pm

      Assuming your script is a duplicate of mine, line 41 would be the UT_AddItemToInventory call. Can you paste that line from your script? Also include the line above it. Probably just a syntax error or a problem with quotes.

  24. Calaelan
    November 12, 2009 at 9:11 pm

    btw… is there a way to delete the module if I wanted to do that?

    • John Vanderbeck
      November 12, 2009 at 9:24 pm

      Unfortunately at this time modules can not be deleted.

  25. Calaelan
    November 12, 2009 at 9:14 pm

    is there a way that I could add the item to the camp merchant for 1 copper? would that make things any easier?

    • John Vanderbeck
      November 12, 2009 at 9:26 pm

      No it would make it harder 🙂

  26. Lance
    November 12, 2009 at 9:19 pm

    Hey john sorry one more question.. I equipped the items I made for my party members, but after saving and reloading the game creates another set of those items again, even though I already own them (they are equipped on my party members)… is it because I messed up something in the script?

    • John Vanderbeck
      November 12, 2009 at 9:24 pm

      Most likely whats happening is since you equipped them on your party members, CountItemsByTag() isn’t seeing them, so the script gives them to you again. It is probably possible to walk through your whole party when doing the check, but I can’t think of the commands off the top of my head.

  27. Calaelan
    November 12, 2009 at 9:33 pm

    ok… it’s official… I’m a goober… I forgot one little step along the way. I forgot to set the module to use my script as it’s core script. Sorry for all the trouble

    • John Vanderbeck
      November 12, 2009 at 9:44 pm

      No trouble at all. That’s the thing with the toolset. Glad you got it working!

  28. Calaelan
    November 12, 2009 at 9:47 pm

    what would be the simplest way to add multiple items? I’m sure there is a line of script that would allow different armor pieces to be added, but I’m thinking it would be easier for a newbie like myself to just add different modules for each item

    • John Vanderbeck
      November 12, 2009 at 9:49 pm

      Take a look at the followup article I wrote. In there you will find some information on adjusting this to give multiple items.

  29. Wamp
    November 13, 2009 at 8:24 am

    I’m having a heck of a time getting this script to work.
    I’ve set my script to be owned by my addon in the “Module” and “Owner Module” fields. I’ve currently got the script set to add an Acolyte’s Staff as a control, to test its functionality. I’ve exported the script and staff files without dependencies. When I start my game, the addon I made is in the DLC section, and is checked.

    But when I load a game, it doesn’t give me an Acolyte’s Staff (and yep, I checked to make sure I didn’t have one in my inventory).

    I’ve included the script here. Any idea what I’m doing wrong ?

    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    case EVENT_TYPE_MODULE_LOAD:
    {
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “aga_bowathena”);
    if (iModuleLoaded == 1)
    break;

    object oPlayer = GetHero();

    int iItemCount = CountItemsByTag(oPlayer, “aga_bowofathena”);
    if (iItemCount == 0)
    UT_AddItemToInventory(R”gen_im_wep_mag_sta_aco.uti”,1);

    SetLocalInt(OBJECT_SELF, “aga_bowathena”, 1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

    • John Vanderbeck
      November 13, 2009 at 10:15 am

      Nothing jumps out at me. Go back and export your script again, make sure it doesn’t show any errors. Also double check your resource filename, although it sounds right.

  30. Januari
    November 13, 2009 at 2:40 pm

    I’ve tried creating a couple of items or duplicating ones in the game. I’m able to get them in and functioning with one exception. My problem is that i don’t seem to be able to make armor/weapons/bows etc. ‘female’. Other than looking somewhat odd, everyone in game then treats my character as male. I’ve tried changing the model to ‘female’ but after saving and checking the file back in it returns to ‘male’. Anyone able to offer some advice?

    • John Vanderbeck
      November 13, 2009 at 3:49 pm

      To my knowledge items aren’t classified as male or female. I’m thinking this might be a problem with the exporting corrupting your game. Check the post I did recently Preventing the Toolset from Breaking your Game

  31. Januari
    November 13, 2009 at 3:57 pm

    Actually if you select any peice of armor or weapons (perhaps more or perhaps not all, all that I have seen anyway) the very last option is Model Gender. It doesn’t seem to alter much with the exception of size (the chest armor being the obvious exception). Right now my chickie looks a little ridiculous wearing ‘male’ armor entirely to big for her. I’m not terribly good at this so i can’t be sure but i think it might have something to do with the Mode itself. Even without the items the NPCs treat my character as male. Disabling the mod returns things to normal aside from the ‘male’ looking armor.

    • John Vanderbeck
      November 13, 2009 at 4:00 pm

      Interesting. So turning off your mod does fix the invalid gender references? I haven’t done armor before. Let me take a look.

  32. Januari
    November 13, 2009 at 4:06 pm

    It’s weapons as well, as far as i can tell all ‘equipable’ items have a gender. It really looks like it shouldn’t be a problem. I should just be able to save items as ‘female’ presto problem solved. For some reason i’m not able to do this and they inevitably return to being ‘male’.

    It fixes it in new characters only. It seems that once the mod is loaded on an old character they are percieved as ‘male’ there after.

  33. Krownog
    November 13, 2009 at 6:54 pm

    I’m trying to see if I did this right…

    // All module events
    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    ////////////////////////////////////////////////////////////////////////
    // Sent by: The engine
    // When: The module loads from a save game, or for the first time. This event can fire more than
    // once for a single module or game instance.
    ////////////////////////////////////////////////////////////////////////
    case EVENT_TYPE_MODULE_LOAD:
    {
    // this event can fire multiple times, and we only want to do this once
    // So we save a flag inside a number variable. We check it here and if its
    // set already then we know we’ve already done this before. The name of the
    // variable in quotes can be whatever you want.
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “nmm_lostking”);
    if (iModuleLoaded == 1)
    break;

    // get the object which contains the player
    object oPlayer = GetHero();
    // The flag we save won’t persist beyond the game session, so its a good idea to actually
    // look to see if the player already has the item, unless you WANT them to get another one
    // The name in quotes is the TAG of the item. So what we do is see how many of the item
    // the player already has, and if its 0, we know we haven’t given it to them yet (or they sold it :p)

    int iItemCount = CountItemsByTag(oPlayer, “nmm_bootoflostking”);

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_bootoflostking.uti”,2);

    int iItemCount = CountItemsByTag(oPlayer, “nmm_glovesoflostking”);

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_glovesoflostking.uti”,2);

    int iItemCount = CountItemsByTag(oPlayer, “nmm_armoroflostking”);

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_armoroflostking.uti”,2);

    int iItemCount = CountItemsByTag(oPlayer, “nmm_helmoflostking”);

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_helmoflostking.uti”,2);

    int iItemCount = CountItemsByTag(oPlayer, “nmm_shieldoflostking”)

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_shieldoflostking.uti”,2);

    int iItemCount = CountItemsByTag(oPlayer, “nmm_axeoflostking”);

    if (iItemCount == 0)
    UT_AddItemToInventory(R”nmm_axeoflostking.uti”,2);

    // lastly we set that number variable we talked about earlier, to save the fact that we’ve
    // done this already.
    SetLocalInt(OBJECT_SELF, “nmm_lostking”, 1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

    When I hit save get this…

    I: 18:49:53 – Compile failed
    E: 18:49:53 – module_core_lostking.nss – module_core_lostking.nss(56): Parsing variable list
    I: 18:49:53 – Compiling module_core_lostking.nss…

    plz help?

    • John Vanderbeck
      November 13, 2009 at 7:00 pm

      Remove the “int” from the beginning of every call to “iItemCount = CountItemsByTag()” EXCEPT the first one.

  34. Krownog
    November 13, 2009 at 7:14 pm

    Ok thank you, now I’m getting

    E: 19:13:47 – module_core_lostking.nss – module_core_lostking.nss(56): No semicolon after expression

    • John Vanderbeck
      November 13, 2009 at 7:16 pm

      This one iItemCount = CountItemsByTag(oPlayer, “nmm_shieldoflostking”) is missing a semicolon.

      When you get an error you can double click it and it will take you to the line that gave the error.

  35. Krownog
    November 13, 2009 at 7:19 pm

    ooooh I didn’t know that! Thank you very much John! 😀

  36. Damodrae
    November 13, 2009 at 8:38 pm

    So I figured out how to create a folder to put an item in:

    When doing New – Item, in Folder just type where you want to put it. It’ll create the folder for you. For example I created a new sword and set the folder to \Damo. Next thing I know there’s an item damo_masamune located under \Damo in the toolkit tree on the right.

  37. Klok
    November 14, 2009 at 6:55 am

    I finished this tutorial step-by-step as I’ve searched since the release for good tutorials, but not found any that informates newbs as me. Thank you so much John, you’re really awesome.

  38. JLann1
    November 14, 2009 at 10:50 am

    I’m having the same problem Lance is, where everything works great, but every time we load the game it creates the item again. I’ve searched for other places that may have answers but everything I’ve found isn’t cutting it.

    Any chance we could see your original script with the necessary commands to prevent this problem?

    • John Vanderbeck
      November 14, 2009 at 11:19 am

      The script in the tutorial is my original script. The problem Lance was having was since he had equipped the items on his party members, when the script runs and does CountItemsByTag(oPlayer), it doesn’t see the items because they aren’t on the player anymore. So it creates new ones. If you only need to give yourself the item(s) once, then just disable the mod after. If you do want to keep the mod running though, then we’ll need to find a way to check all party members for the item. I’ll take a look into that and write a small article on it.

  39. JLann1
    November 14, 2009 at 11:47 am

    Fantastic man I can’t wait to see it. That’s exactly what’s happening to me as well. Oh, and thanks for all the hard work you’re putting into this tutorial John.

  40. Luke
    November 14, 2009 at 11:53 am

    thanks for the tutorial jhon, I whould like to ask how can I give my own texture to the object I created. I know how to extract the textures and how to edit the .dds file, I would like to know, if it’s not too diffucult, how to assign my new texture to this new item.

    Thank You!

    • John Vanderbeck
      November 14, 2009 at 12:05 pm

      That would require 2da editing, but honeslty i’ve not looked too deeply into it yet.

  41. Common Sensei
    November 14, 2009 at 2:51 pm

    I would like to make a suggestion for the script. If you create an item that then gets equipped by a party member instead of the hero, this script will kick in next time you load the game and it wll generate another copy. If you want to prevent that, I would recommend replacing

    object oPlayer = GetHero();

    int iItemCount = CountItemsByTag(oPlayer, “aga_bowofathena”);
    if (iItemCount == 0)
    UT_AddItemToInventory(R”aga_bowofathena.uti”,1);

    With:

    int iItemCount = 0;
    object [] arParty = GetPartyPoolList();
    int i = 0;
    int nSize = GetArraySize(arParty);
    object oFollower;
    for(i = 0; i < nSize; i++)
    {
    oFollower = arParty[i];
    iItemCount = iItemCount + CountItemsByTag(oFollower, "aga_bowofathena");
    }

    if (iItemCount == 0)
    UT_AddItemToInventory(R"aga_bowofathena.uti",1);

    • John Vanderbeck
      November 14, 2009 at 5:30 pm

      I intentionally wanted to keep it simple for this first tutorial. I’m going to type up a small article later covering some of these more advanced issues.

  42. Common Sensei
    November 14, 2009 at 4:03 pm

    I thought that might have worked but when I got home to actually test it, it did not. Oh well.

  43. bhodge
    November 14, 2009 at 11:08 pm

    Hey John, great tutorial, though I’m having a problem that I haven’t seen anyone else mention. Everything works fine, I load the game with my new item, it’s in my inventory, but i can’t transition between areas. I’ll right click on the door or space saying “Exit to World Map” and it brings up message about “Venturing Forth” but when I say yes nothing happens. I believe I did everything right, but before I redo it all, is there anything that would cause this?

    • John Vanderbeck
      November 14, 2009 at 11:20 pm

      Look at the article I wrote recently on how to prevent the toolset from breaking your game.

      • bhodge
        November 14, 2009 at 11:24 pm

        I assume you’re referring to getting rid of excess files in the override folder? The problem I have there is that there isn’t anything in my override folder. I know that the game is reading the items as they show up in-game, but I don’t know where it’s exporting them to.

      • bhodge
        November 14, 2009 at 11:30 pm

        Ah, I found that it was exporting to the directory in My Documents, and i deleted the .nss file that was in there, but I’m having the same problem. What specifically do I need to do?

  44. Mascie
    November 15, 2009 at 3:09 am

    Is there a way to add the item directly to your in-game inventory by adding new module to the save file?

    I want to add something that already exist in-game but i just couldn’t find it.

    • John Vanderbeck
      November 15, 2009 at 9:29 am

      You don’t add the module to your save file. You just add it to the game then load up your save and you’ll get the item.

      • Mascie
        November 16, 2009 at 5:38 pm

        i see

  45. NuclearWoo
    November 15, 2009 at 3:58 am

    Thanks for the tutorial.

    I am wondering if you can answer a question.
    I followed your instruction step by step. I do get the item. However, when I start a new game with human noble origin, the dog wont join my party at the kitchen. And after talking to your brother and after castle gets attacked, your mother do not show up so I cannot continue the game. I understand if not done carefully, you can mess up the single player game. But I followed it step by step and made sure I did not make a mistake. Just to make sure, I removed the module from my document file under /addin and when I start the game again the game works fine, the module is no longer listed on DLC page.

    Any advice?
    Thanks

  46. NuclearWoo
    November 15, 2009 at 4:11 am

    Ok I think I found a fix. I read your other post about emptying the override folder but found the one in game directory already empty. However, the one in my doc section did contain some file. After deleting the content, I think its working. Its too early to know for sure but it looks good so far.

    And I see the post right above me also state the same thing hehe.

    Well thanks again. I been passing this site to my friends and will be keeping my eye open for new info.

    • John Vanderbeck
      November 15, 2009 at 9:30 am

      Yes this is what causes it.

  47. Rugin84
    November 15, 2009 at 4:40 pm

    I was attempting to load two items into my inventory. Ancient Elven Helm and Boots, which due to game design I missed and was not able to return to the locations they are available at. But while trying to script them both in the same file I ran into this:

    E: 12:54:00 – module_core_elvenarmoradd.nss – module_core_elvenarmoradd.nss(22): Variable already used within scope (while compiling var_constants_h.nss)

    I was folling the intrusctions very closly from your script example and the one from your follow up article. No way which I put the two items in the same file would they work.

    Eventually I circumnavigated this by scripting one into the game, then exiting, putting the other one’s .uti into the script and loading it in seperatly…problem solved…then I just unchecked the module and force loaded my save game, voila!

    Just wanted to let you know, John, the trouble with the multiple item C++ lines You provided.

    Heres one of the script variances I used (I also tried it with a space between the “int”/”if” blocks for each item):

    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    case EVENT_TYPE_MODULE_LOAD:
    {
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “rug_elvenarmadd”);
    if (iModuleLoaded == 1)
    break;

    object oPlayer = GetHero();

    int iItemCount = CountItemsByTag(oPlayer, “rug_elvenarmadd”);
    if (iItemCount == 0)
    UT_AddItemToInventory(R”gen_im_arm_hel_med_elv.uti”,1);
    int iItemCount = CountItemsByTag(oPlayer, “rug_elvenarmadd”);
    if (iItemCount == 0)
    UT_AddItemToInventory(R”gen_im_arm_bot_med_elv.uti”,1);

    SetLocalInt(OBJECT_SELF, “rug_elvenarmadd”, 1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

    Thanks, and appologies in advance for any noob oversights I may have overlooked.

    • John Vanderbeck
      November 15, 2009 at 4:51 pm

      This error is caused by having “int” in front of BOTH of the calls to “int iItemCount = CountyItemsByTag()”. You must only have int in front of the FIRST one. The defines it. Once its defined as an int, any later uses can’t be re-defined, so drop the int.

      • Rugin84
        November 15, 2009 at 5:12 pm

        Thanks alot! Awsome with the quick reply.

  48. Anon
    November 15, 2009 at 9:45 pm

    The toolset freezes whenever I try to compile a script. Anyone know what the problem is?

    • Anon
      November 15, 2009 at 11:53 pm

      Nevermind. Locale problem. Anyway, how do you insert slots into a weapon?

  49. Mike
    November 16, 2009 at 1:42 am

    So the problem is that you don’t mention that if someone wants to make their own items they need to edit the script to what they named the item in the UID.

  50. Scourch
    November 16, 2009 at 2:11 am

    Hey John. So, I read all of these posts here. I previously tried this same tutorial on the official BioWare forums from a poster named WediKK, I believe.

    I have now done yours, and while very similar, yours is much more in depth, very informative. However, for both accounts I reproduce the same result – no item. Now as I have read from others they missed a step along the way, so you suggested try to re-export.

    I have done all of these things. Everything is pointing in the right direction, all my items were checked in and out. I checked the log for any failures or errors and there were none. I came back into the Toolset after seeing the mod in the DLC area and not receiving the item. Once inside I double checked again, and re-exported. Still, nothing. Be it from WediKK’s post or yours I get the mod in the DLC section, but it just doesn’t show in the game. Is there anything I can paste here or show you that might help because I’m just at a loss.

  51. Scourch
    November 16, 2009 at 2:20 am

    I don’t know if this will help at all. But I went into My Documents>BioWare>Dragon Age>addins>scour_crescent and everything in their is empty. There are thee initial folders: Assets, Core, and Module and each with their own sub-folders as I’m sure you’re well aware of. But there is nothing in any of these. Is that normal?

  52. Scourch
    November 16, 2009 at 2:44 am

    Just for ha-ha’s I went ahead and made another module using the Bow of Athena example. This way I literally changed nothing from your directions. Again, paying very close attention to detail and instructions I went through it all. No errors in the log report. The module shows in the DLC, but no Bow of Athena is in my inventory when I start a new game.

  53. Douchy Mustache
    November 16, 2009 at 5:42 am

    Hey! I followed this tutorial to the letter (yes, I created the same bow. :P), just to get a feel for the toolset. Everything compiles like it should (I guess, it says it can’t find a starting area) with no errors or warnings. I load up the game, and at the bottom of the DLC list it says “The Bow of Athena”. “Great!”, I think, “that was easy.” Well, upon loading my save, the item is nowhere to be found.

    Sorry for being long winded, but I guess my questions are: Has anyone happened upon this? How did you solve it? And finally, perhaps I have to start a new character for the script to even load?

    Thanks for eventual help. 🙂

    • Douchy Mustache
      November 16, 2009 at 9:50 am

      Nevermind, solved it by creating a new module. Strange and really kind of disappointing how buggy this toolset is. 😦

      • John Vanderbeck
        November 16, 2009 at 10:34 am

        Yes it is very touchy. It makes it very hard to help people to because it comes to a point where all I can say is “Do it again and follow real close” 😦 I try to help people as best I can but without being able to watch over your shoulder as you do it its real hard.

  54. hot'n toth
    November 16, 2009 at 6:54 am

    The Sword of Awesome is a sword so awesome it’s just too awesome to be true, so in order to counteract the incredible amounts of awesome the sword of awesome represents it can only be wielded by a noob. An awesome noob!

    My item is awesome 😉

  55. Scourch
    November 16, 2009 at 2:19 pm

    Well Douchy, (hilarious name lol) you’re lucky. Both my own custom item and the Bow haven’t seemed to work. John, I’m assuming there isn’t much to be done here? Anything I can do that might help?

    • John Vanderbeck
      November 16, 2009 at 3:24 pm

      Honestly all I can say is go through again and be very careful to follow every step. In nearly every case that someone was having problems, they were missing something. The tutorial DOES work as many people (literally almost a thousand so far) have successfully created their item.

      The toolset is extremely unfriendly and confusing.

  56. Scourch
    November 16, 2009 at 4:14 pm

    Well John, I thank you very much. The tutorial is so well written and done, and I have quadruple-checked everything. Yet I still cannot get any item in the game. The game itself gives me no problems, and I have no errors to report in the toolset. I’m sure you’re as confused as I am, especially considering the modules do show in the DLC section.

    I don’t know, maybe it’s something with my actual computer, who knows. But, you’re very helpful and if anything it was a good, informative read heh.

    • John Vanderbeck
      November 16, 2009 at 4:47 pm

      I’m sorry it isn’t working for you 😦 I wish the toolset was more forgiving, to make it easier for new people to get started.

  57. Januari
    November 16, 2009 at 4:21 pm

    Well i started completely from scratch and repeated the process. This time it worked like a charm and i didn’t experience any of the strange issues i ran into the first time around.

    Thank you for putting this together John. When i loaded the toolset up for the first time i nearly wrote it off as being far more of a hassle than it was worth, and i almost certainly would have done so had i not found your tutorial.

    Thx again!…

  58. Scourch
    November 16, 2009 at 6:55 pm

    John, good news, I managed to get it to work.

    Interesting how it came about, though. I just uninstalled the toolset, made a new character and played him out of the origin and into Ostigar. Once there, I saved and exited the game. Installed the toolset again and did the TOOLS -> EXPORT -> EMPTY EXPORT DIRECTORIES just to be on the safe side of starting on a clean slate.

    Followed your directions and it worked. So then I created another module to make my sword, which also worked. However, here is a question for you. I set my sword to be Dragonbone for both material progression and type, I also did a + damage to Darkspawn for the OnHit Effect. But in the game the sword loads up as Grey Iron material and no + damage to darkspawn. The three things I put in for the Item properties worked, however. Any ideas?

  59. Jeff
    November 16, 2009 at 7:01 pm

    I created a shield and it loads up perfectly, (awesome guide, can’t believe I was able to do it), the only issue I have is that shield is always in the players hand. It never sits on the characters back like every other shield. Any idea what I did wrong?

    Shield settings that I changed
    Ambient – Shield – Round
    Shield, Dragonbone
    Shield, Dragonbone
    item variation is cut 6
    Subgroup is 344000 – copied directly from other shields

    • John Vanderbeck
      November 16, 2009 at 7:08 pm

      Hmm, not a clue at the moment. I haven’t run into this problem before.

  60. Scourch
    November 16, 2009 at 7:08 pm

    Lol, and nevermind. Got that to work too. John you’re a saint for putting up with me haha. Cheers my friend!

  61. Laeird
    November 17, 2009 at 9:41 am

    I’ve noticed with this script to put the item in that it only checks the main character and the overall inventory. If you place an item on one of your followers the script does not see it and will put another copy into your inventory.

    • John Vanderbeck
      November 17, 2009 at 10:07 am

      Yes. This script was intentionally left simple. Unfortunately I did not forsee that so many people would use it as a basis for releasing an item mod.

  62. Connect
    November 17, 2009 at 2:03 pm

    Hey, great tutorial, very good for us starters out here! Easy to understand, and gets us familiar with some of the most basic functions of the tool, great job!

    You could also do a small tutorial on how to prepare our mods for sharing (making a DAzip for example), that would be helpful as well!

    • John Vanderbeck
      November 17, 2009 at 2:10 pm

      You know, I keep meaning to do this then keep forgetting.

  63. Anon
    November 17, 2009 at 7:37 pm

    Anyone know the icons tags for the DLC items?

  64. November 18, 2009 at 11:35 am

    Hello,

    I really love the tutorials, but I just get the same error message over and over again. The error message is: “No left bracket on arg list” at line 7. This is the code I’m trying to compile:

    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”

    void main()
    {
    Event ev = GetCurrentEvent();
    int iEvent = GetEventType(ev);

    Log_Events(“”, ev);

    if(iEvent == EVENT_TYPE_MODULE_LOAD)
    {
    int iFirstLoaded = GetLocalInt(OBJECT_SELF, “ddl_bowofathena”);
    if(iFirstLoaded == 0)
    {
    object oPlayer = GetHero();

    iInPossession = CountItemsByTag(oPlayer, “ddl_bowofathena”);
    if(iInPossession == 0)
    {
    UT_AddItemToInventory(R”ddl_bow_of_athena”, 1);
    }
    }
    SetLocalInt(OBJECT_SELF, “ddl_bowofathena”, 1)
    break;
    }
    }

    Line 7 is: ” Event ev = GetCurrentEvent();”, could anyone help me out?

  65. vaan
    November 18, 2009 at 12:57 pm

    Can you make the script to checks party and the overall inventory, So it won’t be spawn another copies when reload save game?

  66. Cory Stanish
    November 20, 2009 at 5:33 pm

    Hey thanks a million for this tutorial! It really helped me to take my first hesitant steps into the daunting world of modding.

  67. Sunstar
    November 20, 2009 at 11:48 pm

    Hi John – wanted to say thanks very much for the tutorial – i tried it and it works… I found i could add multiple items very easily by numbering the variables

    int iItemCountone = CountItemsByTag(oPlayer, “tcd_bow_of_the_sharpshooter”);
    int iItemCounttwo = CountItemsByTag(oPlayer, “tcd_stat_book”);

    and the give items lines

    if (iItemCountone == 0)
    UT_AddItemToInventory(R”tcd_bow_of_the_sharpshooter.uti”,1);

    if (iItemCounttwo == 0)
    UT_AddItemToInventory(R”tcd_stat_book.uti”,1);

    there’s probably a simpler way of doing it – but my c++ skills are really lacking. ( i learned to program in basic and pascal 30 years ago)

    I also found i need a unique item script to increase all attributes by 3 for the book. 🙂 I’m working on that. (i didn’t get the deluxe edition items and I’ve played through once vanilla so figure there is no harm in learning to mod a little by cheating a little 😀 )

    a general tutorial on unique item scripts would be handy 🙂 at least for me –

  68. Vortaka
    November 21, 2009 at 12:03 am

    A very very big thanks for this tutorial! Would have probably wasted another weekend trying to figure out how to add/edit items… And the best part of it? We don’t mess around with the original! Yippi! :p Thanks again!

  69. Bap0813
    November 21, 2009 at 3:17 am

    Hey sorry i have been looking and having found anyone talking about

    E: 02:04:50 – Cannot load the AddIns.xml file. Unable to verify

    I was just wondering if that was normal, ive had lots of problems with DA and Toolset i have even went so far as to wipe my hardrive yesterday and everythings brand new except for the wiped hardrive.

    • John Vanderbeck
      November 21, 2009 at 10:31 am

      I had this happen after manually editing my AddIns.xml to remove a module. I somehow broke the file. It causes all sorts of probelsm with the toolset i’m afraid. The only way I was able to fix it was by rolling back to a previous version using windows 7’s file version thingy. Even deleting it and letting the game rebuild it didin’t fix it 😦

      • Bap0813
        November 21, 2009 at 12:42 pm

        I dont think that i went in there manually but i wont swear to that. I have Windows xp and if rolling back fixed it for you then maybe itll fix it for me to, how would i roll it back?

  70. NuclearWoo
    November 21, 2009 at 8:25 am

    I am not sure if this is the right place to ask but is there a way to flag items that you create to be part of a set. I was some armor had bonus when equip together. Not sure but seems like there is a xls file somewhere for item set but not sure where it is or how to use it.

    Secondly, can you or someone give me a quick rundown for making item for Shale thats part of the DLC? Not sure where i can find items that came with the DLC so i can compare and get a reference point.

    Thanks again

    • Bap0813
      November 21, 2009 at 1:21 pm

      Oh freaking hells yes!!! I FIXED IT, if anyone else has that problem your oging to have to start over which is no big deal just do what he said and “TOOLS -> EXPORT -> EMPTY EXPORT DIRECTORIES” well at least thats what i did anyways and i got my item! 😀

  71. John Vanderbeck
    November 21, 2009 at 1:10 pm

    Bap0813 :

    I dont think that i went in there manually but i wont swear to that. I have Windows xp and if rolling back fixed it for you then maybe itll fix it for me to, how would i roll it back?

    Unfortunately I don’ think its a feature in XP. In Win7 you can just right click the file and go to the previous versions tab.

    • Bap0813
      November 21, 2009 at 7:09 pm

      Its all good it has been working for me since 12 here. I emptied directories well over one time and it decided to work 🙂 so im happy!

  72. Patrick
    November 22, 2009 at 12:33 am

    Props to the cool tutorial!

    Would you know how to add a new texture and link it to the model or item, re-skinning has its limitations.

    • John Vanderbeck
      November 22, 2009 at 12:34 am

      Patrick,
      It is actually a pretty involved matter involving creating new materials using the material editor. I am still working with it and don’t have it down 100% yet.

  73. Ace
    November 22, 2009 at 5:43 am

    I have some problomes. when I create an item, I cannot edit it…
    http://img187.imageshack.us/i/helpi.gif/
    pls help

    • John Vanderbeck
      November 22, 2009 at 10:37 am

      Any resource must be checked out before you can edit it.

      • Ace
        November 22, 2009 at 1:30 pm

        when i created the item, i marked the box of “chackout resource after creation”. is’nt thet enough?

  74. Mark
    November 22, 2009 at 11:29 am

    Hi, in first place Thanks for this great tutorial.

    I made my own Item and its works fine. But now, I want to add another item to my inventory by using the same script (a modified version of yours). I’ve read the reply that “Sunstar” posted. I tried to apply this lines of code into the script but it doesn’t work in game.

    I suppose that the process to make the new module, are the same for 1 item or 2, I mean:

    1- save and check in finished items and script(successful compile).
    2- “export without dependent resources” for each item.
    3- generate module and manifest XML for the script.

    I wonder if someone can help me with it.

    Here is the code:

    // All module events
    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    case EVENT_TYPE_MODULE_LOAD:
    {
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “hlm_auricu”);
    if (iModuleLoaded == 1)
    break;

    object oPlayer = GetHero();

    int iItemCountONE = CountItemsByTag(oPlayer, “hlm_aur”);
    int iItemCountTWO = CountItemsByTag(oPlayer, “malla_blanca”);

    if (iItemCountONE == 0)
    UT_AddItemToInventory(R”hlm_aur.uti”,1);

    if (iItemCountTWO == 0)
    UT_AddItemToInventory(R”malla_blanca.uti”,1);

    SetLocalInt(OBJECT_SELF, “hlm_auricu”, 1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

    Thanks.
    pd: sorry for my English.

    • Sunstar
      November 22, 2009 at 10:32 pm

      Hi

      as you are adding a second item – did you use the local variable in the script the first time you added an item?

      int iModuleLoaded = GetLocalInt(OBJECT_SELF, “hlm_auricu”);
      if (iModuleLoaded == 1)
      break;

      if you loaded the first item with the same script then the script will see the variable and then break – which ends the script.

      you see that line is a test that tests to see if the script has already been run on that character – (0 = no, 1= yes) so if you added an item and are now trying to use the same script and variable to add a second item the script will see that the script has been run and stop running.

      change the variable and try again –
      int iModuleLoaded = GetLocalInt(OBJECT_SELF, “hlm_auricuTWO”);

      and don’t forget to add the new variable at the end so the script runs once

      SetLocalInt(OBJECT_SELF, “hlm_auricuTWO”, 1);

      I hope that works for you – i’m not a c++ programmer so i can’t tell if the script is right — i did learn to program in several languages years ago – so i can see the logical errors not the scripting ones.

  75. John Vanderbeck
    November 22, 2009 at 1:43 pm

    Ace :

    when i created the item, i marked the box of “chackout resource after creation”. is’nt thet enough?

    You would think so, but in the screenshot you showed, the resource was clearly not checked out. Just right click and and check it out.

  76. John Vanderbeck
    November 22, 2009 at 3:52 pm

    Ace :

    I don’t have check out option:
    http://img517.imageshack.us/i/helpb.gif/

    Hmm then either your toolset is messed up, or you did something wrong along the way. I see now that your resource has a big red circle on it, which it shouldn’t. Let me see if I can figure out what happened.

  77. Joe Gnall
    November 22, 2009 at 5:19 pm

    Hi, I just started working with the Toolset, and using your site to get up and running. I just figured out that you can actually create your own folders. Not sure if it’s been brought up or discussed, but when you right click and bring up the New item, area, etc under the options for the Create a New Resource window where Folder is just Root eg: \

    You can make a new folder play typing the name you want in after the root identification eg: \Your Folder Name

    After you finish out the rest of the options and click Ok the Toolset will do all it’s running and calculating and you will then see your brand new Folder, created all for you, and in alphabetical order in the folder list.

    Hopes this helps out.

    Joe

  78. Sven Boogie
    November 22, 2009 at 9:06 pm

    I find it a little odd that (although it was easy to figure out) you never explicitly tell the reader to go through your script and replace the tag for the item you made with the tag the reader has used…

  79. DemonWing
    November 22, 2009 at 11:37 pm

    I’ve also hit a road-block. Here is some modified code from the other page.

    //All module events
    #include "utility_h"
    #include "wrappers_h"
    #include "events_h"
    void main()
    {
        event ev = GetCurrentEvent();
        int nEventType = GetEventType(ev);
        Log_Events("", ev);
        switch (nEvent)
        {
            case EVENT_TYPE_MODULE_LOAD:
            {
                object oPlayer = GetHero();
    
                object oAttrib = GetObjectByTag("gen_im_qck_book_attribute2");
                if (!IsObjectValid(oAttrib))
                UT_AddItemToInventory(R"gen_im_qck_book_attribute2.uti", 99);
    
                object oSkill = GetObjectByTag("gen_im_qck_book_skill");
                if (!IsObjectValid(oSkill))
                UT_AddItemToInventory(R"gen_im_qck_book_skill.uti", 99);
    
                object oTalentm = GetObjectByTag("gen_im_qck_book_talentm");
                if (!IsObjectValid(oTalentm))
                UT_AddItemToInventory(R"gen_im_qck_book_talentm.uti", 99);
    
                object oTalentw = GetObjectByTag("gen_im_qck_book_talentw");
                if (!IsObjectValid(oTalentw))
                UT_AddItemToInventory(R"gen_im_qck_book_talentw.uti", 99);
    
                object oHeal = GetObjectByTag("gen_im_qck_health_401");
                if (!IsObjectValid(oHeal))
                UT_AddItemToInventory(R"gen_im_qck_health_401.uti", 99);
    
                object oInj = GetObjectByTag("gen_im_qck_injury_301");
                if (!IsObjectValid(oInj))
                UT_AddItemToInventory(R"gen_im_qck_injury_301.uti", 99);
    
                object oMana = GetObjectByTag("gen_im_qck_mana_401");
                if (!IsObjectValid(oMana))
                UT_AddItemToInventory(R"gen_im_qck_mana_401.uti", 99);
    
                object oWSword = GetObjectByTag("cosmic_power");
                if (!IsObjectValid(oWSword))
                UT_AddItemToInventory(R"cosmic_power.uti", 1);
                break;
                }
    default:
    {
    break;
    }
    }
    }
    

    The error I get is:
    E: 23:23:02 – kgc_easy.nss – kgc_easy.nss(10): Variable defined without type (while compiling var_constants_h.nss)

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

      @Demon Wing
      EDIT: Sorry my answer was incorrect. I shoudn’t check comments before caffeine 😦

    • Keith
      December 15, 2009 at 12:09 pm

      At the end of all of the error codes there is a number in brackets. That number corresponds to the line of code that the compiler got confused on. I don’t know enough about event scripts to say what is wrong with “switch (nEvent)”.
      IANAP My guess is a missing “:” at the end of that line, but I may be showing my inexperience.

    • John Vanderbeck
      December 15, 2009 at 12:25 pm

      @DemonWing
      I’m sorry I thought I had replied to this question but I never did. If you are still trying to fix it, the problem is that on line 10, “switch (nEvent)” you are trying to use a variable “nEvent” that you never defined anywhere. Based on your code, the line should read “switch (nEventType)” because it is referencing the “int nEventType = GetEventType(ev)” line.

  80. khoa
    November 23, 2009 at 12:46 am

    ive added my first longsword! thank you.

    when you add other items, do i need to do anything special in order to add more? because ive made 4 modules after the longsword and they all dont work. do i have to combine modules or osmething?

  81. Imperfect
    November 24, 2009 at 11:44 pm

    i am having a problem in game where the name of the item is not appearing when i move my mouse over the icon while its in my inventory. This is my very first attempt at using the toolset and i am probably making a simple mistake
    BTW great tutorial, was very helpful

  82. Clarian
    November 25, 2009 at 12:27 pm

    Great tutorial!

  83. Diddy
    November 26, 2009 at 11:48 am

    Great guide! Helped me out alot. 🙂

  84. dwbraswell
    December 3, 2009 at 3:53 pm

    I have a question, that is a little more advanced, that I was hoping someone could maybe answer. I have my mod working and it gives several items to the my character, thanks to this guide. However I would like to do something so that I do not have lots of extra equipment given to all my different characters, or so that I do not have a bunch of different modules loaded to give equipment to the different characters. So I was wondering if there was possibly a way to make the script give a different set of items do different characters based on Name? Race/Class? or Possibly even Game Difficulty setting?

    Any suggestions would be appreciated!

    • Fellstroke
      December 11, 2009 at 2:44 am

      GetCreatureCoreClass()
      GetName()
      GetGameDifficulty()

      I think those might be what you’re looking for.

  85. Yggie
    December 14, 2009 at 3:28 pm

    Ty very much, great tutorial! Works like a charm for me 😀
    I’m impressed by your kind, patient answers to all the questions asked. Restecp!

  86. z00
    December 18, 2009 at 4:03 pm

    would you tell me
    how do I remove mod that i created?

    i’m still noob :hammer:

  87. Mattias71
    December 26, 2009 at 2:25 pm

    I recently made a mod using your tutorial, and it worked perfectly… (thanks for the tutorial)… but when I tried to make a second one(even after I followed all the instruction you gave again) the second mod will not show up in my game… I am wondering what I am doing wrong… I created a whole new module… I made the item, used the script you gave in your other tutorial (it’s the same one I used for my first mod) then I saved them, checked them in, and exported everything just like you said… but when I go and see if it shows up in my game… it’s not there… even though it shows up in my downloaded content but not in any of my games… If you could help me figure out what I’m doing wrong that would be a big help!

    • John Vanderbeck
      December 27, 2009 at 12:57 am

      90% of the time this is due to a mistake being made somewhere along the way. Go back and double check everything.

  88. blood121
    December 29, 2009 at 9:48 am

    I got the tutorial right and I want to thank you very much for taking the time and writing it but my problem lies somewhere else…

    I want to edit stats of Warden Armor you get trough DLC called “Wardens Keep” but I can’t find the armor anywhere in the toolset…

    Anyone, help? Thx 🙂

    • John Vanderbeck
      December 29, 2009 at 11:09 am

      The DLC content is not available to be edited. Just like a modder can’t really edit stuff you make.

  89. Jeff
    December 29, 2009 at 2:50 pm

    John,

    Thanks helping all us try out moding. I took the first tutorial script and added the new checking code for items but they don’t appear. The script compiled fine. The script should just give the armor and shield. Here is the script:

    // All module events
    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    ////////////////////////////////////////////////////////////////////////
    // Sent by: The engine
    // When: The module loads from a save game, or for the first time. This event can fire more than
    // once for a single module or game instance.
    ////////////////////////////////////////////////////////////////////////
    case EVENT_TYPE_MODULE_LOAD:
    {
    // this event can fire multiple times, and we only want to do this once
    // So we save a flag inside a number variable. We check it here and if its
    // set already then we know we’ve already done this before. The name of the
    // variable in quotes can be whatever you want.
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “jk_power_armor”);
    if (iModuleLoaded == 1)
    break;

    // get the object which contains the player
    object oPlayer = GetHero();

    object oArmor = GetObjectByTag(“jk_power_armor_chest”);
    object oBoots = GetObjectByTag(“jk_power_armor_boots”);
    object oGloves = GetObjectByTag(“jk_power_armor_gloves”);
    object oHelm = GetObjectByTag(“jk_power_armor_helmet”);
    object oShield = GetObjectByTag(“jk_power_shield”);

    if (!IsObjectValid(oArmor))
    UT_AddItemToInventory(R”jk_power_armor_chest.uti”,1);
    if (!IsObjectValid(oBoots))
    UT_AddItemToInventory(R”jk_power_armor_boots.uti”,1);
    if (!IsObjectValid(oGloves))
    UT_AddItemToInventory(R”jk_power_armor_gloves.uti”,1);
    if (!IsObjectValid(oHelm))
    UT_AddItemToInventory(R”jk_power_armor_helmet.uti”,1);
    if (!IsObjectValid(oShield))
    UT_AddItemToInventory(R”jk_power_shield.uti”,1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

    • Jeff
      December 29, 2009 at 5:43 pm

      I got figured it out – I had forgot to export the items.

  90. Ironbug
    December 30, 2009 at 10:48 pm

    I was able to create my custom weapon. Thanks, but how do I change the diffuse texture for it without replacing the original content diffuse texture?

  91. Kael
    January 2, 2010 at 11:16 pm

    Just wanted to say, when I was going through the tutorial, you stated the you hadn’t figured out how to create a new folder yet. I posted the item to be placed in a non-existing folder and it created the folder and placed my item into it. Hope that’s helpful to someone. Also, the item still worked fine in my game after.

  92. JaegerBane
    January 6, 2010 at 4:22 pm

    Good tutorial, though I have to admit the toolset ranks as one the most poorly-written pieces of software I have ever had the misfortune of using.

    I’m currently trying to edit a modded helmet. The edited stats stick no problem, but for some no doubt pathetic reason, despite following the exact methodology of checking in, editing, checking out, exporting without dependant resources, module generate manifest and xml, and it simply will not change.

    Anyone have any ideas?

    • JaegerBane
      January 6, 2010 at 4:25 pm

      Agh, ignore my bellyaching, figured out what was wrong.

      Forgot to get rid of the previous version of the item in my inventory then reload. Only realised when I looked at my script and realised it would never get to the point where the item would be given.

      Epic Fail :p

  93. Varks
    January 6, 2010 at 5:26 pm

    Could someone throw together a script for adding Black Grimoire (the book morrigan wnats) to the character’s inventory regardless of it possibly being in a merchant vendor? I’ve tried and it doesn’t seem to work.

  94. January 6, 2010 at 11:48 pm

    Thanks for a great tut:)

  95. Jools
    January 14, 2010 at 9:45 am

    Hello. The guide is awesomely easy to follow and very thoroughly, and I got through it with great pleasure, only, when I load a savegame, nothign happens. The item just does not appear in my inventory, and I experienced no errors whatsoever during the creation of the item/script and export process (apart from the “no starting area” one, which I understand is not relevant). Am I overlooking something?

    Anyway, thank you and good job!

    • Joe
      July 2, 2010 at 7:06 am

      Hello, my knowledge is limited. I am calssifeid as a biggner in this toolset yet I will attempt to help. I experienced the same problem, the problem was that I did not assign the script to the module, a step that I skipped. All you have to do is select File >>> Manage Modules >>> Properties >>> scroll down until you see Script: click on the 3 dots … and select the script you created. Hope this helped.

  96. James
    January 26, 2010 at 8:33 am

    I’m currently following your guide and I would like to add that in order to create a new folder in the palette window folder list you need only to type the desired folder name after (to the right of) the ‘/’ that represents the ‘root’ directory in the ‘create new resource’ window. This is the same as when installing a new program. You don’t need to create the folder manually as windows will automatically create the new folder once you close resource window.

    Thanks for the guide!

    James

  97. Alsafysh
    February 1, 2010 at 4:16 pm

    Hey thanks for this! Great tut for starting out with that maze of a toolset. Tried to make my very own set of armor and worked like a charm the first time I loaded the game.
    Reading is fundamental.
    Kudos to you for taking the time and effort to do this!

    • Alsafysh
      February 1, 2010 at 4:18 pm

      Oh but one question, I assume if you wish to change anything about an item you have previously exported then you need to re-export everything(module and all) or just the item?

      Thanks!

  98. Alsafysh
    February 2, 2010 at 11:50 am

    About Lance’s question at the top, I got this as well. It was the game not knowing how to assign the armor. Example:Pimpin’ Chain() I went back in and assigned it as Steel level armor. It then said Pimin’ Chain (Steel).

  99. Andros
    February 16, 2010 at 8:27 am

    I am having the same problem JaegerBane was having. But a slight difference. I sold the item to Bohdan in camp. Now the item won’t appear again. What should I check?

  100. Chris
    March 11, 2010 at 12:55 pm

    Thanks for a great guide. I followed it for 1.02a and it works great. Now, with 1.03, I can’t get my items to appear for new characters, even after forced loading. Another addon I have that I assume uses the same technique also stopped working w/ 1.03.

    Do you know if this technique was broken by 1.03, and do you know of a fix?

  101. Silent Dove
    April 13, 2010 at 1:32 pm

    Under the part “Creating an even script” you say to set a folder like before…I dont see anything where Im suppose to “set a folder”…what folder? how do I “set” a folder?

  102. Silent Dove
    April 13, 2010 at 1:54 pm

    Under the part “Creating an event script” you say to set a folder like before…I dont see anything where Im suppose to “set a folder”…what folder? how do I “set” a folder?

    • Silent Dove
      April 13, 2010 at 1:57 pm

      BTW my module is called “mystuff” so for resource name i put “module_mystuff_bowofathena” is that the correct way to write this?

  103. peterfaj
    May 12, 2010 at 3:35 pm

    I do not get my item in the game. I have modified the script accordingly. The tag and the resource name are the same as the script calls them. I’ve even tried removing the “if” that checks if I already have the item and made the script only give the item in any case.
    In the game, the add-on is listed in the add-on menu and it is activated.
    I am using Dragon Age 1.3 version and Dragon Age Toolset 1.01 version.

  104. Joe
    July 2, 2010 at 3:40 am

    Hello thanks for all the great help on how to create an item ans spawning it in the inventory. I do however have one question, i want to create an i tem but use my own custom image as the icon? If it is, help would be appreciated. Thanks 🙂

  105. Ame
    September 11, 2010 at 12:50 pm

    Okay, I followed this guide and it broke my game. Got module “single player” is missing and now I cant play or do anything. No idea why this is happening because Ive used your guide and the toolset before and it worked perfectly. I did a reinstall and now it keeps breaking. Any advise?

  106. Diana Ochoa
    October 1, 2010 at 1:44 am

    hey my items arent showing in the inventory and everything went fine what did i do wrong?

  107. Satannas
    October 24, 2010 at 6:28 am

    well i figured it out

  108. Taks
    November 3, 2010 at 8:22 pm

    Hey I wonder if you could help me I followed your guide and went to the downloadable colum and it said bow of athena enabled and whent into single player and it isn`t in my inventory please help?

  109. Danny
    December 11, 2010 at 6:26 am

    Hi,
    I did everything as you instructed. however, i had this issue and Im not sure how to resolve it
    my_even_handler.nss – my_event_handler.nss(?): Included file not found
    Any help is greatly appreciated.

  110. Kael
    December 28, 2010 at 6:33 pm

    Would it be possible to alter the attributes/abilities for an already modded item? I happened to download this really cool armor, but the thing is, it adds a ridiculous 150% backstab damage (like, WTF?!), but otherwise it’s okay. I just want to be rid of that outrageous attribute. That and in tandem with its “reduces hostility” property makes my game boring. 😦

  111. KaariNovember
    January 23, 2011 at 9:01 am

    Hello,
    I own the Dragon Age Ultimate Edition. I installed the game from scratch and did not toy around with the toolset beforehand. I followed your instructions step by step and created a module. The problem is – I can start Dragon Age now, and the module appears in the list of other modules in Dragon Age. But as soon as I want to start a new game or load an old one I get a message: “Module “single player” is missing”
    Any idea what’s wrong?

    Here’s the script:

    // All module events
    #include “utility_h”
    #include “wrappers_h”
    #include “events_h”
    void main()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);
    switch (nEvent)
    {
    ////////////////////////////////////////////////////////////////////////
    // Sent by: The engine
    // When: The module loads from a save game, or for the first time. This event can fire more than
    // once for a single module or game instance.
    ////////////////////////////////////////////////////////////////////////
    case EVENT_TYPE_MODULE_LOAD:
    {
    // this event can fire multiple times, and we only want to do this once
    // So we save a flag inside a number variable. We check it here and if its
    // set already then we know we’ve already done this before. The name of the
    // variable in quotes can be whatever you want.
    int iModuleLoaded = GetLocalInt(OBJECT_SELF, “gen_im_acc_rng_exp”);
    if (iModuleLoaded == 1)
    break;

    // get the object which contains the player
    object oPlayer = GetHero();

    // The flag we save won’t persist beyond the game session, so its a good idea to actually
    // look to see if the player already has the item, unless you WANT them to get another one
    // The name in quotes is the TAG of the item. So what we do is see how many of the item
    // the player already has, and if its 0, we know we haven’t given it to them yet (or they sold it :p)
    int iItemCount = CountItemsByTag(oPlayer, “gen_im_acc_rng_exp”);
    // if its 0, then let’s give them the item. Now this first parameter is a RESOURCE identifier. Note
    // how its formatted. R”resource_file_name”
    // The “R” part is important and identifies it as a resource. The filename is just the filename of the
    // resource. You can see this in the toolset on the tabs up top.
    // The number 1 means give 1 item.
    if (iItemCount == 0)
    UT_AddItemToInventory(R”gen_im_acc_blt_c1b.uti”, 1);
    UT_AddItemToInventory(R”gen_im_acc_blt_t1c.uti”, 1);
    UT_AddItemToInventory(R”gen_im_acc_rng_exp.uti”, 1);

    // lastly we set that number variable we talked about earlier, to save the fact that we’ve
    // done this already.
    SetLocalInt(OBJECT_SELF, “gen_im_acc_rng_exp”, 1);
    break;
    }
    default:
    {
    break;
    }
    }
    }

  112. dragonsiege
    February 9, 2011 at 3:32 am

    @John Vanderbeck
    To create a folder in the Palette Window folder list, simply type in the desired folder name in the New Item dialog.

  113. Wintersleep
    April 21, 2011 at 1:58 pm

    I’m sorry I know this is a really old tutorial/article. but I recently started working with the toolset and everything seems to be fine with everything you’ve talked about above. Everything is a success according to the log window and the item is in my downloadable content in the game but it isn’t in my inventory on any characters. I even started a new one to make sure.

    I am having the same problem as Jools above me I believe. Not sure what is wrong but would really like to make my own mods 🙂 Thanks again for this great tutorial, I just hope I will be able to use it 😉

    • Wintersleep
      April 21, 2011 at 3:29 pm

      I got 🙂 finally……I suppose everyone has to start out noobie 😉

  114. TGF
    September 7, 2011 at 3:17 pm

    //——————————————————————————
    /*
    Hi guys…
    so I’ve followed up on this tutorial, this tutorial
    A Better Way to Check for Existing Items Before Spawning“, this tutorial
    Common Problems and Mistakes Creating Your First Module“,
    and this one
    [Item] Making an item spawn only once
    now I’m no programmer and my knowledge is pretty limited but i would like to share one of my function definitions because I’m not sure what’s not working. My money is on my logic -_-”
    By the way thanks John an all you freaks that have nothing better to do with you’re life…
    */
    //——————————————————————————

    //so i start with declaring my function:
    void fAddItem (resource rItem, int nNumToAdd, string sTag);
    //down here i guess it’s pretty much standard
    void()
    {
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events(“”, ev);

    switch(nEvent)
    {
    case EVENT_TYPE_MODULE_LOAD:
    { //info i guess I’m passing on???
    fAddItem(R”gen_im_cft_uni_dwv.uti”, 99, “gen_im_cft_uni_dwv”);
    //the list goes on…
    break;
    }
    default:
    {
    break;
    }
    }
    }
    //here i believe im defining my function???
    void fAddItem(resource rItem, int nNumToAdd, string sTag)
    {
    //if party members inventory is shared i believe it’s ok to do this
    object oInvOwner = GetMainControlled();
    int nCount;

    //get how many and verify condition
    if(UT_CountItemInInventory(rItem, oInvOwner, sTag) < nNumToAdd)
    {
    //my idea was to add items one by one due to stack issues
    //im guessing giving the difference between GetItemStackSize OR UT_CountItemInInventory and nNumToAdd to a variable could work
    for(nCount = 0; UT_CountItemInInventory(rItem, oInvOwner, sTag) nNumToAdd)
    {
    for(nCount = 0; UT_CountItemInInventory(rItem, oInvOwner, sTag) > nNumToAdd; nCount++)
    {
    UT_RemoveItemFromInventory(rItem, 1, oInvOwner);
    }
    }

    }

  1. November 11, 2009 at 5:00 pm
  2. November 15, 2009 at 9:47 pm
  3. April 25, 2010 at 4:34 pm
  4. April 7, 2011 at 1:54 am
  5. April 7, 2011 at 2:12 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: