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
  #21  
Old 01-20-2012, 12:23 AM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

Quote:
Originally Posted by worluk View Post
Did you try to replace the default pawn setting in the gametype via a mutator?
Something like
Code:
function PreBeginPlay() 
{     
   super.PreBeginPlay();
   class'Package.Class'.default.WhateverProperty=10; 
}
The stuff I want to change isn't a setting. I want to override existing functions with my own.

Unrealscript confuses me in that if I take the controller which owns the pawn and typecast the pawn to my own custom class which extends ROPawn, then assign it to the controller's pawn, it breaks. The old pawn disappears (if I use checkreplacement and return false) and the new one doesn't have any functionality. If I don't use checkreplacement the old pawn hangs around but doesn't work.
Reply With Quote
  #22  
Old 01-20-2012, 12:25 AM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

Quote:
Originally Posted by Ducky View Post
I have a few questions to which I do not have the answer. I hope someone can help me out:
  1. How can I write something to the RO2 log file?
    I've tried the `log and `logd macro with -debug passed to the make command, but I still do not see anything appear in the log files.
  2. How should I make my mutator known (and selectable) in the web-admin tool?
  3. How should the format of the defaulthullmgmutator.ini file look like for the next mutator class? (it's just a snipped of the class)
Code:
class HullMGMutator extends Mutator
    config(HullMGMutator);
    
struct MissPercentages
{
    var float Recruit;
    var float Soldier;
    var float Veteran;
    var float Hero; 
};

var config MissPercentages HullMGMissPercentages;
I've tried this, but the mutator doesn't seem to load it:
Code:
[HullMGMutator.HullMGMutator]
HullMGMissPercentages=(Recruit=75.0,Soldier=70.0,Veteran=65.0,Hero=60.0)
100% ditto on logging. Would make debugging this stuff a lot easier to see what the variables are at certain points.
Reply With Quote
  #23  
Old 01-20-2012, 03:15 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,223
Default

Quote:
Originally Posted by FBX View Post
The stuff I want to change isn't a setting. I want to override existing functions with my own.

Unrealscript confuses me in that if I take the controller which owns the pawn and typecast the pawn to my own custom class which extends ROPawn, then assign it to the controller's pawn, it breaks. The old pawn disappears (if I use checkreplacement and return false) and the new one doesn't have any functionality. If I don't use checkreplacement the old pawn hangs around but doesn't work.
You misunderstood. I suggested you replace the gametypes default pawn that way, therefore not requiring a checkreplacement as the standard gamecode would spawn your pawn by default.
Reply With Quote
  #24  
Old 01-20-2012, 03:19 AM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,223
Default

Quote:
Originally Posted by Ducky View Post
I have a few questions to which I do not have the answer. I hope someone can help me out:
  1. How can I write something to the RO2 log file?
    I've tried the `log and `logd macro with -debug passed to the make command, but I still do not see anything appear in the log files.
  2. How should I make my mutator known (and selectable) in the web-admin tool?
  3. How should the format of the defaulthullmgmutator.ini file look like for the next mutator class? (it's just a snipped of the class)
Code:
class HullMGMutator extends Mutator
    config(HullMGMutator);
    
struct MissPercentages
{
    var float Recruit;
    var float Soldier;
    var float Veteran;
    var float Hero; 
};

var config MissPercentages HullMGMissPercentages;
I've tried this, but the mutator doesn't seem to load it:
Code:
[HullMGMutator.HullMGMutator]
HullMGMissPercentages=(Recruit=75.0,Soldier=70.0,Veteran=65.0,Hero=60.0)
*shrug* no idea about the log, HoS was not in any state when i tried and i wont touch its code with a ten foot pole now.
What you could do though for debugging (in case you dont want to use the to my knowledge working, real debugger option that comes with nfringe), you can use a broadcast call to print stuff ingame. Did that for debugging tank code for CC.

For the mutator to show up in webadmin you need the .ini and .int file for the mutator. Check other files of that sort and the standard tutorials on UT3/UE3 mutators on how those should look.
Reply With Quote
  #25  
Old 01-20-2012, 05:00 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by worluk View Post
*shrug* no idea about the log, HoS was not in any state when i tried and i wont touch its code with a ten foot pole now.
What you could do though for debugging (in case you dont want to use the to my knowledge working, real debugger option that comes with nfringe), you can use a broadcast call to print stuff ingame. Did that for debugging tank code for CC.

For the mutator to show up in webadmin you need the .ini and .int file for the mutator. Check other files of that sort and the standard tutorials on UT3/UE3 mutators on how those should look.
I did, but they all refer to using this command:
Code:
ucc dumpint HullMGMutator.u
But I can't find any ucc executable

By the way. I was always in the impression that those .int files were only for UT2003 and not for UT2004 and his offspring's.

Well at least I got mu mutator to load the defaulhullmgmutator.ini file now. There was a typo in the .ini file name on my server
__________________
Reply With Quote
  #26  
Old 01-20-2012, 05:44 PM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,223
Default

No need for that command, the int files are plain ascii anyway. As i said, there are enough mutator tutorials out there stating how those files are set up. You will need .ini, .u and .int for the mutator to show up in the webadmin
Reply With Quote
  #27  
Old 01-21-2012, 08:55 AM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by worluk View Post
No need for that command, the int files are plain ascii anyway. As i said, there are enough mutator tutorials out there stating how those files are set up. You will need .ini, .u and .int for the mutator to show up in the webadmin
I did that. I have the .ini and .u. I also created a .int following instructions from the internet, but still the mutator doesn't show up on the Change Map screen.
Mostly I've been using this http://wiki.beyondunreal.com/Legacy:...pt_Hello_World (which is using the 'older' UT2003) and this http://wiki.beyondunreal.com/UnrealScript_Hello_World. And again here http://wiki.beyondunreal.com/Legacy:Create_An_INT_File (which is again for UT2003 only).
But none of those works.

Maybe you know a better web-link for me, because i'm running out of options?
__________________

Last edited by Ducky; 01-21-2012 at 08:57 AM.
Reply With Quote
  #28  
Old 01-21-2012, 10:41 AM
Mekhazzio's Avatar
Mekhazzio Mekhazzio is offline
Senior Member
 
Join Date: Sep 2011
Posts: 1,104
Default

Yeah, it's not a file problem. (also, the .int files are unicode, not ascii)

It looks to me like there's a flaw in the webadmin mutator handling. It's recognizing that the mutators are there, and it's reading the ROUIDataProvider_Mutator block correctly (the part that checks for duplicates functions) but it's not populating that data into the DCEMutator object that it uses for all its internal handling (verified with "getall dcemutator classname" on the server console). With all the data left null, the later logic breaks down, of course.

It looks to me like it's missing a call to DCEMutator.init() on DataStoreCache.uc line 574.
Reply With Quote
  #29  
Old 01-21-2012, 12:26 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by Mekhazzio View Post
Yeah, it's not a file problem. (also, the .int files are unicode, not ascii)

It looks to me like there's a flaw in the webadmin mutator handling. It's recognizing that the mutators are there, and it's reading the ROUIDataProvider_Mutator block correctly (the part that checks for duplicates functions) but it's not populating that data into the DCEMutator object that it uses for all its internal handling (verified with "getall dcemutator classname" on the server console). With all the data left null, the later logic breaks down, of course.

It looks to me like it's missing a call to DCEMutator.init() on DataStoreCache.uc line 574.
Amazing... You really did dive deap into the scripting that comes with the SDK. Nice bug tracking
__________________

Last edited by Ducky; 01-21-2012 at 12:27 PM.
Reply With Quote
  #30  
Old 01-22-2012, 02:10 PM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by FBX View Post
100% ditto on logging. Would make debugging this stuff a lot easier to see what the variables are at certain points.
Figured out how to write stuff to the servers log files. This is what is working for me:
Code:
`Log("Some message that I want to log",, 'MyMutatorClass');
__________________
Reply With Quote
  #31  
Old 01-23-2012, 08:00 AM
LordGleedo's Avatar
LordGleedo LordGleedo is offline
Senior Member
 
Join Date: Jul 2010
Location: Bucks, England
Posts: 800
Default

Quote:
Originally Posted by Ducky View Post
I did, but they all refer to using this command:
Code:
ucc dumpint HullMGMutator.u
But I can't find any ucc executable

By the way. I was always in the impression that those .int files were only for UT2003 and not for UT2004 and his offspring's.

Well at least I got mu mutator to load the defaulhullmgmutator.ini file now. There was a typo in the .ini file name on my server
The UCC.exe was the old UT2004 compiler, so you could try running rogame.exe dumpint HullMGMutator.u to see if that works.
Reply With Quote
  #32  
Old 01-23-2012, 09:29 AM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by LordGleedo View Post
The UCC.exe was the old UT2004 compiler, so you could try running rogame.exe dumpint HullMGMutator.u to see if that works.
Hehe... I did, but it just started the game and then it tried to load the map 'dumpint'
__________________

Last edited by Ducky; 01-24-2012 at 08:29 AM.
Reply With Quote
  Click here to go to the next developer post in this thread.   #33  
Old 01-25-2012, 11:53 AM
Yoshiro's Avatar
Yoshiro Yoshiro is offline
In Soviet Russia, Yoshiro is a cake
 
Join Date: Oct 2005
Posts: 9,805
Default

UCC isn't really part of the engine anymore.
__________________

Pretty, what do we blow up first? - Myn Donos
Reply With Quote
  #34  
Old 01-26-2012, 02:23 AM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

The issue I'm having is that as a client on a dedicated server I'm not seeing any of the mutator function calls working. None of my log messages show up in the console. Nothing client side seems to happen. I've tried some very basic stuff and have tried making a client function then having the server call it, but nothing happens.

The server-side stuff seems to work (such as modifying variables that are replicated to the client), and the client side stuff works on a listen server, but thats it.
Reply With Quote
  #35  
Old 01-26-2012, 06:22 AM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by FBX View Post
The issue I'm having is that as a client on a dedicated server I'm not seeing any of the mutator function calls working. None of my log messages show up in the console. Nothing client side seems to happen. I've tried some very basic stuff and have tried making a client function then having the server call it, but nothing happens.

The server-side stuff seems to work (such as modifying variables that are replicated to the client), and the client side stuff works on a listen server, but thats it.
If you run it on a dedicated server, do you then see your log lines in the server logs?

An other thing that you can try is to place your mutator by hand in the steam\SteamApps\common\Red Orchestra 2\ROGame\CookedPC\Script folder. Next connect to the dedicated server and try it again.
__________________
Reply With Quote
  #36  
Old 01-27-2012, 03:28 AM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

As I said, the server stuff runs, but I can't find evidence that my client stuff runs at all. Changing sensitivity is entirely client-side.

It'd be nice if someone had a simple example that worked so I can try to figure out what I'm doing wrong. I have the functions I am calling as "client" or "simulated" and I have them mentioned in the replication statement:

Code:
replication
{
    reliable if (Role == ROLE_Authority)
        addInputClient, LogicCheckerTimerClient;
}


reliable client function addInputClient(PlayerInput newinput, ROPawn MyPawn) {
... etc

Last edited by FBX; 01-27-2012 at 03:37 AM.
Reply With Quote
  #37  
Old 01-29-2012, 03:01 AM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

I'm giving up. My conclusion is that the mutator isn't being loaded at all on the cilent. I'm not seeing anything in the client logs that mention actually loading the mutator. Shame

Last edited by FBX; 01-29-2012 at 03:04 AM.
Reply With Quote
  #38  
Old 01-29-2012, 07:19 AM
Ducky's Avatar
Ducky Ducky is offline
Moderator
 
Join Date: May 2011
Location: Netherlands
Posts: 4,663
Default

Quote:
Originally Posted by FBX View Post
I'm giving up. My conclusion is that the mutator isn't being loaded at all on the cilent. I'm not seeing anything in the client logs that mention actually loading the mutator. Shame
Don't give up. PM you sources to TWI's dev team and ask for assistance/advice. They did help me out when I had an issue with my mutator.
__________________
Reply With Quote
  #39  
Old 01-29-2012, 02:47 PM
FBX FBX is offline
Senior Member
 
Join Date: Aug 2006
Posts: 238
Default

TWI, can you please verify that mutators are being loaded on the client side like it should? If so, can you provide the code for a test example that proves this?
Reply With Quote
  This is the last developer post in this thread.   #40  
Old 01-30-2012, 10:24 AM
[TW]Strago [TW]Strago is offline
Tripwire Interactive Staff
 
Join Date: Jun 2010
Posts: 111
Default

Quote:
Originally Posted by Ducky View Post
How can I write something to the RO2 log file?
I've tried the `log and `logd macro with -debug passed to the make command, but I still do not see anything appear in the log files.
Script logging is disabled by default to improve the performance of players who don't need it. To enable it type 'Unsuppress ScriptLog' into the console or remove 'Suppress=ScriptLog' from ROEngine.ini.

Adding a custom logging group such as, 'MyMutatorClass', also does the trick because MyMutatorClass is not suppressed.
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 02:00 PM.


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