Jump to content

Script to add multiple custom items at once?


Draco856

Recommended Posts

Okay, well, as the title says, I need a script that can handle many custom items all at once. At this point, I've found myself having to create several modules to house the different scripts for all the items I've made, and it's getting a bit cluttered. Not to mention that for some odd reason, my items never update properly unless I delete them or empty the export directories, and then re-export everything and when you have about 20 different custom modules, the exporting can get a bit lengthy.
Link to comment
Share on other sites

Okay, well, as the title says, I need a script that can handle many custom items all at once. At this point, I've found myself having to create several modules to house the different scripts for all the items I've made, and it's getting a bit cluttered. Not to mention that for some odd reason, my items never update properly unless I delete them or empty the export directories, and then re-export everything and when you have about 20 different custom modules, the exporting can get a bit lengthy.

 

you could use my Mod to add the items: (no coding/module needed at all - just a M2DA-File)

 

http://www.dragonagenexus.com/downloads/file.php?id=135

 

as for the not updating part: any item ingame has no connection to its ressource --> if you change any item that you allready have ingame it won't affect it as it's just a (serialized) copy of the original ressouce it was created from.

Link to comment
Share on other sites

Here is the script I use.

Where the names in quotes are the items I've added.

// All module events

// Original Script:John Vanderbeck

// Modified by: Tyler Pigott

#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:

{

// get the object which contains the player

object oPlayer = GetHero();

//check if player has item and if not add item

object addedItem = GetObjectByTag("tp_amulet_of_the_war_mage");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_amulet_of_the_war_mage.uti",1);

addedItem = GetObjectByTag("tp_band_of_fire");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_band_of_fire.uti",1);

addedItem = GetObjectByTag("tp_bergens_honor");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_bergens_honor.uti",1);

addedItem = GetObjectByTag("tp_blood_dragon_armor");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_blood_dragon_armor.uti",1);

addedItem = GetObjectByTag("tp_blood_dragon_boots");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_blood_dragon_boots.uti",1);

addedItem = GetObjectByTag("tp_blood_dragon_gloves");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_blood_dragon_gloves.uti",1);

addedItem = GetObjectByTag("tp_blood_dragon_helm");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_blood_dragon_helm.uti",1);

addedItem = GetObjectByTag("tp_dalish_promise_ring");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_dalish_promise_ring.uti",1);

addedItem = GetObjectByTag("tp_embris_many_pockets");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_embris_many_pockets.uti",1);

addedItem = GetObjectByTag("tp_feral_wolf_charm");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_feral_wolf_charm.uti",1);

addedItem = GetObjectByTag("tp_final_reason");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_final_reason.uti",1);

addedItem = GetObjectByTag("tp_grimoire_of_frozen_waste");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_grimoire_of_frozen_waste.uti",1);

addedItem = GetObjectByTag("tp_guildmasters_belt");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_guildmasters_belt.uti",1);

addedItem = GetObjectByTag("tp_helm_of_the_deep");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_helm_of_the_deep.uti",1);

addedItem = GetObjectByTag("tp_lucky_stone");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_lucky_stone.uti",1);

addedItem = GetObjectByTag("tp_memory_band");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_memory_band.uti",1);

addedItem = GetObjectByTag("tp_the_edge");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_the_edge.uti",1);

addedItem = GetObjectByTag("tp_the_lions_paw");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_the_lions_paw.uti",1);

addedItem = GetObjectByTag("tp_wicked_oath");

if(!IsObjectValid(addedItem))

UT_AddItemToInventory(R"tp_wicked_oath.uti",1);

break;

}

default:

{

break;

}

}

}

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...