Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra 2 / Rising Storm Forums > RO2/RS Modifications > Coding

Reply
Click here to go to the first Dev post in this thread.  
Thread Tools Display Modes
  #1  
Old 03-17-2012, 06:53 AM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 776
Default Creating and firing up a gametype?

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?
Reply With Quote
  #2  
Old 03-17-2012, 05:55 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 2,714
Default

Quote:
Originally Posted by LordGleedo View Post
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.
Reply With Quote
  #3  
Old 03-21-2012, 04:22 PM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 776
Default

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
Reply With Quote
  #4  
Old 03-21-2012, 06:51 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 2,714
Default

Quote:
Originally Posted by LordGleedo View Post
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.
Reply With Quote
  #5  
Old 03-22-2012, 04:13 AM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 776
Default

Quote:
Originally Posted by Ducky View Post
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

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
Reply With Quote
  This is the last developer post in this thread.   #6  
Old 03-22-2012, 05:08 PM
[TW]StragoMagus [TW]StragoMagus is offline
Tripwire Interactive Staff
 
Join Date: Jun 2010
Posts: 97
Default

Quote:
Originally Posted by LordGleedo View Post
Yep, this is quite a problem. I expect it can be worked around but right now It has been completely stumped

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.
Reply With Quote
  #7  
Old 03-22-2012, 05:22 PM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 776
Default

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)
{
	`Log(">>> DEBUG : SetGameType");

	// 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 by LordGleedo; 03-22-2012 at 05:24 PM.
Reply With Quote
  #8  
Old 03-22-2012, 06:49 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 2,714
Default

Quote:
Originally Posted by LordGleedo View Post
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)
{
    `Log(">>> DEBUG : SetGameType");

    // 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 by Ducky; 03-22-2012 at 07:10 PM.
Reply With Quote
  #9  
Old 03-23-2012, 03:53 AM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 776
Default

Thanks Ducky, will check it out tonight
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC