Announcement

Collapse
No announcement yet.

What should I do with holstered weapons, items and other class instances with no world location?

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

    What should I do with holstered weapons, items and other class instances with no world location?

    Hey,

    I'm working on my inventory system, and I've been trying to work out what is the conventional way to handle things like weapons once they are holstered?

    I don't want to destroy them because I want to keep the custom materials and scope that the player may have applied to them, strictly using the purple class "prototype" (if I may use a JavaScript term) has other issues too. So I do want to work via blue reference to a class.
    Play my games @ itch.io! :: http://dazpetty.itch.io/

    WWW.DAZPETTY.COM
    3D Artist, Level-Designer, Blueprints'er.

    #2
    If they dont have collision in and of themselves, just hide the Actor ingame till your need it again.

    Either that or you could designate a safe location outside the map (or even under it) where you transport all your unused weapons when they are holstered.

    Think outside the box, there are plenty of options.
    Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

    Comment


      #3
      yeah I thought about that.

      It just seems dirty.

      I want to put things away in nice little boxes that feel obey convention.
      Play my games @ itch.io! :: http://dazpetty.itch.io/

      WWW.DAZPETTY.COM
      3D Artist, Level-Designer, Blueprints'er.

      Comment


        #4
        Originally posted by Neurocase View Post
        yeah I thought about that.

        It just seems dirty.

        I want to put things away in nice little boxes that feel obey convention.
        "Convention" can be a very strange and abstract thing in game development :P

        Quick and dirty can sometimes be the most lite weight and effective means of achieving something.

        Ive used the method above before with a pooled AI system, instead of destroying the AI when they died, i just moved their location somewhere out of sight until i needed another one again and i just reset its properties when it "respawned". It reduced the performance overhead of having to spawn an new AI Actor in the world considerably since there were alot of AI units and they would usually die fairly quickly and need to respawn again soon as well.
        Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

        Comment


          #5
          Why don't you just make the object invisible and disable its collision?

          Cycle through the attached components and disable their collision, same for the mesh.
          Last edited by Horus; 11-30-2015, 06:24 PM.
          [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

          Looking for fellow programmers to develop a project.

          Comment


            #6
            Fair call guys, I had thought about this, I was worried that "somewhere" it would be updating the location of this object and sending it's new location via network traffic.

            In this case I see no reason for it to ever exist any where once it is picked up by a player, it'll just be something the player contacts to receive it's related variables, like ammo and appropriate skeletal mesh. I'll just make sure it is destroyed when it is no longer needed, like when the player dies.
            Play my games @ itch.io! :: http://dazpetty.itch.io/

            WWW.DAZPETTY.COM
            3D Artist, Level-Designer, Blueprints'er.

            Comment


              #7
              Ahh this is starting to get quite heavy, I mean I also need the playercharacter to disappear when they use a vehicle, maybe I need some sort of "sleep" function
              Play my games @ itch.io! :: http://dazpetty.itch.io/

              WWW.DAZPETTY.COM
              3D Artist, Level-Designer, Blueprints'er.

              Comment

              Working...
              X