Skip to content

Dealing with CopyObject

I've been remaking an old module of mine and creating a few cutscenes. Most of them depend on having a copy of the PC positioned somewhere and then applying invisibility to the PC so that I can have a free camera. But the bugs in the CopyObject function (related to calling the object's tag) are making it impossible for me to get rid of the copy when the scene is over. Any ideas on a possible workaround?

Comments

  • DazDaz Member Posts: 127
    You can do something like this:
    object oCopy = CopyObject(...);
    SetLocalObject(GetModule(), "COPY_OF_PC", oCopy);
    

    and later you can do:
    object oCopy = GetLocalObject(GetModule(), "COPY_OF_PC");
    DestroyObject(oCopy);
    
  • ProlericProleric Member Posts: 1,316
    When you create the object, if you assign it to a local object variable on (say) the module or the area, you can refer to it unambiguously thereafter, without reference to the tag.

    I see the "tag bug" was recorded in the Lexicon ages ago. I wonder whether it's true, as tag look up is normally very reliable, or whether it's a case of too many objects with the same tag. Be that as it may, the workaround above should suffice.

    Or you could use the Gestalt cutscene package, which takes most of the hard work out of it.
  • gpeddinogpeddino Member Posts: 51
    Thanks you both, that should help.
Sign In or Register to comment.