• 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

Mutator Common Coding Problems and solutions

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
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.
Thanks.

I'm having the same problem as FBX. I'm also not able to run any client side code. Is it possible that a TWI dev gives us an example mutator on how to do a thing like that?
Just something like a "Hello World!!!" mutator that does write the Hello World to the log at the client side (the Hello World examples on the internet only write to server side logs). Nothing more, nothing less. We really would appreciate it.

Many thanks in advance!!!
 

Mekhazzio

FNG / Fresh Meat
Sep 21, 2011
1,104
641
0
To output a "Hello World" on the client, you would need to find a class that replicates to the client, override one of its simulated functions, and then get your mutator to change the original to your new class.

The Mutator class itself, the one that you're extending to do the basic tasks, does not ever exist on the client. You'll need different classes specifically set up for network replication.

Start here.
 
  • Like
Reactions: Ducky

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
To output a "Hello World" on the client, you would need to find a class that replicates to the client, override one of its simulated functions, and then get your mutator to change the original to your new class.

The Mutator class itself, the one that you're extending to do the basic tasks, does not ever exist on the client. You'll need different classes specifically set up for network replication.

Start here.
Ok, got it. I didn't expect that the whole class should be on the client. But it makes sense, because the function that I want to call remotely is part of a class.

Thanks for the help!
 

gentrinity

FNG / Fresh Meat
Oct 26, 2009
229
109
0
I read through this thread but I'm kind of having some issues with this right now. I created the shortcut with "make" at the end (no quotations), I added ModPackages=Test and made a class extend actor and made it placeable. It doesn't show up in the editor. I'm kinda lost here, I confess this is my first time working with UnrealScript (I'm a C# game programmer though), I would appreciate some help. I figured I would just keep it in this thread since it seems to be about the same subject. I'm not so much interested in writing up a mutator as I would like to rework some major classes, are there any differences between compiling and loading a mutator and a mod?
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
I read through this thread but I'm kind of having some issues with this right now. I created the shortcut with "make" at the end (no quotations), I added ModPackages=Test and made a class extend actor and made it placeable. It doesn't show up in the editor. I'm kinda lost here, I confess this is my first time working with UnrealScript (I'm a C# game programmer though), I would appreciate some help. I figured I would just keep it in this thread since it seems to be about the same subject. I'm not so much interested in writing up a mutator as I would like to rework some major classes, are there any differences between compiling and loading a mutator and a mod?
This is where I started http://udn.epicgames.com/Three/UnrealScriptHome.html
 

gentrinity

FNG / Fresh Meat
Oct 26, 2009
229
109
0
Ok, so the answer to compiling is in there? I have a general idea of how to get around US and I've already identified a lot of target classes I want to modify. I was just trying to get this thing to compile because I tried doing it the standard way and it wasn't working. UnrealFrontEnd isn't working either. Thanks for the link though.
 

FBX

FNG / Fresh Meat
Aug 17, 2006
238
42
0
I didn't edit any .ini files

As for client-side classes - I tried that already with ROPawn... If the client never sees the substitution function housed in the mutator class, then how is it going to know to use a different class?
 
Last edited:

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
I didn't edit any .ini files

As for client-side classes - I tried that already with ROPawn... If the client never sees the substitution function housed in the mutator class, then how is it going to know to use a different class?
Found this. The thread is rather long, never the less it's interesting. On pages 9 and 10 they figure out how to do the replication. There complete mutator source code can be found here. It's for UT, but I think it's a good example for a starting point.
 
Last edited:

FBX

FNG / Fresh Meat
Aug 17, 2006
238
42
0
Bleh, only info I see online about replacing a player pawn is "Don't do it because it'll break other mutators, but if you do do it, then use this code". The code provided doesn't work.

Anyone is welcome to come up with a simple case where they are able to replace the player pawn with their own. From what I can tell though, nobody has done it in a multiplayer mutator in any version of unreal.
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Bleh, only info I see online about replacing a player pawn is "Don't do it because it'll break other mutators, but if you do do it, then use this code". The code provided doesn't work.

Anyone is welcome to come up with a simple case where they are able to replace the player pawn with their own. From what I can tell though, nobody has done it in a multiplayer mutator in any version of unreal.
Duh... getting frustrated?
 

FBX

FNG / Fresh Meat
Aug 17, 2006
238
42
0
I'm not frustrated, I just don't have the free time to guess and check until I figure out how to do this, if it's even possible.

Most importantly, is it even worth the time spent even if everything worked perfectly
 

Proud_God

FNG / Fresh Meat
Dec 22, 2005
3,235
548
0
Belgium
Can someone help me? I'm trying to compile a simple class I created for testing.

I copied the ROGame.exe and added 'make' the shortcut as described in the OP. However, when I run it, I get a message saying 'Steam is required to run this game'. I do not think anything was compiled.

Note: I copied the 32 bit version of the ROgame.exe, it should work with that one, right?
 

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Can someone help me? I'm trying to compile a simple class I created for testing.

I copied the ROGame.exe and added 'make' the shortcut as described in the OP. However, when I run it, I get a message saying 'Steam is required to run this game'. I do not think anything was compiled.

Note: I copied the 32 bit version of the ROgame.exe, it should work with that one, right?
You do must not copy ROGame.exe. The only thing you need to do is create a shortcut pointing to ROGame.exe and to the command line you add the make command. The complete target line of the shortcut should look something like:
"C:\Program Files (x86)\Steam\SteamApps\common\red orchestra 2\Binaries\Win64\ROGame.exe" make

You also will need to add a compilable package to the ROEditor.ini file or else it will do nothing.
If you want to try it out, then you could for instance take one of the mutators which are available as open source. They should all be compilable. More about the open source mutators can be found here.