Announcement

Collapse
No announcement yet.

OpenLevel with options....

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

    OpenLevel with options....

    So if you open a level, and pass it listen, that makes sense... if you pass it listen?game=xxxx ... well, where in blueprints do you get what xxxx is? Or where does this 'game' get set? Or what should XXXX be equal to? the name of your gamemode bp class?

    Not finding any info on this after searching around for quite a while. Best I could find is reference that lists it as game=GameInfo ... which appears to have been replaced with game mode.
    Acclivity Game Studios. Making a BP FPS, Tutorial Series on Blog : On Unreal Wiki : Twitch

    #2
    I can't tell you what the xxxx must be for "game=", but this should be equal to the GameMode class you want
    to use for that map. All options you add (for example ?ServerName=MyServer?NumberOfPlayers=12) can be found
    in the "Option String" in the GameMode. It is a String Variable that is already available if you search for it.
    You can then make an array of strings with the String functions by splitting the string at the "?".
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      Hmm, was unaware of the built in 'options string'. Thanks for that info. I did a print string and it get's the whole string 'listen?game=xxxx' ... unfortunately I am unable to figure out how to set what gamemode I want for the loaded level even if I break that info out and get the XXXX. As each level loads with the 'default' game level. But what if you want to play a map in different modes? The lack of clear documentation is somewhat annoying.
      Acclivity Game Studios. Making a BP FPS, Tutorial Series on Blog : On Unreal Wiki : Twitch

      Comment


        #4
        AH!

        the input to game needs to include the path to the class, and the . with repeat and _C there. That info was buried pages back in my search.

        /Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C

        But to make it easier, you can go to your DefaltGame.ini and add something like this:

        [/Script/Engine.GameMode]
        +GameModeClassAliases=(ShortName="DM",GameClassName="/Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C")

        that creates an alias to the mode so you can just use game=DM in that instance and it loads the proper mode when loading the level.
        Acclivity Game Studios. Making a BP FPS, Tutorial Series on Blog : On Unreal Wiki : Twitch

        Comment


          #5
          Originally posted by arbopa View Post
          AH!

          the input to game needs to include the path to the class, and the . with repeat and _C there. That info was buried pages back in my search.

          /Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C

          But to make it easier, you can go to your DefaltGame.ini and add something like this:

          [/Script/Engine.GameMode]
          +GameModeClassAliases=(ShortName="DM",GameClassName="/Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C")

          that creates an alias to the mode so you can just use game=DM in that instance and it loads the proper mode when loading the level.
          Glad to read that (: Thanks for the info!
          Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

          My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
          (Including 100+ Pages Multiplayer Network Compendium to get you started.)

          Comment


            #6
            As of recent engine versions, this changed in config location (DefaultEngine.ini now) and syntax. Here's an example.

            Code:
            [/Script/EngineSettings.GameMapsSettings]
            +GameModeClassAliases=(Name="TDM",GameMode="/Script/ShooterGame.ShooterGameMode_TeamDeathMatch")
            +GameModeClassAliases=(Name="DM",GameMode="/Script/ShooterGame.ShooterGameMode_FreeForAll")
            It can also be edited in Project Settings / Maps and Modes / Default Modes (advanced options).
            --

            Comment

            Working...
            X