Skip to content

Copy Object

I've copied oPC and now I want it to turn hostile but can't seem to assign a tag to it. Any help would be cool. :smiley:
void main()
{
    object oPC = GetLastUsedBy();
    if (!GetIsPC(oPC)) return;

    location lLoc;
    lLoc = GetLocation(oPC);
    CopyObject(oPC, lLoc, oPC);
}

Comments

  • ProlericProleric Member Posts: 1,281
    edited April 2022
    https://nwnlexicon.com/index.php?title=CopyObject

    You can set the tag of the new object with the 4th parameter.

    The function returns the new object, too, so you don't necessarily need to refer to it by tag.

    The third parameter should be OBJECT_INVALID, as you're not creating an inventory item.
    object oClone = CopyObject(oPC, lLoc, OBJECT_INVALID, "CloneTag");
    
  • ZephiriusZephirius Member Posts: 411
    Thanks Proleric. Got it now.
Sign In or Register to comment.