Please help write this. I'm going to list out some questions and I'd appreciate responses that give instructions on how to do whatever the question asks. Then I can update this main post with the answer. The idea is that the thread becomes a one-stop location to learn to do things.
This thread assumes you something about coding at the very least and have experience with a programming language similar to unreal script (a c-like language)
Note that some of these questions I think I know the answer to but I'm not filling them in until I actually try it out.
1. Where is the unreal script source code located?
A:
2. I have Windows 7 and its file contents search doesn't work. At all. Whats a good program that allows me to quickly and easily search what I'm looking for in the .us files?
3. How do I compile a mutator in RO2?
4. How do I run/test a mutator?
5. What's a basic template for starting a mutator?
6. How do I start a timed event?
http://udn.epicgames.com/Three/UnrealScriptFunctions.html#Timers
7. How do I concurrently run different timers?
http://udn.epicgames.com/Three/UnrealScriptFunctions.html#Timers
8. What accessor variables/functions are visible to a mutator?
9. How do I replace a class with my own if I can't determine where it is being created?
10. What is the core player entity and how do I access its values?
11. I see a core engine or game function that I want to override or extend. What is the best way to do this?
12. What scope does a mutator run from? I.E. What do I need to worry about in terms of keeping things in sync between the client and the server?
13. What overridable function callbacks are visible to a mutator?
14. What appears mutatable but isn't?
15. What's the difference between the ways mutators need to be loaded between listen servers and dedicated servers?
16. How do I know if my reference to a class object is the same as another reference to a class object?
This thread assumes you something about coding at the very least and have experience with a programming language similar to unreal script (a c-like language)
Note that some of these questions I think I know the answer to but I'm not filling them in until I actually try it out.
1. Where is the unreal script source code located?
A:
Code:
The core unreal script source code is at:
<steam install location>\steamapps\common\red orchestra 2\Development\Src
However, to make your mutator, the scripting code needs to be located at <My Documents>\My Games\RedOrchestra2\ROGame\Src\<Myfoldername>\Classes
Example:
C:\Users\<Windows Username>\Documents\My Games\RedOrchestra2\ROGame\Src\MyMutatorName
3. How do I compile a mutator in RO2?
Code:
Create a shortcut to ROGame.exe This is NOT the
steam shortcut. Actually navigate to the .exe location and
create a windows shortcut, then add "make" (no quotes) after
the end of the quoted section.
Example:
"C:\Program Files (x86)\Steam\steamapps\common\red orchestra 2\Binaries\Win64\ROGame.exe" make
5. What's a basic template for starting a mutator?
Code:
Create a text file as MyMutatorName.uc (i.e. the file extension is .uc, not .txt)
Code:
class MyMutatorName extends Mutator;
// variable declarations go here
// hooks go here
defaultproperties
{
GroupName="MyMutator"
FriendlyName="My Mutator"
Description="My Horrible Creation"
}
http://udn.epicgames.com/Three/UnrealScriptFunctions.html#Timers
7. How do I concurrently run different timers?
http://udn.epicgames.com/Three/UnrealScriptFunctions.html#Timers
8. What accessor variables/functions are visible to a mutator?
Code:
From What I can tell, everything must be reached somehow by the
functions you see in Mutator.uc. Note that the function returns regular
unreal entities and not Red Orchestra entities. I believe you can type
cast them to get what you want. For example, using our Mutator template
as a starting point:
// function hooks go here
function ModifyPlayer(Pawn Other)
{
local ROPawn MyPawn;
MyPawn = ROPawn(Other);
MyPawn.NumBandages = 0;
super.ModifyPlayer(Other);
}
My guess is this would give each player 0 bandages to start out with. However I don't know how to test/install a mutator yet to confirm
Code:
From what I can tell, you can't.
Duplicating a class name gives a warning and probably won't
work correctly. A lot of game elements are accessible from the
Pawn class though and you can get a player pawn from the
ModifyPlayer callback function
Code:
ROPawn is the core entity
12. What scope does a mutator run from? I.E. What do I need to worry about in terms of keeping things in sync between the client and the server?
13. What overridable function callbacks are visible to a mutator?
Code:
Engine\Classes\Mutator.uc is a starting point. Are there others?
15. What's the difference between the ways mutators need to be loaded between listen servers and dedicated servers?
16. How do I know if my reference to a class object is the same as another reference to a class object?
Code:
From what I can tell, you can't. == isn't valid with some (but not all???) class nor struct references so the only means seem to be indirect ones (comparing the member variables)
Last edited: