• 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/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Creating and firing up a gametype?

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
I have started work on a gametype. It is a port of code that I wrote against the UDK.

But first things first, I created a simple class which extends ROGameInfo and it has nothing in it except DefaultProperties and some logging in various events that should fire if the game is loaded.

I compiled the script and moved the .u to my published\script folder and added the following to my ro2 launch options in steam:
FF-Apartments?game=TOGAModTest.TOGAModTest

The game starts up and the correct map loads, but nothing is logged in the log files.

I also have no idea how to make a new gametype appear in the webadmin.

Has anyone tried to do this yet?
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
I have started work on a gametype. It is a port of code that I wrote against the UDK.

But first things first, I created a simple class which extends ROGameInfo and it has nothing in it except DefaultProperties and some logging in various events that should fire if the game is loaded.

I compiled the script and moved the .u to my published\script folder and added the following to my ro2 launch options in steam:
FF-Apartments?game=TOGAModTest.TOGAModTest

The game starts up and the correct map loads, but nothing is logged in the log files.

I also have no idea how to make a new gametype appear in the webadmin.

Has anyone tried to do this yet?
If you are testing this on your own computer with the command open FF-Apartments?game=TOGAModTest.TOGAModTest (listening server), then you will indeed not see anything in your logs. You need to comment or remove this line from ROEngine.ini.
Code:
Suppress=Log
If you are testing it on a dedicated server, then your log lines should be there if you use the correct log statement.
 

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
Well I have tried adding a debug log in PostBegingPlay and it does not show in the logs offline or online.

I think because I am loading a FF map that the gametype is defaulting to FF and the log has this:
Code:
[0003.49] Log: LoadMap: ff-Apartments?Name=Player?Team=255?game=TOGATestMod.TOGATestMod?maxplayers=12
[0003.65] Log: Game class is 'ROGameInfoFirefight'
WebAdmin also reports FF is loaded. So I am a bit stuffed right now lol
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Well I have tried adding a debug log in PostBegingPlay and it does not show in the logs offline or online.

I think because I am loading a FF map that the gametype is defaulting to FF and the log has this:
Code:
[0003.49] Log: LoadMap: ff-Apartments?Name=Player?Team=255?game=TOGATestMod.TOGATestMod?maxplayers=12
[0003.65] Log: Game class is 'ROGameInfoFirefight'
WebAdmin also reports FF is loaded. So I am a bit stuffed right now lol
Oh yes... I didn't think about that. The FF will indeed force the engine to load firefight. This is handled in the SetGameType function in ROGameInfo.uc.
 

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
Oh yes... I didn't think about that. The FF will indeed force the engine to load firefight. This is handled in the SetGameType function in ROGameInfo.uc.
Yep, this is quite a problem. I expect it can be worked around but right now It has been completely stumped :p

Would be great if a TWI coder could jump in and give us the low down on this and if it's currently possible to create and run a new gametype ;)
 

[TW]Strago

Tripwire Interactive Staff
Jun 23, 2010
166
204
0
Yep, this is quite a problem. I expect it can be worked around but right now It has been completely stumped :p

Would be great if a TWI coder could jump in and give us the low down on this and if it's currently possible to create and run a new gametype ;)
Ducky is correct you will want to override SetGameType in your gameinfo class and unsuppress 'Log' and 'ScriptLog' from your config.
 

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
Bloody hell i really need to read them comments!

It is now working and correctly loaded my custom game class. Strange thing is that my debug logging is still not getting written out. It should get written to the normal server log shouldn't it?

Code:
static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
{
	[B]`Log(">>> DEBUG : SetGameType");[/B]

	// Remove the Play In Editor tag from the MapName so we can find the proper gametype when using PIE
	ReplaceText(MapName, "UEDPIE", "");

	// Determine which GameType this Map is based off its name
	if ( Left(MapName, InStr(MapName, "-")) ~= "FF" )
	{
		return class'TOGAGameInfo';
	}

	// If all else fails, let the parent handle it
	return super.SetGameType(MapName, Options, Portal);
}
 
Last edited:

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Bloody hell i really need to read them comments!

It is now working and correctly loaded my custom game class. Strange thing is that my debug logging is still not getting written out. It should get written to the normal server log shouldn't it?

Code:
static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
{
    [B]`Log(">>> DEBUG : SetGameType");[/B]

    // Remove the Play In Editor tag from the MapName so we can find the proper gametype when using PIE
    ReplaceText(MapName, "UEDPIE", "");

    // Determine which GameType this Map is based off its name
    if ( Left(MapName, InStr(MapName, "-")) ~= "FF" )
    {
        return class'TOGAGameInfo';
    }

    // If all else fails, let the parent handle it
    return super.SetGameType(MapName, Options, Portal);
}
You need to add your class name to get them written out. Do it like this:
Code:
`Log(">>> DEBUG : SetGameType", , 'MyClassName');
(those double , , is not a typo ;). They need to be there)

Edit:
Yes it's written to the normal server logs. If you go to the OP of my open source mutators post somewhere on this Coding board, then you can view my mutators. Especially in BotDetonator are a lot of `Log examples.
 
Last edited:

CommanderShepard

FNG / Fresh Meat
Jul 2, 2014
28
0
0
I tried that and it worked as my map has its own prefix .

But can somebody please tell me what must i do to get that gameinfo and prefix connected. So that you can start it from the steam workshop option in the game menu? I tried the ROEngine.ini entry but it loads the map without any gametype
 

Zetsumei

FNG / Fresh Meat
Nov 22, 2005
12,459
1,433
0
31
Falmouth UK
Im not really a programmer but I made a little mod that logs information like kill grid coordinates on RO2/RS maps (doing it as a mutator proved too inefficient).

You should be able to get what you want from the gameinfo classes (i added both a RSTerritories and ROTerritories derivative so nothing weird happens if you change to an RS or RO2 map.
 

Attachments