Announcement

Collapse
No announcement yet.

What persists in a game?

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

    What persists in a game?

    I'm having a real tough time here. I'm understanding blueprints quite well. I can create complex functions etc but I'm having a real tough time figuring out what states/blueprints seem to persist server travels and are central to everyone.

    Here's the basic scenario. This will change later, but for testing on a full build I need this basic flow to work.

    Launch Game > Connect Screen (start game or connect via IP > Char Select Screen > Wait for x amount of players to join > start 15 sec count down > server travel to opening map

    Everything works except when the game starts the chosen characters are always 0 which is the same char for all players.
    When the character is selected I've tried saving it on the Player State, Game State, Game instance, player controller, but no matter what when the server travel happens, all of those variables get wiped before the spawn. I tried enabling seamless server travel. When the final level loads though the character select screen stays up. The spawns never happen.

    I was thinking maybe to store the chosen character number in the GameMode, since it seems to be the only thing that persists, but then I don't know how to assign the players choice to a player number so that when they join the game that player number is then set back onto the player controller or something and can get the char num from that, I cant just give it a random number from 1- whatever, because I dont know what order the players are joining in each time obviously. So basically, where can I set a character specific variable, that carries into the start of the match?
    Snap-In Systems: <<< CLICK
    | Inventory (Battle Royale) |Smart Select Box | Ready Game Modes | Handy Macros | Gun Weapon System |Simple Mesh Outliner |

    #2
    Have you tried game instance? https://wiki.unrealengine.com/Game_I...t_Data_Storage

    Comment


      #3
      yea I tried game instance. It sorta works. Like I can tell from the look the character is the right one.

      But the issue in this case is that animation replication seems broken now. If I set the char type directly in the custom player controller in testing and bypass the char select screen and connection process it works.
      Is there some special sort of replication needed for gameinstance to properly replicate to all? Other than the variable being replicated?

      EDIT: nvm, needed to run a few things with server/mc events. Got it workin. thx!
      Last edited by thankstipscom; 12-23-2015, 02:05 PM.
      Snap-In Systems: <<< CLICK
      | Inventory (Battle Royale) |Smart Select Box | Ready Game Modes | Handy Macros | Gun Weapon System |Simple Mesh Outliner |

      Comment

      Working...
      X