How to change maps in ( UDK WIP)

Overview: There are ways to open a map in UDK( Unrealscript ) but there have to be almost 0 actors (Somehow) from what I've seen if you want to do it with a copy of UDK without Unreal Tournament.

So the code in order to change a map it's the following one.


//This would be my code
function DoMapChange()
{
    `log("FROM GOTAMP2GameInfo Changing map");
    DoCompleteGarbageCollection();
    WorldInfo.ForceGarbageCollection(true);
    ConsoleCommand("Open "@MapToBeChanged);
}

//And for the garbage collection thing. DoCompleteGarbageCollection(); 

//This would be it.
function DoCompleteGarbageCollection()
{
local Actor Act;

foreach DynamicActors(class 'Actor',Act)
{
  if(Act.class == class'GOTAMP2PlayerController' )
  {

  }
  else
  {
  Act.Destroy();
  }

 }
}

where ConsoleCommand("Open "@MapToBeChanged);

you add the name of the map 

ConsoleCommand("Open MyMap");













Comments

Popular Posts