Copy Object

Moderator: Event DM

Post Reply
User avatar
Jeffi0
Apprentice Scholar
Posts: 567
Joined: Fri Apr 04, 2003 12:57 am

Copy Object

Post by Jeffi0 » Thu Aug 21, 2003 5:37 pm

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?
User avatar
Neve
Prince of Bloated Discourse
Posts: 192
Joined: Mon Apr 14, 2003 4:09 pm
Location: The Netherlands
Contact:

Post by Neve » Thu Aug 21, 2003 6:01 pm

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 ?)
- 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.
User avatar
Jeffi0
Apprentice Scholar
Posts: 567
Joined: Fri Apr 04, 2003 12:57 am

Post by Jeffi0 » Thu Aug 21, 2003 6:16 pm

Oops, I thought this was the scripting forum. Misclick. :shock:

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. :(
User avatar
Jeff
Knight of Useless Drivel
Posts: 66
Joined: Thu Oct 31, 2002 4:21 am
Location: http://www.legendofvalinor.com
Contact:

Post by Jeff » Thu Aug 21, 2003 6:19 pm

Can we see the code in question?
User avatar
Neve
Prince of Bloated Discourse
Posts: 192
Joined: Mon Apr 14, 2003 4:09 pm
Location: The Netherlands
Contact:

Post by Neve » Thu Aug 21, 2003 7:03 pm

Jeffi0 wrote:Oops, I thought this was the scripting forum. Misclick. :shock:

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. :(
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...

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.
Post Reply