Announcement

Collapse
No announcement yet.

Help with populating a players inventory upon spawn

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

    Help with populating a players inventory upon spawn

    I have the following the Event Graph of the ShooterGameMode blue print in /PrimalEarth/CoreBlueprints.

    I'm basically just trying to spawn my character with a flare gun in it's inventory for testing purposes. But this isn't working.

    What am I doing wrong?



    Thanks!

    #2
    You need to do the bind in another event (like Event Begin Play). The way you have it now, the event is wired to bind itself (o_O), but nothing is triggering the event in the first place so it never actually gets bound or run.

    Comment


      #3
      Event Begin Play -> Add New Item. You will have to turn off "Context Sensitive" to see the "Add New Item" function.

      Comment


        #4
        Thanks for your replies. I have turned off context sensitive but I don't see a Begin Play event. I see an end play event though, heh.

        Comment


          #5
          In case anyone finds this thread in the future, here is what I found.

          https://forums.unrealengine.com/show...ers-spawn-with

          That thread was very very helpful!

          Comment


            #6

            Comment


              #7
              Ok, I got it to work. I'm not sure if this is the most elegant way to do it, but it works!

              Thanks to everyone for their help up to this point.

              Edit: OK this works greats on a players first spawn into the game, but it doesn't load anything into their inventory when they die and respawn. I'm assuming that's because 'Begin Play' only gets called when the player first loads into the map. Thoughts on catching a respawn event?

              Last edited by Tuskony; 10-31-2015, 06:29 PM.

              Comment


                #8
                Ok since you're using the graph in the Game Mode, I would do this:

                Click image for larger version

Name:	2lw0zld.jpg
Views:	1
Size:	189.7 KB
ID:	1092357

                To see some of those functions you have to check "Context Sensitive" for others you have to uncheck it.


                EDIT:
                Or the way you did it is fine :P.

                Comment


                  #9
                  Thanks for that detailed response! Check my edit on my above post. This all works great but not when a player respawns.

                  I like your method though because it seems like it would work well if there were "rounds" in my game and I loaded up every player at once before the round began.

                  Comment


                    #10
                    For example when I do this... just to see if I can even show a message everytime I spawn...



                    I only see the "Spawned" message once and that's after the first time I spawn, not on respawn.

                    Comment


                      #11
                      You would need to figure out what event or variable/whatever gets set or activated when the player respawns. That is when/where you would add the item into the player's inventory.
                      IDK how to check if a player respawned yet, I haven't got there yet with my mod. :P

                      Comment


                        #12
                        Originally posted by dodgeThis View Post
                        You would need to figure out what event or variable/whatever gets set or activated when the player respawns. That is when/where you would add the item into the player's inventory.
                        IDK how to check if a player respawned yet, I haven't got there yet with my mod. :P
                        I was worried I might have to hack something in. Time to brain storm heh

                        Comment

                        Working...
                        X