Announcement

Collapse
No announcement yet.

Is is possible to have Actors from a level that has been unloaded

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is is possible to have Actors from a level that has been unloaded

    The actors are inventory items like weapons, armor, medkits ....

    I am currently attaching (to the pawn) and hiding all picked up actors and only showing the equipped ones , but when I unload a level the actors that were picked up in that level disappear with it .

    Is it possible to keep them without making them part of the persistent level?


    What i need is :
    A: (best option) change the actors "level" to become persistent on pick up .

    B: Destroy actor on pickup and spawn the same in the persistent level. ( I tried to do that but it didn't work (crashes the editor) if you know how tell me )


    Thanks a ton!
    Last edited by Midnight640; 04-21-2014, 09:31 AM.
    TA on :
    Assassins Creed Origins
    Assassins Creed Origins: Curse of the Pharaohs
    The Division 2

    #2
    This is bad nobody knows ... I hope someone from epic sees this and maybe sheds some light into this problem.
    TA on :
    Assassins Creed Origins
    Assassins Creed Origins: Curse of the Pharaohs
    The Division 2

    Comment


      #3
      Originally posted by Midnight640 View Post
      The actors are inventory items like weapons, armor, medkits ....

      I am currently attaching (to the pawn) and hiding all picked up actors and only showing the equipped ones , but when I unload a level the actors that were picked up in that level disappear with it .

      Is it possible to keep them without making them part of the persistent level?


      What i need is :
      A: (best option) change the actors "level" to become persistent on pick up .

      B: Destroy actor on pickup and spawn the same in the persistent level. ( I tried to do that but it didn't work (crashes the editor) if you know how tell me )


      Thanks a ton!
      IMO you are doing it wrong.
      Actor which represents pickup in the level and a picked up item is 2 different things.
      Item is an asset (BP or whatever), pickup item in the level is an actor that has property which points to an item asset class. When character picks item up you shouldn't not transfer actor to character, just pass him item asset class, so character can make an instance of that class.

      Comment


        #4
        I see ... and how do I " just pass him item asset class, so character can make an instance of that class " .

        What I mean is, when I make a spawn actor from class and make a class array to hold all my objects then I pick an object from the array and and feed it to the spawn actor from class (in my pawn) the game crashes.

        SO ,If I want to have 20 items should I have 20 vars which will clutter the code a lot .

        Edit: I fixed the crash the spawn actor was causing and I can use array of classes (it needed a doOnce after the overlap event)

        Ok I "fixed" the problem what i do is spawn the Item on the place of the spawner and it is automatically spawned in the persistent level and I can take it in other levels.


        BUT I do want to know how the pros do it ( aka borderlands) .

        (very confusing explanations ahead sorry )

        So each weapon is a Code that the player can access only after they have picked up the weapon's spawner , after that the spawner is destroyed and the code is unlocked . When you drop the weapon the code is blocked again and it the game creates a new spawner that represents this weapon. The only question I have is Where is the weapons CODE located?
        I am sure it is not in the pawn. So if you are working with BP should you make and actor or what .
        Last edited by Midnight640; 04-22-2014, 03:52 AM.
        TA on :
        Assassins Creed Origins
        Assassins Creed Origins: Curse of the Pharaohs
        The Division 2

        Comment


          #5
          yes, The weapon code it is within weapon BP, the pawn only "fire" the event. On this way each weapon can be very diferent.

          Comment


            #6
            cool thanks man ,

            SO I made a little update instead of triggering the spawner with an overlap event , I trigger it with begin play. Because it spawns the weapon I don't have to get only the weapon mesh to represent it (so the player knows what he is picking up).
            This way the spawner can be in any sublevel but when the game started they all spawn the weapons in the persistent level.
            The only problem is that if you "break out " of the level you will see weapons just hanging in the space where the other level used to be but i don't think this is a big problem.
            TA on :
            Assassins Creed Origins
            Assassins Creed Origins: Curse of the Pharaohs
            The Division 2

            Comment


              #7
              One problem i cant think of right away is that if your levels are supposed to be large, or there are numerous pickups,
              it sounds like you're spawning a couple of hundred meshes on level load.

              I cant imagine this would be good for performance.

              Comment


                #8
                well, each item can have a trigger to hide the meshs and any animation or effects while the player is not close.

                Comment


                  #9
                  Tucarius Actually the opposite, my levels are small and a lot , I load and unload them often and I wont have that many items (just not working for my game genre ).

                  BUT you are right . It can't be good, one thing I that can be done is to put a delay on different classes (say weapons have the first 5 seconds after the "levelload" to be loaded and medkits and etc are after that ) This method has worked for me since UDK and I think its good but tell me what is your idea.

                  I was thinking of making the spanwer work only if the player is in a certain range.
                  TA on :
                  Assassins Creed Origins
                  Assassins Creed Origins: Curse of the Pharaohs
                  The Division 2

                  Comment

                  Working...
                  X