• 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 ServerOptions Empty

-=THOR=-

Grizzled Veteran
Sep 20, 2011
1,050
50
Hi,

I'm calling this in PostBeginPlay in my mutator.

Code:
    URL = self.WorldInfo.Game.ServerOptions;
    `Log("GetUrlID URL: "$URL, bEnableLogging, 'TimeScaler');
    pos = Len(URL);
    `Log("GetUrlID URL LENGTH: "$pos, bEnableLogging, 'TimeScaler');

The URL is always empty. Any idea why? I want to use a custom parameter, but I can't extract it from the url...

Thanks!
 
Last edited:
Hi,

I'm calling this in PostBeginPlay in my mutator.

Code:
    URL = self.WorldInfo.Game.ServerOptions;
    `Log("GetUrlID URL: "$URL, bEnableLogging, 'TimeScaler');
    pos = Len(URL);
    `Log("GetUrlID URL LENGTH: "$pos, bEnableLogging, 'TimeScaler');

The URL is always empty. Any idea why? I want to use a custom parameter, but I can't extract it from the url...

Thanks!

because it's not yet set at that level. You should use InitMutator for that. The first parameter of that function contains the map URL.
Example:
Code:
function InitMutator(string Options, out string ErrorMessage)
{
    local ROGameInfo  game;
 
    game = ROGameInfo(self.WorldInfo.Game);
 
    // Get my own mutator option from the map URL
    self.WakeUpTime = ROGameInfo(self.WorldInfo.Game).GetIntOption(Options, "WakeUpTime ", self.default.WakeUpTime );
 
    super.InitMutator(Options, ErrorMessage);
}
In the above example a WakeUpTime URL variable is passed in the map URL. Something like TE-Apartments?WakeUpTime=10
This way you can easily pass mutator configuration values in the map URL.
 
Upvote 0