Forum rules - please read before posting.

placing duplicate characters in scene

I want to place 3 or 4 characters in scene (the same one) When I do an Object:Add-> my Character it creates a Constant ID and when I try the secon Object:Add for the same character it says "it is already in the scene"
How can I change the Constant ID ? or is there a way to place say, 3 identical Tin Pots in the scene?

Comments

  • I'm guessing it's for player switching?  Like you have one active player and then you go up to one of the other players and interact with them and then take control over them?  

    I'm doing similar to that.  What I do is make NPC versions of each of the players and when you want to take control you use the "Player: Switch" action and just replace the NPC with the Player version.
  • Sorry not what I need. I want to 'spawn' several NPC's so that they then do a NPC:follow the player action.
    To make my question simpler:
    If I do: 
    Object:Add o rRemove
    Add
    SkeletonPrefab

    and I follow this with again the same
    Object:Add o rRemove
    Add
    SkeletonPrefab

    It just places one skeletonPrefab and shows an warning saying "skeleton Prefab won't be instantiated because it is already present in scene"

    It says that because the Constant ID is the same so my question is how can I change the Constant ID in each instantiation 
  • AC uses Constant ID numbers to keep track of assets and objects between scenes.  You can't use the Object: Add or remove Action to add the same object twice, because AC will never know which object you're referring to later on in the scene.

    Changing the ID number mid-game is possible (just modifiy it's "constantID" integer in it's script - see this page), but that'll mean that any Actions that previously referenced this prefab will no longer be "linked" to it.

    The better way to get around this would be to either having your skeletons already in the scene, and hidden away until needed, or to duplicate the prefabs in your Asset folders and give them all separate ConstantID numbers in the Project window.
  • Not an elegant solution but it works for 2 or 3 skeletons. It's clumsy for a dozen or more however
    I made some parameters and now it looks better.
    Well, I have achieved what I wanted: spawning enemies and following the player who then takes refuge behind a trigger (stop NPC following) and all this WITHOUT scripts.
    Thank you for your tip Chris




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.