Bioware Archive
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
SMF - Just Installed!
Home
Help
Login
Register
Bioware Archive
»
Bioware Archive V2
»
Builders - Scripting
»
Create item in chest. ** SOLVED **
« previous
next »
Print
Pages: [
1
]
Author
Topic: Create item in chest. ** SOLVED ** (Read 321 times)
Legacy_Supreme_Pizza
Jr. Member
Posts: 90
Karma: +0/-0
Create item in chest. ** SOLVED **
«
on:
January 21, 2013, 08:58:47 am »
I am having issues with creat item.
I want to use the tag as the location. I think you can do that but I can't remember how.
Modifié par Supreme_Pizza, 29 janvier 2013 - 07:45 .
Logged
Legacy_Failed.Bard
Hero Member
Posts: 1409
Karma: +0/-0
Create item in chest. ** SOLVED **
«
Reply #1 on:
January 21, 2013, 11:05:33 am »
It sounds like you'll be wanting to use these two functions:
// Get the nNth object with the specified tag.
// - sTag
// - nNth: the nth object with this tag may be requested
// * Returns OBJECT_INVALID if the object cannot be found.
// Note: The module cannot be retrieved by GetObjectByTag(), use GetModule() instead.
object GetObjectByTag(string sTag, int nNth=0)
// Create an item with the template sItemTemplate in oTarget's inventory.
// - nStackSize: This is the stack size of the item to be created
// - sNewTag: If this string is not empty, it will replace the default tag from the template
// * Return value: The object that has been created. On error, this returns
// OBJECT_INVALID.
// If the item created was merged into an existing stack of similar items,
// the function will return the merged stack object. If the merged stack
// overflowed, the function will return the overflowed stack that was created.
object CreateItemOnObject(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1, string sNewTag="")
Something like:
void main()
{
object oChest = GetObjectByTag ("CHEST_TAG_HERE");
CreateItemOnObject ("item_resref_here", oChest);
}
Logged
Legacy_Supreme_Pizza
Jr. Member
Posts: 90
Karma: +0/-0
Create item in chest. ** SOLVED **
«
Reply #2 on:
January 23, 2013, 12:00:57 am »
Thanks!
'>
Logged
Print
Pages: [
1
]
« previous
next »
Bioware Archive
»
Bioware Archive V2
»
Builders - Scripting
»
Create item in chest. ** SOLVED **