Aller au contenu

Photo

Need help adding multiple items to character's inventory


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Raanz

Raanz
  • Members
  • 1 410 messages
Hey all

Just started messing around with the toolset.  I am starting small, just trying to mod a couple of weapons and add them to my character.

I have been semi-successful.  Weapons modded, "module" with items and script complied and built(no errors in the log).  It shows up in my download content within the game  BUT  only one item gets added to my inventory.

I am using the sample script from
http://dragonagemodd...efore-spawning/

If I change the order in the script of checking for a valid object, then first one listed gets added but the second doesn't.
If anyone feels gracious enough to point me in a direction to fix this I would be most grateful.
I didn't know if posting script is allowed here so if anyone wants to take a look, I can send it, or PM it or something.

Thanks for reading.

#2
Proleric

Proleric
  • Members
  • 2 360 messages
Script posting is allowed here, so feel free.

Ensure that your items have different tags.

Consider whether you need GetObjectByTag or GetItemPossessedBy. The former will find the item anywhere in the area list (e.g. in an NPC or follower inventory) whereas the latter will only find the item on the target creature.

#3
Raanz

Raanz
  • Members
  • 1 410 messages

Proleric1 wrote...

Script posting is allowed here, so feel free.

Ensure that your items have different tags.

Consider whether you need GetObjectByTag or GetItemPossessedBy. The former will find the item anywhere in the area list (e.g. in an NPC or follower inventory) whereas the latter will only find the item on the target creature.


Hmm I see.  I am using the GetObjectByTag

object oGSword = GetObjectByTag("ranz_greatsword");
object oLSword = GetObjectByTag("ranz_longsword");

if (!IsObjectValid(oGSword))
    UT_AddItemToInventory(R"ranz_greatsword.uti",1);

if (!IsObjectValid(oLSword))
    UT_AddItemToInventory(R"ranz_longsword.uti",1);

That's the meat of it, minus the normal syntax (brackets and the break, etc)
See anything obvioulsy messed up there?

Thanks for the reply.

#4
Proleric

Proleric
  • Members
  • 2 360 messages
That should work, unless an object with that tag already exists somewhere in the area list. Perhaps you put one in a container, for test purposes, or something like that?

#5
Proleric

Proleric
  • Members
  • 2 360 messages
P.S. worth checking that both item resources have been exported, and that there isn't a typo in either of the resource names.