Trying to fix a code to get Unreal & UT weapons to work together

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

WildWing

New Member
Sep 16, 2001
87
0
0
New York City
Visit site
I'm trying to get Unreal and UT weapons to work right alongside of eachother without UT weapons replacing Unreal weapons. Also I like this to be scripted right into the game so there is no requirement to download a MOD or Mutator to get this to work. Someone passed the idea onto the to subclass the "DMMutator" located in the Mutator class or the Actor class browser and remove the weapon replacment coding, I did that but when I placed the new Actor in the level and went to play it. I got some error message saying "Can't find EditPackage MyMutator" or something like this, anyone know what I did wrong?
 

WildWing

New Member
Sep 16, 2001
87
0
0
New York City
Visit site
Originally posted by 2COOL4-U
The system cannot find the file MyMutator.u file, did you compile the code before starting UT?
After subclassing the the new Actor from "DMMutator" I did go to the top of the Actor Class Browser abnd press compile all changed changed scripts? Is there something else to do, how would you go about do this?
 

WildWing

New Member
Sep 16, 2001
87
0
0
New York City
Visit site
Originally posted by usaar33
It is inside the umod.
Alright, I looked at the code inside of the UMOD and yeah it's looks like it's self explanatory to someone who already know how to code but I don't know anything! Someone else gave me a code to accomplish what I'm trying to do, I don't understand it too well either but it appears to be much simpler than the one inside the UMOD... Maybe you could take a look at this code and tell what to do with it, I don't know if I'm to sublass the "DMMutator" and take out the weapon replacement line of and put this in or just create a new subclass and put this new code in and use it asa game type, the thing is I'd like this to be scripted right into the level so hat it would require the addtional download or a MOD or Mutator, the code he gave me and what he said about it is below. I attempted to compile this and it did do something... it's just that you UT didn't find the edit package, so if someone could also tell me how to compile correctly that would be cool.
------------------------------------------------------------------------------------


Every GameType class has a BaseMutatorClass property which is set to class'Botpack.DMMutator' for all UT gametypes.

Try this:
Subclass Botpack.DMMutator and remove the weapon replacement stuff from CheckReplacement(). If you want to create a new gametype use the new subclass as the BaseMutator.
If you want to write a mutator put the following code in it:


code:----------------------------------------------------------------------------

function ReplaceDMMutator()
{
local Mutator M, PrevMutator, BaseNextMutator, NewBaseMutator;

log("Replacing BaseMutator...");
if ( Level.Game.IsA('DeathMatchPlus') && Level.Game.BaseMutator.Class == Class'Botpack.DMMutator' ) {
For ( M = Level.Game.BaseMutator; M != None; M = M.NextMutator )
if ( M.NextMutator == Self ) {
PrevMutator = M;
break;
}
if ( PrevMutator != None )
PrevMutator.NextMutator = NextMutator;
BaseNextMutator = Level.Game.BaseMutator.NextMutator;

NewBaseMutator = Spawn(class'YourPackage.YourNewDMMutatorSubclass');
if ( NewBaseMutator != None ) {
NewBaseMutator.NextMutator = BaseNextMutator;
Level.Game.BaseMutator.Destroy();
Level.Game.BaseMutator = NewBaseMutator;
}
log("BaseMutator now is"@Level.Game.BaseMutator);
}
else
log("BaseMutator still is"@Level.Game.BaseMutator);
}
--------------------------------------------------------------------------------

Call ReplaceDMMutator() inside PreBeginPlay() to replace the base mutator.

If you just want to make a map it might become more difficult. Try creating a hidden actor that has the replacement code inside and put it somewhere in your map. (I don't know if this works.)
 

WildWing

New Member
Sep 16, 2001
87
0
0
New York City
Visit site
Originally posted by usaar33
It is inside the umod.
Usaar23, does this happen to you, if so what do you do to get around it? I finnally got some coding to work I was able to bring the Unreal Minigun in a UT level. But it wouldn't fire though it stated that it had 50 bullets of ammo, any ideas.

I should mention that what I did was subclass 'Weapon' then followed the usual new package stuff, paste a code that was to replace the UT_eightball with the unreal eightball, now that code compiled fine! I was then told by someone the go to the default properties of the new weaponand match them to the old unreal eightball but what happened is mentioned above.