Announcement

Collapse
No announcement yet.

Networking

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

    Networking

    So I've been watching the blueprint networking vids put out by epic and it occurred to me that I would like to know how to make a pick up that adds to the players bomb inventory after depleted. I know how to make a pick up, I just cant seem to figure out how to make it add to the bomb count and allow the player to throw more bombs. Any suggestions?

    #2
    Originally posted by DevilDogVIKING View Post
    So I've been watching the blueprint networking vids put out by epic and it occurred to me that I would like to know how to make a pick up that adds to the players bomb inventory after depleted. I know how to make a pick up, I just cant seem to figure out how to make it add to the bomb count and allow the player to throw more bombs. Any suggestions?
    Create a new actor blueprint add the model and collision of the object. Than you're going to want to add a server check if the players actually in the collision box along with the server getting the players ammo. Check it against the max ammo if you made one and add the ammo up to the cap this would be server sided as-well.

    It'd look something like this on the blueprint in the event graph for it;

    Overlapping Characters > Check Character is ours > Pass onto authority > check players bomb count against max bombs > check if player and model are actually overlapping > add bombs

    Comment


      #3
      any chance you could post a screen shot of a blueprint example of what you explained here? I'm still new to blueprints and not quite sure what you mean with all the checks you have here.

      Comment


        #4
        Originally posted by DevilDogVIKING View Post
        any chance you could post a screen shot of a blueprint example of what you explained here? I'm still new to blueprints and not quite sure what you mean with all the checks you have here.
        If you watched the network tutorials you'll know how the switch works so something like this but in blueprints (worst C++ ever)
        Code:
        if ammoModel.overlap == true && actor == myCharacter.overlap){
        switchHasAuthority(); // W.E the call is
            if (thereCharacter.ammoCount => maxAmmoCount || ammoModel.overlap != thereCharacter.overlap ){
                GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "Ammo is greater than max allowed");
            else{
                thereCharacter.ammoCount += ammoPerPick
                destroy(ammoModel):
            }
        }
        That won't work but you'll get the basic logic of how to do that in a blueprint

        Comment


          #5
          I should've mentioned I'm not a programmer either lol but I do get the idea. I'll play around with it and get it to work. When I do I'll update with a screenshot just incase someone else has this question. Thanks SOTO!

          Comment


            #6
            Well, what I came up with works but it's probably not the best way to do it if there's going to be any multiplayer action. I just made sure the blueprint for the pick up had a certain tag and did a check for it.

            Click image for larger version

Name:	Bomb_PickUp_BP.PNG
Views:	1
Size:	96.9 KB
ID:	1053721

            Comment

            Working...
            X