Dispersion Pistol on a map query

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
EvilGrins
Godlike
Posts: 9819
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Dispersion Pistol on a map query

Post by EvilGrins »

Everytime I edit a Dispersion Pistol onto a map, when I go into play it for some reasons it turns into an Impact Hammer.

How do I get it not to change?
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
Barbie
Godlike
Posts: 2829
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Dispersion Pistol on a map query

Post by Barbie »

Everytime I edit a Dispersion Pistol onto a map, when I go into play it for some reasons it turns into an Impact Hammer.
See DMMutator.uc, function CheckReplacement():

Code: Select all

...
// replace Unreal I inventory actors by their Unreal Tournament equivalents
...
if ( Other.IsA('DispersionPistol') )
{
	ReplaceWith( Other, "Botpack.ImpactHammer");
	return false;
}
How do I get it not to change?
Use another Mutator instead of Deathmatch.
"If Origin not in center it be not in center." --Buggie
User avatar
EvilGrins
Godlike
Posts: 9819
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Dispersion Pistol on a map query

Post by EvilGrins »

Barbie wrote:Use another Mutator instead of Deathmatch.
Deathmatch is a gametype, not a mutator... and the edit I'm doing this for is CTF.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: Dispersion Pistol on a map query

Post by SC]-[WARTZ_{HoF} »

EvilGrins wrote:
Barbie wrote:Use another Mutator instead of Deathmatch.
Deathmatch is a gametype, not a mutator... and the edit I'm doing this for is CTF.
CTFGame extends TeamGamePlus which extends DeathMatchPlus.
DeathMatch's MutatorClass=class'Botpack.DMMutator' by default.
DeathMatch's DefaultWeapon=class'Botpack.ImpactHammer' which is why you get the ImpactHammer in place of the DispersionPistol.

I think what you really need to do is include a mutator with this map edit that replaces the default weapon(ImpactHammmer)with the DispersionPistol.
Image
Image
Image
User avatar
PrinceOfFunky
Godlike
Posts: 1204
Joined: Mon Aug 31, 2015 10:31 pm

Re: Dispersion Pistol on a map query

Post by PrinceOfFunky »

SC]-[WARTZ_{HoF} wrote:
EvilGrins wrote:
Barbie wrote:Use another Mutator instead of Deathmatch.
Deathmatch is a gametype, not a mutator... and the edit I'm doing this for is CTF.
CTFGame extends TeamGamePlus which extends DeathMatchPlus.
DeathMatch's MutatorClass=class'Botpack.DMMutator' by default.
DeathMatch's DefaultWeapon=class'Botpack.ImpactHammer' which is why you get the ImpactHammer in place of the DispersionPistol.

I think what you really need to do is include a mutator with this map edit that replaces the default weapon(ImpactHammmer)with the DispersionPistol.
Or maybe he can change DefaultWeapon property in the .ini?
User avatar
papercoffee
Godlike
Posts: 10457
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Dispersion Pistol on a map query

Post by papercoffee »

PrinceOfFunky wrote:
SC]-[WARTZ_{HoF} wrote:
EvilGrins wrote:
Barbie wrote:Use another Mutator instead of Deathmatch.
Deathmatch is a gametype, not a mutator... and the edit I'm doing this for is CTF.
CTFGame extends TeamGamePlus which extends DeathMatchPlus.
DeathMatch's MutatorClass=class'Botpack.DMMutator' by default.
DeathMatch's DefaultWeapon=class'Botpack.ImpactHammer' which is why you get the ImpactHammer in place of the DispersionPistol.

I think what you really need to do is include a mutator with this map edit that replaces the default weapon(ImpactHammmer)with the DispersionPistol.
Or maybe he can change DefaultWeapon property in the .ini?
I see a massive mismatch coming.
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: Dispersion Pistol on a map query

Post by SC]-[WARTZ_{HoF} »

papercoffee wrote:
PrinceOfFunky wrote:
SC]-[WARTZ_{HoF} wrote:
EvilGrins wrote:
Barbie wrote:Use another Mutator instead of Deathmatch.
Deathmatch is a gametype, not a mutator... and the edit I'm doing this for is CTF.
CTFGame extends TeamGamePlus which extends DeathMatchPlus.
DeathMatch's MutatorClass=class'Botpack.DMMutator' by default.
DeathMatch's DefaultWeapon=class'Botpack.ImpactHammer' which is why you get the ImpactHammer in place of the DispersionPistol.

I think what you really need to do is include a mutator with this map edit that replaces the default weapon(ImpactHammmer)with the DispersionPistol.
Or maybe he can change DefaultWeapon property in the .ini?
I see a massive mismatch coming.
What actually happens is if another weapon replacement mutator is used with a map with a weapon with altered default properties you'd get that weapon and the mutator replacement weapon in the same exact spot. It's never a good idea to add a weapon pickup and alter the weapon's default properties within a map.
Image
Image
Image
User avatar
ExpEM
Adept
Posts: 298
Joined: Wed Nov 09, 2016 1:48 am

Re: Dispersion Pistol on a map query

Post by ExpEM »

3 things you need to do:

1: Subclass TournamentWeapon with a class called DPistol.
-Copy and paste all code and properties for the DispersionPistol into DPistol.
-This is to prevent DMMutator from removing it from game.
-You may want to add better bot AI while your at it.

2: Subclass Mutator with a class called MutDPistol.
-Add this Code:

Code: Select all

class MutDPistol expands Mutator;

function PreBeginPlay()
{
	DefaultWeapon = Class'DPistol'; //Make DefaultWeapon a DPistol.
}

function bool AlwaysKeep(Actor Other)
{
	if ( Other.IsA('DPistol') ) //Don't remove DPistols from level.
		return true;

	if ( NextMutator != None )
		return ( NextMutator.AlwaysKeep(Other) );

	return false;
}

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	if ( Other.IsA('ImpactHammer') ) //Swap ImpactHammers with DPistols.
	{
		ReplaceWith(Other, "MyLevel.DPistol"); //Note if you don't use MyLevel then change to the Package the one you use.
		return false;
	}

	bSuperRelevant = 0;
	return true;
}
-Note the classes are hard coded and not variables so they can be accessed at PreBeginPlay().

