
Copy Object
Moderator: Event DM
Copy Object
Seems only to work once. I have an object, and when a conversation is started with a certain NPC that object is copied into the PC's inventory. However, once the PC completes the quest and the copied item in the PC's inventory is destroyed, the PC cannot get the item again. The conversation and the rest of the script goes as normal, but the object doesn't copy into the PC's inventory.
Is there something about CopyObject that I don't know about?

- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
Try CreateObject and DestroyObject instead. If you use the object only to check wether a quest is being done, you should check the function GetLocalInt and SetLocalInt. That way you don't add junk into the inventory, but use imaginary numbers 
(Doesn't this thread belong in the Scripting forum though ?)

(Doesn't this thread belong in the Scripting forum though ?)
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
Oops, I thought this was the scripting forum. Misclick.
I can't use CreateObject & DestoryObject because that doesnt get it into the PC's inventory, I'd have to do another CopyObject anyway. I could do that, but I think I tried it and found a reason that I couldn't do it, which I can't remember right now. I'll try it again. I'd like to use CreateItemOnObject, but that doesn't let you change the tag of the new object, which I need to do.

I can't use CreateObject & DestoryObject because that doesnt get it into the PC's inventory, I'd have to do another CopyObject anyway. I could do that, but I think I tried it and found a reason that I couldn't do it, which I can't remember right now. I'll try it again. I'd like to use CreateItemOnObject, but that doesn't let you change the tag of the new object, which I need to do.

- Jeff
- Knight of Useless Drivel
- Posts: 66
- Joined: Thu Oct 31, 2002 4:21 am
- Location: http://www.legendofvalinor.com
- Contact:
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
Hmm... If the new object is only temporary you can give it a Local Int. Localints are as easy to check as Tags, I'm not sure wether it's possible to change an object's tag...Jeffi0 wrote:Oops, I thought this was the scripting forum. Misclick.![]()
I can't use CreateObject & DestoryObject because that doesnt get it into the PC's inventory, I'd have to do another CopyObject anyway. I could do that, but I think I tried it and found a reason that I couldn't do it, which I can't remember right now. I'll try it again. I'd like to use CreateItemOnObject, but that doesn't let you change the tag of the new object, which I need to do.
object oItem = GetItemPosessedBy(oPlayer, "ItemTag");
//To create a "Tag"
SetLocalInt(oItem, "TempTag", <Put value here>);
//To read a "Tag"
GetLocalInt(oItem, "TempTag");
You can search for the object with that temporary tag aswell :
object FindItem(oPlayer){
oItem = GetFirstItemInInventory(oPlayer);
while(oItem != OBJECT_INVALID){
if(GetTag(oItem, "TempTag")) return oItem
oItem = GetNextItemInInventory(oPlayer);
}
return OBJECT_INVALID;
}
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.