Aller au contenu

Photo

How do I add an item to a container?


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

#1
Trogdorx

Trogdorx
  • Members
  • 478 messages
So I just made a new weapon, and I want to get it into the hands of a brand new character as soon as possible. So I'm thinking there's two obvious ways to do this, either a) have it be automatically thrown into the inventory as soon as the game starts or B) put it in a chest I can get to at the beginning of the game.

Problem is I have no idea how do do either of those. At first I figured I would be able to just find one of the crates in the toolset and edit its inventory, as there are many chests that always have the same things in them (like the chest you can find the Family Sword in during the human noble story) So I found the Family sword and it says, in its comments field, "Available from bhn200ip_chest_family." So I figured all I had to do then was find a chest by that name and I'd be able to add this new sword's ID to its loot list. Well, that's apparently not the case, and I can't find that, or any specific static-inventory chest anywhere in the toolkit.

So what's the deal here?

#2
sillyrobot

sillyrobot
  • Members
  • 171 messages
CreateItemOnObejct(*item resource*,GetHero())

*edit the form does not like greater than and less than sign as test wrappers.  I've used asterisks instead.

Modifié par sillyrobot, 04 décembre 2009 - 01:29 .


#3
Trogdorx

Trogdorx
  • Members
  • 478 messages
Um thanks for that but..could you maybe elaborate a little more? Where does that line go? I assume item resource means the Resource Name? And then GetHero( ) is the target for this method? So basically it'll put a copy of an item into the player's inventory?

#4
Vizkos

Vizkos
  • Members
  • 366 messages
I believe he means.



CreateItemOnObejct(*item resource*,*location to give*)



I don't know how to add to containers either, so I eagerly await an elaboration too :)

#5
Trogdorx

Trogdorx
  • Members
  • 478 messages
I also have some questions about item properties.



In the XLS file that defines the properties, many of them say they are not implemented. Yet, they are used ingame: Messy Kills is one of them. Supposedly it creates a lot of gore when you kill things, and it's used by the greatsword Ageless. But the xls file says it's not implemented.



Weirder yet, I have seen effects that look like the "excessive gore" but I haven't been using any weapons that have the messy kills attribute, and it only happens once in a blue moon. What gives?



Then again I guess I shouldn't be surprised, what with all the other bugs this game has.

#6
J.O.G

J.O.G
  • Members
  • 355 messages
Have a look here:
http://dragonagemodd...rs-camp-part-1/

and here:
http://dragonagemodd...player-an-item/

And combine. You can either use an event script that checks if the second Area of the noble's origin story is loaded and then put the item in the chest, or you can create a PRCSCR file that starts the script to add the item when that area is loaded.

Adding the item itself is simple, once the script runs:

CreateItemOnObject(R"your_items_file_name.uti",GetObjectByTag("bhn200ip_chest_family"));

Modifié par J.O.G, 04 décembre 2009 - 03:07 .


#7
Vizkos

Vizkos
  • Members
  • 366 messages

J.O.G wrote...

Have a look here:
http://dragonagemodd...rs-camp-part-1/

and here:
http://dragonagemodd...player-an-item/

And combine. You can either use an event script that checks if the second Area of the noble's origin story is loaded and then put the item in the chest, or you can create a PRCSCR file that starts the script to add the item when that area is loaded.

Adding the item itself is simple, once the script runs:

CreateItemOnObject(R"your_items_file_name.uti",GetObjectByTag("bhn200ip_chest_family"));


That tutorial to give the player an item isn't very good in my opinion, plus the script in that one means that if you put the item on a companion, it will give you another one whenever you load.  I found this tutorial to be much better:
http://social.biowar.../5339/blog/576/

Modifié par Prosthetics511, 04 décembre 2009 - 03:12 .


#8
sillyrobot

sillyrobot
  • Members
  • 171 messages

Prosthetics511 wrote...

I believe he means.

CreateItemOnObejct(*item resource*,*location to give*)

I don't know how to add to containers either, so I eagerly await an elaboration too :)


I did indeed.  I had to run out the door and wanted to give some form of answer.

Mechanically, the function I provided will place an item as defined by a resource name into an object's inventory.  I wasn't sure if the question was specifcally what the function to use was or if the OP didn't know the basic process.

 The toolset wiki can provide more information regarding the function. 

There are several forum threads and tutorials with a lot more detail than a quick forum post can provide.  I think the wiki also has a tutorial that covers the subject.

#9
Trogdorx

Trogdorx
  • Members
  • 478 messages
The link Prosthetics gave was very helpful, thanks.