3: Subclass Actor with a class of any name.
-Add this code:

Code: Select all

class MyActor expands Actor; //Whatever name you choose.
function PostBeginPlay()
{
	Level.Game.BaseMutator.AddMutator(Spawn(class'MyLevel.MutDPistol')); //Again change MyLevel to whatever package you use.
}
-Add this class anywhere in your level and at runtime it will add the mutator to the game.
EDIT:
Class 3 May require some Authority NetCode to use online, that however is beyond my ability to code.
EDIT2:
Instead of making DPistol I would recomend using OLWeapons.OLDPistol (included with Oldskool) as it already has proper bot support.
Signature goes here.
User avatar
EvilGrins
Godlike
Posts: 9819
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Dispersion Pistol on a map query

Post by EvilGrins »

Hmmmm... maybe I'll just stick with the Oldskool default weapon selection I normally use, then.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Dispersion Pistol on a map query

Post by MrLoathsome »

If you run that UT2U1 mutator I did, you could have Dispersion Pistols and Impact Hammers on the
map at the same time I believe.
blarg
User avatar
sektor2111
Godlike
Posts: 6419
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Dispersion Pistol on a map query

Post by sektor2111 »

You can setup another brother of Dispersion which is NOT in account by default DMMutator used in every game from Botpack (yeah geniuses telling me to not have other game-types). Other game-type might allow presence of any STUFF from any map with no replacements and everything running in original. Else a new weapon aka New Dispersion WILL NEVER FIRE in VANILLA original server ON-LINE without writing and changing a few lines and adding 2 missing states (like I did to some weapon Saber stupid useless thing), and then you might have a combination Weapon/TournamentWeapon with no issues ON LINE/OFF LINE for every UT Player from Planet Earth. Of course, this is a matter of writing codes not only painting walls in maps.
Post Reply