Check Replacement Weapon replacing problem [SOLVED]
Hi all,
I've been following this tutorial and I'm going out of my mind! The tutorial is excellent, I think I'm just being dumb.
Rightio, the tutorial is to create a mutator which replaces the enforcer with a "better" one. I'm on vista, so I'm doing all of this within "C:\users\Joe\Documents\My Games\Unreal Tournament 3\UTGame". The folder structure inside the "unpublished\src" folder is "FirstProperMutator" and then "classes", AFAIK this is correct.
So the source files within the classes folder are:
FirstProperMutator.uc
UTWeap_EnforcerPlusOne.uc
Ok, thats the actual source files. Then in "Unpublished\CookedPC\Localization" I put FirstProperMutator.int which contains:
The compiled FirstProperMutator.u are in "Unpublished\CookedPC\Script", just for the record!
So in "UTGame\Config" (still in documents\my games\etc etc) I have:
And lastly here is the contents of FirstProperMutator.ini which is in "Documents\My Games\Unreal Tournament 3\UTGame\Config":
Now I ran these with -useunpublished, and I got an error in the log saying:
So I copied the contents of "C:\Users\Joe\Documents\My Games\Unreal Tournament 3\UTGame" to "C:\Program Files\Unreal Tournament 3\UTGame". After doing this the error went away, and my HelloWorld mutator sent "hello world" to the log. Also FirstProperMutator sent "Inited First proper mutator" to the log as it was supposed to in the initMutator function.
However it never sends "Replaced an enforcer" to the log, which explains why the enforcer does not do any more damage when I use the mutator.. So it's not actually replacing any of the normal enforcers with my modified one, so what am I not seeing here?
Help!
Thanks in advance, and apologies for the huge post.
-Spec
Hi all,
I've been following this tutorial and I'm going out of my mind! The tutorial is excellent, I think I'm just being dumb.
Rightio, the tutorial is to create a mutator which replaces the enforcer with a "better" one. I'm on vista, so I'm doing all of this within "C:\users\Joe\Documents\My Games\Unreal Tournament 3\UTGame". The folder structure inside the "unpublished\src" folder is "FirstProperMutator" and then "classes", AFAIK this is correct.
So the source files within the classes folder are:
FirstProperMutator.uc
Code:
class FirstProperMutator extends UTMutator;
// === VARIABLES ===
// Set Defaults
DefaultProperties
{
}
// === FUNCTIONS ===
/*
Name: initMutator
Parameters: string, string
Purpose: Called when the mutator is "turned on", any setting up done here
*/
function initMutator(string Options, out string ErrorMessage) {
if(UTGame(WorldInfo.Game) != None) { // Make sure there is a valid game
UTGame(WorldInfo.Game).DefaultInventory[0] = class'FirstProperMutator.UTWeap_EnforcerPlusOne';
}
loginternal( "Inited First proper mutator" );
Super.initMutator(Options, ErrorMessage);
}
/*
Name: CheckReplacement
Parameters: Actor
Purpose: Allows you to replace any object in the game with another, awesomes!
*/
function bool CheckReplacement(Actor Other) {
if(Other.IsA('UTWeap_Enforcer') && !Other.IsA('UTWeap_EnforcerPlusOne') ) {
loginternal( "Replaced an enforcer" );
ReplaceWith(Other, "UTWeap_EnforcerPlusOne");
}
return true;
}
UTWeap_EnforcerPlusOne.uc
Code:
class UTWeap_EnforcerPlusOne extends UTWeap_Enforcer;
// === VARIABLES ===
// Defaults
DefaultProperties {
InstantHitDamage(0)=1000.000000
InstantHitDamage(1)=1000.000000
InstantHitMomentum(0)=10000.000000
InstantHitMomentum(1)=10000.000000
}
// === FUNCTIONS ===
Ok, thats the actual source files. Then in "Unpublished\CookedPC\Localization" I put FirstProperMutator.int which contains:
Code:
[UTWeap_EnforcerPlusOne]
ItemName="Enforcer+1"
PickupMessage="Enforcer+1"
The compiled FirstProperMutator.u are in "Unpublished\CookedPC\Script", just for the record!
So in "UTGame\Config" (still in documents\my games\etc etc) I have:
Code:
...
...
[ModPackages]
ModPackages=HelloWorld // This was just a really basic mutator to write "hello world" in the log
ModPackages=FirstProperMutator
ModPackagesInPath=..\UTGame\Src
ModOutputDir=..\UTGame\Unpublished\CookedPC\Script
...
...
And lastly here is the contents of FirstProperMutator.ini which is in "Documents\My Games\Unreal Tournament 3\UTGame\Config":
Code:
[FirstProperMutator UTUIDataProvider_Mutator]
ClassName=FirstProperMutator.FirstProperMutator
FriendlyName=Enforcer Boost
Description=My first mutator! Boosts enforcers damage.
GroupNames=
UIConfigScene=
bStandaloneOnly=False
bRemoveOn360=False
bRemoveOnPC=False
bRemoveOnPS3=False
[UTWeap_EnforcerPlusOne UTUIDataProvider_Weapon]
ClassName=FirstProperMutator.UTWeap_EnforcerPlusOne
AmmoClassPath=UTGame.UTAmmo_Enforcer
Flags=
FriendlyName=EnforcerPlusOne
Description=Its just plain better than the enforcer.
MeshReference=UI_Weapons.Mesh.SK_UI_Weapons_Enfocer_3P
bRemoveOn360=False
bRemoveOnPC=False
bRemoveOnPS3=False
Now I ran these with -useunpublished, and I got an error in the log saying:
Code:
Error: Error reading attributes for 'C:\Program Files\Unreal Tournament 3\Binaries\..\UTGame\ Unpublished\CookedPC\Script\FirstProperMutator.u'
Error: Error reading attributes for 'C:\Program Files\Unreal Tournament 3\Binaries\..\UTGame\ Unpublished\CookedPC\Script\HelloWorld.u'
So I copied the contents of "C:\Users\Joe\Documents\My Games\Unreal Tournament 3\UTGame" to "C:\Program Files\Unreal Tournament 3\UTGame". After doing this the error went away, and my HelloWorld mutator sent "hello world" to the log. Also FirstProperMutator sent "Inited First proper mutator" to the log as it was supposed to in the initMutator function.
However it never sends "Replaced an enforcer" to the log, which explains why the enforcer does not do any more damage when I use the mutator.. So it's not actually replacing any of the normal enforcers with my modified one, so what am I not seeing here?
Help!
Thanks in advance, and apologies for the huge post.
-Spec
Last edited: