• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Replacing ROObjTerritory

mat69

Grizzled Veteran
Aug 1, 2006
826
0
Hello, I want to create a mutator that modifies ROObjTerritory.

Can someone tell me how I can replace ROObjTerritory with my class?
I tried CheckReplacement, but the result was not what I expected (my class seemed not to be loaded).

Code:
function bool CheckReplacement(Actor Other,out byte bSuperRelevant)
{
    if (ROObjTerritory(Other) != None)
    {
       ReplaceWith(Other,"XYZ.maROObjTerritory");
       return false;
    }
    else
        return true;
}
 
Ok, I came to the conclusion that replacing ROObjTerritory is not the best idea ...
So what I want now is to copy all properties of ROOjTerritory-actors on a map and spawn a modified ROObjTerritory-actor that has all the settings.
Probably bot-pathing would not work then, but I could live with that.

Code:
var ROTeamGame GameInfo;
[...]
function SpawnModObjectives()
{
  local int i;
  GameInfo = ROTeamGame(Level.Game);
  for( i = 0; i < 16; i++)
  {
    if( GameInfo.Objectives[i] != none )
    {
    ...
    }
  }
}

The problem is that it seems like GameInfo_Objectives is allways "none", so it never enters that part, allthough the function SpawnModObjectives() is conducted.

Can someone help me here?
 
Upvote 0
I want to modify the objectives. Yet I want that these changes also work in present maps.

So I intended to search through all Objectives, spawn new Objectives that are based on my class, copy all the settings from the initial Objectives and deactivate them later on.

Yet it seems that GameInfo_Objectives is none. So there would be nothing there to copy the settings off.
 
Upvote 0