No announcement yet.

Switching GameInfo's Mid-Game...

  • Filter
  • Time
  • Show
Clear All
new posts

    Switching GameInfo's Mid-Game...

    I really hope this is possible, but right now I'm getting the error:

    Could not spawn player

    whenever I try to run my level. I'm currently trying to switch the GameInfo within the PostBeginPlay of the gametype currently being used like this:
    function PostBeginPlay()
    Like I said, I get an error that a player couldn't be spawned. Will I have to "restart" the level somehow with the new gametype?

    Thanks for any advice you can offer!

    thats sort of like changing your car while youre sitting in it, i dont think it will work

    however, you can always start a map with any gametype you wish via the server travel string. console command "open mapname?gametype=gametype?playerclass=player" i think its playerclass anyway, heh. might wanna double check that one before you use it.


      ****, I was really banking on this working. It seems like it should be possible because the Level.Game property isn't const. You CAN change it, I just need to find some command to "restart" or something. I tried Level.Reset() but that didn't work...


        well, i could work. but it would be pretty weird if it did, heh. also i think self and are referring to the same thing in this case.

        but if you have your own gametype, why do you need to switch to another in the beginning of the match?


          It's a bit of a long story, but I'm working around it by changing the GameRules instead of the GameInfo. Now I'm just having this weird casting problem though...

          My new game info is called, say, MyGameInfo...

          log(Level.Game); // this is fine
          log(MyGameInfo(Level.Game)); // this says bad parameter

          What the heck is goin' on?!


            log function may not like typecasted variables? maybe try:

            somevar = MyGameInfo(;


              Sorted out now, turns out I had mistakenly placed the new class in another package that wasn't being compiled. Phew!

              Thanks for all the help BoneHed...