PDA

View Full Version : Getting Unreal & UT weapons to exist simultaneously?


WildWing
30th Oct 2001, 07:42 AM
What I'm trying to do on my map is get Unreal & UT weapons to exist within a UT Death Match game type, without UT weapons replacing their Unreal counterparts as they always do... Now after trying to switch game types over and over, it looks like my last chance at doing this is to create a new subclass under "Tournament Weapon" in the actor class browser. The thing is, I did try this with an Automag, I copied the script for the Automag, created a new subclass under "Tournament Weapon" called "UT Automag", pasted the script and changed all that I THOUGHT needed to be changed so that it would worK correctly in a UT level with being replaced, then compiled it, I got no errors but... But I was able to get the Automag into the game but when firing it, it did none of it's animation or firing sounds, and left boxes or ammunition pickups in the air for it's projectile? :p Anyway can any of you poeple out there that know how to code tell what I didi wrong with this, I'm almost sure it could be done, just that I messed up somewhere in the coding. But I came pretty close to getting it to work, the Automag did show up unreplaced by a UT's Enforcer, just disfunctional:p

Postal
30th Oct 2001, 03:05 PM
have the map not call the dmutator, like the ut intro map, then you can have all the guns

WildWing
30th Oct 2001, 08:16 PM
Originally posted by Postal
have the map not call the dmutator, like the ut intro map, then you can have all the guns What?

Wormbo
31st Oct 2001, 05:23 AM
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:
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
31st Oct 2001, 06:21 AM
Originally posted by Wormbo
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:
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.) Ok, I'm going to the first suggestion first, but twhere is this "Botpack.DMMutator" located in the Actor Class?

Wormbo
31st Oct 2001, 07:09 AM
Actor -> Info -> Mutator -> DMMutator

WildWing
31st Oct 2001, 08:25 AM
Originally posted by Wormbo
Actor -> Info -> Mutator -> DMMutator Ok, I think I'll try creating a hidden Actor with this code in it instaed, because I am doing a map that I want this to be a part of, so how do I do that? (create a hidden actor with this code in it) Please explain this in mass detail, I know nothing about coding. :D

usaar33
31st Oct 2001, 10:41 PM
download oldskool amp'd at my site and look at the source of olweapons.oldskool

WildWing
3rd Nov 2001, 08:59 AM
Originally posted by Wormbo
Actor -> Info -> Mutator -> DMMutator I did what you said as far as creating an Actor subclassed from "DMMutator" but when I try to play the level to see if things are working correctly, I get an error message saying "Can't find EditPackage MyMutator" What am I doing wrong?

Wormbo
3rd Nov 2001, 09:04 AM
Can't find EditPackage MyMutator
:confused:
Did you compile your stuff?

WildWing
3rd Nov 2001, 10:59 AM
Originally posted by Wormbo

:confused:
Did you compile your stuff? What I did was subclass "DMMutator" past in the script for the new Actor and at the upper left corner of the Actor Class browser press "Compile changed scripts" Did I miss something or was this done totally wrong anyway, how would you do it?

Wormbo
3rd Nov 2001, 02:34 PM
I'm not using UnrealEd for coding stuff so I can't tell if you did something wrong.
I'm working the way described here (http://www.planetunreal.com/unrealed/index.asp?action=spec_art&cat_id=9&art_id=151) (from '10 - Don't Use UnrealEd' to '13 - How You Build Your Package')
I use EditPad Lite (http://www.EditPadLite.com) to edit the .UC files created in the tutorial.

WildWing
3rd Nov 2001, 11:00 PM
Originally posted by Wormbo
I'm not using UnrealEd for coding stuff so I can't tell if you did something wrong.
I'm working the way described here (http://www.planetunreal.com/unrealed/index.asp?action=spec_art&cat_id=9&art_id=151) (from '10 - Don't Use UnrealEd' to '13 - How You Build Your Package')
I use EditPad Lite (http://www.EditPadLite.com) to edit the .UC files created in the tutorial. I downloaded EditPad Lite, so what do I do export the "DMMutator" script then open it up with EditePad? And what exactly do I do with this code you supplied me with, do I take out the line of the original "DMMutator" code with the weapon replacment stuff and put in the code you gave me. Or just paste what you gave me right into this new Actor?

WildWing
12th Nov 2001, 04:16 PM
I think I'm getting close to solving this puzzle, I was able to get the UNREAL Minigun into the game but for some reason it won't fire? I was thinking that it has something to do with selecting those animation meshes from the mesh browser but I'm not sure, any ideas?