Axesor Posted August 27, 2015 Share Posted August 27, 2015 Hello there I am total NOOB and I was trying to learn something and was doing my own mutator BUT I dont know how to test it now! To test your mutator copy this file into the Renegade X/UDKGame/CookedPC folder and add a ?mutator=YourModPackageName.YourMutatorsMainClassExtendingUTMutator parameter to the Renegade X starting parameters or you could start it from the command line from inside UDK-2014-02/Binaries/Win32 folder like: udk CNC-Walls_Flying?game=RenX_Game.Rx_Game?mutator=YourModPackageName.YourMutatorsMainClassExtendingUTMutator -nomovie -windowed -log -forcelogflush To start the game with multiple mutators you can concat the mutators with a "," like ?mutator=Mutator1,Mutator2, ... What the hell is this curse??? ?mutator=YourModPackageName.YourMutatorsMainClassExtendingUTMutator parameter to the Renegade X starting parameters or you could start it from the command line from inside UDK-2014-02/Binaries/Win32 folder like: udk CNC-Walls_Flying?game=RenX_Game.Rx_Game?mutator=YourModPackageName.YourMutatorsMainClassExtendingUTMutator -nomovie -windowed -log -forcelogflush I didn't get nothing from it. Can somebody please explain to me how do I test my mutator, step by step? Just like you was explaining this to your grandma. Please Thank you Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted August 27, 2015 Totem Arts Staff Share Posted August 27, 2015 1. Make a shortcut of your udk.exe 2. Open shoetcut's properties 3. In Target box, after UDK.exe, add without space ?Mutator=PackageName.ClassName 4. Ok, then open that shortcut package name is the main folder where you store your mutator script classes. Class name is the name of the script .uc file Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 27, 2015 Author Share Posted August 27, 2015 Not working for me. Target folder is not avaiable... I guess that changing values in source code isn't all what is needed to create a simple mutator. God damn it. Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted August 28, 2015 Totem Arts Staff Share Posted August 28, 2015 what target folder? I mean the top box in properties of a shortcut file Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 28, 2015 Author Share Posted August 28, 2015 (edited) "...\Renegade X\Binaries\Win32\UDK.exe" Nwm I am just dump. I didn't even created any mutator. I just changed few values in source code and saved it in MyMutator/Classes/ folder. Sorry I am trying to get into it... I never worked with codes before. Moderators, please, remove this thread so players who actually made a mutator won't be confused looking for answer here. But hey. Thx for respond. I actually get it from your instructions. Edited August 28, 2015 by Guest Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 28, 2015 Author Share Posted August 28, 2015 Nope. I couldn't even run this simple mutator which does nohing. I was following step by step. Tried it multiple times. But the result was alway same-I can't test it. I tried "...\Renegade X\Binaries\Win32\UDK.exe"?Mutator=Extra.FasterHarvies also "...\Renegade X\Binaries\Win32\UDK.exe?Mutator=Extra.FasterHarvies" Not working. When I try to save changes It throws error messages at me, that the target name is invalid. An Example Let's write a mutator that makes harvies go faster. First, install the UDK. Currently RenX was released with the July 2013 version of the UDK so lets install that. From http://download.udk.com/UDKInstall-2013-07.exe, if you're lazy. It probably goes to C:\udk\udk-2013-07. Now we make a project. Let's call our project Extra and our mutator FasterHarvies (following the example above). Go to UDKROOT\Development\src\ and make the folder Extra. Then make the folder Extra\Classes. Now go to UDKROOT\UDKGame\Config\DefaultEngineUDK.ini and find the section "UnrealEd.EditorEngine". This is where we add packages to be compiled. At the end of this section, add +EditPackages=Extra Now our environment is ready. Create UDKROOT\Development\src\Extra\Classes\FasterHarvies.uc and open it with notepad (or notepad++ if you're smart). Type "class FasterHarvies extends UTMutator;". Save the file. Now, run Unreal Frontend (this is installed with UDK), click the arrow dropdown under Script, and click Compile Scripts. If all goes well, the output should end like this --------------------Extra - Release-------------------- Analyzing... Scripts successfully compiled - saving package 'C:\UDK\UDK-2013-07\Binaries\Win32\..\..\UDKGame\Script\Extra.u' Congratulations, you just made a mutator which does nothing. To test, copy Extra.u (from the path above) to your Renegade X server, under ROOT\UDKGame\CookedPC and run your server, adding to the command line ?Mutator=Extra.FasterHarvies Also when I try to compile this sctipt in Unreal Frontend: class FasterHarvies extends UTMutator; It throws error message at me Error, Superclass UTMutator of class FasterHarvies not found So I had to correct the code (I don't even know if it's right but I saw it in another tutorials) like this: class FasterHarvies extends Mutator; And then it worked. Also I am not using Udk-2013-07 but SDK.. I hope it doesn't matter Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted August 28, 2015 Totem Arts Staff Share Posted August 28, 2015 First. it's UDK.exe CNC-[name of map]?mutator=Extra.FasteeHarvies. notice the map included in the command Yeah, you gotta include the map, for example, if you want to run Islands, do it like this : "...\RenegadeX\Binaries\Win32\UDK.exe" CNC-Islands?Mutator=Extra.FasterHarvies Second, extend it from Rx_Mutator instead of UTMutator Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 28, 2015 Author Share Posted August 28, 2015 Well, hell it's working! Second, extend it from Rx_Mutator instead of UTMutator Error, Superclass Rx_Mutator of class FasterHarvies not found I don't know whats wrong, but I think I'm gonna stick with Mutator extend Thank you! It's time to experiment for me. Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted August 28, 2015 Totem Arts Staff Share Posted August 28, 2015 Funny, really. You sure the editor compiles the scripts right? check renx_game or UTGame for those classes..... unless, oooooh you put it in EditPackages did you? no. you add it in ModEditPackages on the bottom of the list. the order is important so it compiles renx scripts first THEN compiles your mutator Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 28, 2015 Author Share Posted August 28, 2015 Ok, I replaced it with +ModEditPackages=RenX_RCam+ModEditPackages=RenX_Game +ModEditPackages=Extra ...accorgind to RypeL's tutorial. Instead of EditPackages=Extra And now it runs with Rx_Mutator. Thx I guess. I don't know what's the difference but I did it @_o Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted August 28, 2015 Totem Arts Staff Share Posted August 28, 2015 The script compiles in order, ModEditPackages is compiled after EditPackages. So here's what happened before : Your script compiles before the UTGame does, that's why it cannot find the UTMutator class, which is in UTGame. The package and their classes hasn't existed yet. RenX compiles after UTGame, that is why your mutator cannot detect Rx_Mutator as well. Quote Link to comment Share on other sites More sharing options...
Ruud033 Posted August 28, 2015 Share Posted August 28, 2015 I guess. I don't know what's the difference but I did it @_o Knowing script hierachy is key if you want to run a script properly since you extend something, therefore you hop in an existing hierarchy tree somewhere. Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 29, 2015 Author Share Posted August 29, 2015 Guys...I'm cornered. I have my vision of mutator but I don't have nothing to bounce from. I have read several websites with Mutator tutorials for UT3, KillingFloor and general Mutator tutorials. I also tried to learn from downloaded Mutators from servers and this webside.. I didn't found nothing what I needed Well, I tried to edit the values for the basic pistol, which I think would be the easiest, to know if my next mutators gonna work. This is my codes: class Pistol_HC extends Rx_Mutator;function InitMutator(string Options, out string ErrorMessage) { if (Rx_Game(WorldInfo.Game) != None) { Rx_Game(WorldInfo.Game).DefaultInventory[0] = class'Rx_Weapon_Pistol_HC'; } Super.InitMutator(Options, ErrorMessage); } function bool CheckReplacement(Actor Other) { if (Other.IsA('Rx_Weapon_Pistol')) { ReplaceWith(Other, "Rx_Weapon_Pistol_HC"); } return true; } + class Rx_Weapon_Pistol_HC extends Rx_Weapon_Reloadable;DefaultProperties { InstantHitDamage(0)=100 // 20 berore InstantHitDamage(1)=0 } Compilation didn't show any error message. I'm completely new in this, without any previous experience in coding, and I'm trying to create my own mutator for the third day already. Without any success. Quote Link to comment Share on other sites More sharing options...
Henk Posted August 29, 2015 Share Posted August 29, 2015 I only see this small part of code and don't know anything about u script, but shouldn't the classname in your first line of code have "Rx_Weapon_" in front of it? Just ignore this if that's not the problem, sometimes it can be these small things you overlook. Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 29, 2015 Author Share Posted August 29, 2015 In the first script I tried to replace original file named: Rx_Weapon_Pistol with file that has edited values in it. I named it: Rx_Weapon_Pistol_HC The second script is the file with edited values in it. And I want the game to use this values instead of original ones. Shouldn't the classname in your first line of code have "Rx_Weapon_" in front of it? I don't know if it's matters. I thought I can name it Potato if I want O_o It's just a name of file and script. I guess... Oh men I feel so bad and demotivated. I am complete noob. Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 30, 2015 Author Share Posted August 30, 2015 I think I am getting very close. If nobody will help me in this phase now, then I get stuck at this forever. Please help. This is my second version of codes. And its not working: class Pistol_HC extends Rx_Mutator;function InitMutator( string Options, out string ErrorMessage ) { if(Rx_Game(WorldInfo.Game) != none) { Rx_Game(WorldInfo.Game).DefaultInventory[0] = class'Rx_Weapon_Pistol_HC'; } super.InitMutator( options, ErrorMessage ); } function bool CheckReplacement( Actor Other ) { if(Other.IsA('Rx_Weapon_Pistol')) { ReplaceWith(Other, "Rx_Weapon_Pistol_HC"); } return true; } DefaultProperties { } + class Rx_Weapon_Pistol_HC extends Rx_Weapon_Pistol; DefaultProperties { WeaponRange=10000.0 InstantHitDamage(0)=100 InstantHitDamage(1)=0 HeadShotDamageMult=1.0 } Quote Link to comment Share on other sites More sharing options...
RypeL Posted August 30, 2015 Share Posted August 30, 2015 What weapons a player holds is managed by an Rx_InventoryManager. With the way it spawns and references its weapons you need to tell it the new weaponclass to successfully exchange a weapon with your modified version. The following code i did for a Mutator a while back contains some examples on how to change multiple stuff in the game including weapons: class PrePatchBalanceMutator extends UTMutator config(PrePatchBalanceMutator); var config int AirdropCooldownTime; function InitMutator(string Options, out string ErrorMessage) { if (Rx_Game(WorldInfo.Game) != None) { Rx_Game(WorldInfo.Game).PlayerReplicationInfoClass = class'PrePatchBalanceMod.Rx_Pri_Modified'; Rx_Game(WorldInfo.Game).PlayerControllerClass = class'PrePatchBalanceMod.Rx_Controller_Modified'; Rx_Game(WorldInfo.Game).DefaultPawnClass = class'PrePatchBalanceMod.Rx_Pawn_Modified'; } super.InitMutator(Options, ErrorMessage); } event PreBeginPlay() { local Rx_Building_Silo_Internals Silo; local Rx_PurchaseSystem PurchaseSystem; local Rx_Vehicle_Apache Apache; local Rx_Vehicle_Orca Orca; super.PreBeginPlay(); SetTimer(5.0,true,'CheckRefDead'); Silo = Rx_Building_Silo_Internals(GetDefaultObject(Class'Rx_Building_Silo_Internals')); Silo.CreditsGain = 0.5f; PurchaseSystem = Rx_PurchaseSystem(GetDefaultObject(Class'Rx_PurchaseSystem')); PurchaseSystem.AirdropCooldownTime = AirdropCooldownTime; Apache = Rx_Vehicle_Apache(GetDefaultObject(Class'Rx_Vehicle_Apache')); Apache.Health=375; Orca = Rx_Vehicle_Orca(GetDefaultObject(Class'Rx_Vehicle_Orca')); Orca.Health=375; } function bool CheckReplacement(Actor Other) { if (Other.IsA('Rx_InventoryManager_GDI_RocketSoldier')) { Rx_InventoryManager_GDI_RocketSoldier(Other).PrimaryWeapons[0] = class'Rx_Weapon_RevisedMissileLauncher'; } if (Other.IsA('Rx_InventoryManager_Nod_RocketSoldier')) { Rx_InventoryManager_Nod_RocketSoldier(Other).PrimaryWeapons[0] = class'Rx_Weapon_RevisedMissileLauncher'; } if (Other.IsA('Rx_InventoryManager_GDI_McFarland')) { Rx_InventoryManager_GDI_McFarland(Other).PrimaryWeapons[0] = class'Rx_Weapon_RevisedFlakCannon'; } if (Other.IsA('Rx_InventoryManager_GDI_Shotgunner')) { Rx_InventoryManager_GDI_Shotgunner(Other).PrimaryWeapons[0] = class'Rx_Weapon_RevisedShotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Shotgunner')) { Rx_InventoryManager_Nod_Shotgunner(Other).PrimaryWeapons[0] = class'Rx_Weapon_RevisedShotgun'; } return true; } /** The following sets bLastHitWasDamagingPlayer wich is used in Rx_Pri_Modified to change credit gain */ function NetDamage(int OriginalDamage, out int Damage, Pawn Injured, Controller InstigatedBy, vector HitLocation, out vector Momentum, class DamageType, Actor DamageCauser) { super.NetDamage(OriginalDamage, Damage, Injured, InstigatedBy, HitLocation, Momentum, DamageType, DamageCauser); if(InstigatedBy != None && !InstigatedBy.IsA('SentinelController') && InstigatedBy.PlayerReplicationInfo != None && Rx_Pawn(Injured) != None) { Rx_Pri_Modified(InstigatedBy.PlayerReplicationInfo).bLastHitWasDamagingPlayer = true; } } /** Reduces Credit gain from a dead refinery */ function CheckRefDead() { local Rx_Building_Refinery Refinery; ForEach AllActors(class'Rx_Building_Refinery',Refinery) { if (Refinery.IsDestroyed()) { Refinery.CreditsPerTick = 1.0f; // Gets halfed once more in the Refinery class } } } final static function object GetDefaultObject(class ObjClass) { return FindObject(ObjClass.GetPackageName()$".Default__"$ObjClass, ObjClass); } defaultproperties { } Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 30, 2015 Author Share Posted August 30, 2015 I can't belive it's finally working! Thank you RypeL! This is how it should look like: class Pistol_HC extends Rx_Mutator; function bool CheckReplacement(Actor Other) { if (Other.IsA('Rx_InventoryManager')) { Rx_InventoryManager(Other).SidearmWeapons[0] = class'Rx_Weapon_Pistol_HC'; } return true; } DefaultProperties { } I had an example of what I needed in front of my eyes all the time. I am soo dumb. But hey, I am definitely going to find use for the rest of the codes that you posted Quote Link to comment Share on other sites More sharing options...
Axesor Posted August 31, 2015 Author Share Posted August 31, 2015 So, I've been making progress with my mutator and now I am stuck again. I have been trying to replace carbine in purchase terminal by my own carbine. And this error message I get when I tried to compile it. C:\...\SDK\Development\Src\Extra\Classes\AHardCore.uc(15) : Error, Can't assign Const variablesFailure - 1 error(s), 0 warning(s) And this is that part of mutator code: (1)class AHardCore extends Rx_Mutator;(2) (3) function bool CheckReplacement(Actor Other) (13) if (Other.IsA('Rx_PurchaseSystem')) (14) { (15) Rx_PurchaseSystem(Other).GDIWeaponClasses[1] = class'Rx_Weapon_Carbine_HC'; (16) } (17) if (Other.IsA('Rx_PurchaseSystem')) (18) { (19) Rx_PurchaseSystem(Other).NodWeaponClasses[1] = class'Rx_Weapon_Carbine_HC'; (20) } (21) (22) (23) return true; (24)} (25) (26) (27)DefaultProperties (28){ (29)} Don't worry, I am NOT working on Call of Duty mod Thank you for any respond Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff yosh56 Posted September 1, 2015 Totem Arts Staff Share Posted September 1, 2015 You can't change constant variables dynamically (So they have a default value and that's it). To change things regarding infantry/vehicles/weapon classes in the purchase system, you'll have to extend the purchase system and change default values. Quote Link to comment Share on other sites More sharing options...
Axesor Posted September 1, 2015 Author Share Posted September 1, 2015 Ok, got it. Let's see what I can do about it. Thank you Yosh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.