• 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 Mutator Common Coding Problems and solutions

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!!!
 
Upvote 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
Upvote 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.

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!
 
Upvote 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?
 
Upvote 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?

This is where I started http://udn.epicgames.com/Three/UnrealScriptHome.html
 
Upvote 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.
 
Upvote 0
Upvote 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?

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:
Upvote 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.
 
Upvote 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.

Duh... getting frustrated?
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0