As the title says. I know very little of the toolset and would like to know how to import my own custom items into my official campaign. OR is it too hard for someone with little experience to mess with?
I would like some help making weapons, armor, and items to import into my main campaign.
Débuté par
Xeoneex
, mars 12 2010 07:29
#1
Posté 12 mars 2010 - 07:29
#2
Posté 12 mars 2010 - 01:46
hey,
Me too know very little oft this whole ToolSet-stuff, but i stumbled over this guide...maybe it will help you:
social.bioware.com/5339/blog/576/
Me too know very little oft this whole ToolSet-stuff, but i stumbled over this guide...maybe it will help you:
social.bioware.com/5339/blog/576/
#3
Posté 13 mars 2010 - 07:49
Thanks, its a tad confusing but I might be able to work it out. Again thank you!
#4
Posté 13 mars 2010 - 10:37
well I followed it the best I could and it doesnt work :/ dont know what I did wrong.
#5
Posté 14 mars 2010 - 12:16
well I put in the script with modifying the item names given to the item names I created, the module shows up in the DLC section in the main menu but the items do NOT appear in my inventory. If someone could assist me, I will post the script used:
// 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, "my_custom_light_leather");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_glv");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_hlm");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_longbow");
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, "my_custom_light_leather");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_bts");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_glv");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_hlm");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_longbow");
// 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"my_custom_light_leather.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_bts.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_glv.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_hlm.uti",1);
UT_AddItemToInventory(R"my_custom_longbow.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, "my_custom_light_leather", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_glv", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_hlm", 1);
SetLocalInt(OBJECT_SELF, "my_custom_longbow", 1);
break;
}
default:
{
break;
}
}
}
this script was based off a different website, I used the one from the post in this thread and neither worked.
// 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, "my_custom_light_leather");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_glv");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_hlm");
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_longbow");
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, "my_custom_light_leather");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_bts");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_glv");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_light_leather_hlm");
int iItemCount = CountItemsByTag(oPlayer, "my_custom_longbow");
// 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"my_custom_light_leather.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_bts.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_glv.uti",1);
UT_AddItemToInventory(R"my_custom_light_leather_hlm.uti",1);
UT_AddItemToInventory(R"my_custom_longbow.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, "my_custom_light_leather", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_glv", 1);
SetLocalInt(OBJECT_SELF, "my_custom_light_leather_hlm", 1);
SetLocalInt(OBJECT_SELF, "my_custom_longbow", 1);
break;
}
default:
{
break;
}
}
}
this script was based off a different website, I used the one from the post in this thread and neither worked.
#6
Posté 14 mars 2010 - 12:34
I don't know if this will help, but I have used this form to do it; also, did you apply the 1.03 patch to your game? It may be causing this to not work properly.
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, "wd_set");
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, "wd_armor");
int iItemCount2 = CountItemsByTag(oPlayer, "wd_boots");
int iItemCount3 = CountItemsByTag(oPlayer, "wd_gloves");
int iItemCount4 = CountItemsByTag(oPlayer, "wd_shield");
int iItemCount5 = CountItemsByTag(oPlayer, "wd_sword");
// 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"wd_armor.uti",1);
if (iItemCount2 == 0)
UT_AddItemToInventory(R"wd_boots.uti",1);
if (iItemCount3 == 0)
UT_AddItemToInventory(R"wd_gloves.uti",1);
if (iItemCount4 == 0)
UT_AddItemToInventory(R"wd_shield.uti",1);
if (iItemCount5 == 0)
UT_AddItemToInventory(R"wd_sword.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, "wd_set", 1);
break;
}
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, "wd_set");
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, "wd_armor");
int iItemCount2 = CountItemsByTag(oPlayer, "wd_boots");
int iItemCount3 = CountItemsByTag(oPlayer, "wd_gloves");
int iItemCount4 = CountItemsByTag(oPlayer, "wd_shield");
int iItemCount5 = CountItemsByTag(oPlayer, "wd_sword");
// 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"wd_armor.uti",1);
if (iItemCount2 == 0)
UT_AddItemToInventory(R"wd_boots.uti",1);
if (iItemCount3 == 0)
UT_AddItemToInventory(R"wd_gloves.uti",1);
if (iItemCount4 == 0)
UT_AddItemToInventory(R"wd_shield.uti",1);
if (iItemCount5 == 0)
UT_AddItemToInventory(R"wd_sword.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, "wd_set", 1);
break;
}
#7
Posté 14 mars 2010 - 02:31
Ya I patched to 1.03. Why does it cuase modules not to load properly?
#8
Posté 20 mars 2010 - 12:53
ok well I'm getting a
my_event_handler.nss - my_event_handler.nss(47): Variable already used within scope (while compiling var_constants_h.nss)
everytime I try to compile. I don't know what that is.
my_event_handler.nss - my_event_handler.nss(47): Variable already used within scope (while compiling var_constants_h.nss)
everytime I try to compile. I don't know what that is.
#9
Posté 20 mars 2010 - 12:54
if the (47) they are refering to is line 47 then
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts"); is the one but I dont know what it is. any help is greatly appreciated.
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "my_custom_light_leather_bts"); is the one but I dont know what it is. any help is greatly appreciated.
#10
Posté 20 mars 2010 - 06:27
You cannot declare a variable multiple times within a scope - which is what you are doing by declaring iModuleLoaded every time. You are doing the same with ItemCount too.
Just take the code LadyD has given above, replace the item tags with yours and it should work. After that, you can compare them to see what you are missing (or having too much of!)
Just take the code LadyD has given above, replace the item tags with yours and it should work. After that, you can compare them to see what you are missing (or having too much of!)
Modifié par TimelordDC, 20 mars 2010 - 06:28 .
#11
Posté 20 mars 2010 - 10:56
well it still gave the same error with her script also something that i dont know is
her items are posted but then she has this line
SetLocalInt(OBJECT_SELF, "wd_set", 1);
What is the wd_set refering to? those aren't the actual UTI files thats a seperate thing what do I put there instead?
her items are posted but then she has this line
SetLocalInt(OBJECT_SELF, "wd_set", 1);
What is the wd_set refering to? those aren't the actual UTI files thats a seperate thing what do I put there instead?





Retour en haut






