Why won't my mutator work ?

Search, find and discuss about Mutators!
Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Why won't my mutator work ?

Post by Red_Fist » Sun Apr 30, 2017 8:41 pm

Without even posting code, everything compiles no complaints, but almost 2 identical mutates, one won't work.

Just look at the code for NoRedeemer, or NoPowerups. all I did was replace "redeemer" with SniperRifle.

I also tried the no powerups code and replaced text for other items.

I made the .U file and the int file, it all shows up, but just won't work.

I even seen an example online, they put the, return false; in it's own brackets, and that didn't work either.

I am making a new class under mutators, is that wrong ?
Binary Space Partitioning

User avatar
Barbie
Godlike
Posts: 1722
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Why won't my mutator work ?

Post by Barbie » Sun Apr 30, 2017 11:34 pm

Red_Fist wrote:Without even posting code
It probably has only a few lines, why didn't you post it?
all I did was replace "redeemer" with SniperRifle.
Let's see. Original:
NoRedeemer.uc
Show

Code: Select all

//=============================================================================
// NoRedeemer.
// removes all redeemers
//=============================================================================

class NoRedeemer expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	if ( Other.IsA('WarHeadLauncher') )
		return false;

	return true;
}

defaultproperties
{
}
Replaced "Redeemer" with "SniperRifle":
SniperRifle.uc
Show

Code: Select all

//=============================================================================
// SniperRifle.
// removes all SniperRifles
//=============================================================================

class NoSniperRifle expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	if ( Other.IsA('WarHeadLauncher') )
		return false;

	return true;
}

defaultproperties
{
}
You see the problem? So better always post the code... No code, no diagnostic. ;)
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Why won't my mutator work ?

Post by Red_Fist » Sun Apr 30, 2017 11:47 pm

I was going to just post the code.(s)

But I sure don't see what you did or are doing, they look the same other than it will still only remove the warhadlauncher ?

Code: Select all

//=============================================================================
// NoItemz6.
//=============================================================================
class NoItemz6 expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	if ( Other.IsA('SniperRifle') )
		return false;

	return true;
}

defaultproperties
{
}

And I tried this from the NoPowerUps, mutator

Code: Select all

//=============================================================================
// NoItemz.
//=============================================================================
class NoItemz expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	if ( Other.IsA('HealthPack') || Other.IsA('UT_Shieldbelt') || Other.IsA('UT_Invisibility') || Other.IsA('UDamage') || Other.IsA('HealthVial') || Other.IsA('Health') || Other.IsA('MedBox') || Other.IsA('RazorAmmo') || Other.IsA('Eightball') || Other.IsA('ShellBox') || Other.IsA('ASMD') || Other.IsA('PAAmmo') || Other.IsA('ASMDAmmo') || Other.IsA('FlakBox') || Other.IsA('RifleAmmo') || Other.IsA('FlakShellAmmo') || Other.IsA('RifleRound') || Other.IsA('RocketCan') || Other.IsA('Sludge') || Other.IsA('Clip') || Other.IsA('Shells') || Other.IsA('StingerAmmo') || Other.IsA('BioAmmo') || Other.IsA('BladeHopper') || Other.IsA('BulletBox') || Other.IsA('RifleShell') || Other.IsA('FlakAmmo') || Other.IsA('Miniammo') || Other.IsA('EClip') || Other.IsA('RocketPack') || Other.IsA('ShockCore') || Other.IsA('SuperShockCore') || Other.IsA('Bandages') || Other.IsA('SuperHealth') || Other.IsA('NaliFruit') || Other.IsA('Amplifier') || Other.IsA('AutoMag') || Other.IsA('FlakCannon') || Other.IsA('GESBioRifle') || Other.IsA('Minigune') || Other.IsA('QuadShot') || Other.IsA('Razojack') || Other.IsA('Rifle') || Other.IsA('Stinger') || Other.IsA('ChainSaw') || Other.IsA('enforcer') || Other.IsA('Doubleenforcer') || Other.IsA('minigun2') || Other.IsA('PulseGun') || Other.IsA('Ripper') || Other.IsA('SniperRifle') || Other.IsA('ut_biorifle') || Other.IsA('UT_Eightball') || Other.IsA('UT_FlakCannon') || Other.IsA('WarHeadLauncher') )

return false;

	return true; 
}

defaultproperties
{
}

go ahead and laugh, but I tried it with one or 2 changed,

Neither work

I am trying to get it so a map starts out with no inventory.
Binary Space Partitioning

User avatar
Barbie
Godlike
Posts: 1722
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Why won't my mutator work ?

Post by Barbie » Sun Apr 30, 2017 11:55 pm

Just add some debug log lines, run a map and after that have a look into UnrealTournament.log to see if your Mutator is used at all. (The second log() will add a lot of lines.)

Code: Select all

class NoItemz6 expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant) {

	if ( Other.IsA('SniperRifle') )
	{
		log(Other @ "denied");
		return false;
	}
	log(Other @ "allowed");
	return true;
}

defaultproperties {
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
sn260591
Average
Posts: 54
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Why won't my mutator work ?

Post by sn260591 » Mon May 01, 2017 7:12 am

Red_Fist wrote:Without even posting code, everything compiles no complaints, but almost 2 identical mutates, one won't work.

Just look at the code for NoRedeemer, or NoPowerups. all I did was replace "redeemer" with SniperRifle.

I also tried the no powerups code and replaced text for other items.

I made the .U file and the int file, it all shows up, but just won't work.

I even seen an example online, they put the, return false; in it's own brackets, and that didn't work either.

I am making a new class under mutators, is that wrong ?
Maybe you forgot to compile the script?
Attachments
Буфер обмена02.png
Буфер обмена02.png (7.57 KiB) Viewed 2237 times
Sorry for my bad English

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Why won't my mutator work ?

Post by sektor2111 » Mon May 01, 2017 8:59 am

Red_Fist wrote://=============================================================================
// NoItemz.
//=============================================================================
class NoItemz expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if ( Other.IsA('HealthPack') || Other.IsA('UT_Shieldbelt') || Other.IsA('UT_Invisibility') || Other.IsA('UDamage') || Other.IsA('HealthVial') || Other.IsA('Health') || Other.IsA('MedBox') || Other.IsA('RazorAmmo') || Other.IsA('Eightball') || Other.IsA('ShellBox') || Other.IsA('ASMD') || Other.IsA('PAAmmo') || Other.IsA('ASMDAmmo') || Other.IsA('FlakBox') || Other.IsA('RifleAmmo') || Other.IsA('FlakShellAmmo') || Other.IsA('RifleRound') || Other.IsA('RocketCan') || Other.IsA('Sludge') || Other.IsA('Clip') || Other.IsA('Shells') || Other.IsA('StingerAmmo') || Other.IsA('BioAmmo') || Other.IsA('BladeHopper') || Other.IsA('BulletBox') || Other.IsA('RifleShell') || Other.IsA('FlakAmmo') || Other.IsA('Miniammo') || Other.IsA('EClip') || Other.IsA('RocketPack') || Other.IsA('ShockCore') || Other.IsA('SuperShockCore') || Other.IsA('Bandages') || Other.IsA('SuperHealth') || Other.IsA('NaliFruit') || Other.IsA('Amplifier') || Other.IsA('AutoMag') || Other.IsA('FlakCannon') || Other.IsA('GESBioRifle') || Other.IsA('Minigune') || Other.IsA('QuadShot') || Other.IsA('Razojack') || Other.IsA('Rifle') || Other.IsA('Stinger') || Other.IsA('ChainSaw') || Other.IsA('enforcer') || Other.IsA('Doubleenforcer') || Other.IsA('minigun2') || Other.IsA('PulseGun') || Other.IsA('Ripper') || Other.IsA('SniperRifle') || Other.IsA('ut_biorifle') || Other.IsA('UT_Eightball') || Other.IsA('UT_FlakCannon') || Other.IsA('WarHeadLauncher') )

return false;

return true;
}

defaultproperties
{
}
Makes no sense... really. First of All "minigune" doesn't even exist. Then... you will have no weapon, then why all these ??? For insanity I'll show you something simple:

Code: Select all

// NoItemz.
//=============================================================================
class NoItemz expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
   if ( Inventory(Other) != None ) //if ( Other.IsA('Inventory')) - or Pickup ? USE A 
  // SINGLE PARENT INSTEAD of PROCESSING a MOUNTAIN OF CRAP.
  ///  Map might have various items (like Minigun
  // not <minigune> which won't be removed ) and whatever Saber
 // XanRifle which are SEPARATE classes but Inventory type
   return false;

   return true;
}

defaultproperties
{
}
Else, if you play a game-type which doesn't load mutators, then, it won't work.
Aside, use notepad++ and UMake for your safety at working at these. For future debugging, please post a log about game-type...

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Why won't my mutator work ?

Post by Red_Fist » Mon May 01, 2017 5:42 pm

As for gametype I tried MH DM SP and a pure sever, with or without oldskool, no work.

but yet the ones they have work on the same map and same gametype tests.

All I did was change ONE word of an existing working UT mutator, compiled perfectly, made an int file, we should not have to look in logs or wonder why it don't work. AND using perfectly legit UT item classes AND compiles, AND shows up in-game.
It's not like I am creating the code, or a huge programing effort.

I will try the log though, but it seems like the new mutator isn't being found.
Binary Space Partitioning

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Why won't my mutator work ?

Post by sektor2111 » Tue May 02, 2017 12:10 am

Red_Fist wrote:I will try the log though, but it seems like the new mutator isn't being found.
If you are using NotePad++ you'll have no pain. If you are using Editor perhaps things are not nice, and... you have to SAVE Package Compiled, unless at closing/crashing Editor you'll have nothing else in System than an Editor.log file. I'm using Editor at doing MyLevel Stuff and... some stock fixing for conforming packs operations. I'll give you a sample which can be compiled but not than much from Editor.

Code: Select all

class DeathMatchPlus expands BotPack.DeathMatchPlus;
This game-type is being visible by any player in browser at doing a server, but is a different thing than default DM, but Editor will not accept this name - at least I was denied from doing this stunt. In exchange UCC has nothing against this way, and it even do works properly as long as it doesn't include all load from Editor.
For such a mutator you might want to forget Editor and use UCC and Text Editors...

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Why won't my mutator work ?

Post by Red_Fist » Tue May 02, 2017 1:57 am

I did the first 3 or 4 with UCC, the others I used the editor, edited code, compiled, clicked on package checkbox, and saved the .u

but the dang thing should work right away.

I will try the log entry thing and see what it says. probably blank nothing :mad2:
Binary Space Partitioning

SC]-[WARTZ_{HoF}
Adept
Posts: 393
Joined: Tue Feb 21, 2012 7:29 pm

Re: Why won't my mutator work ?

Post by SC]-[WARTZ_{HoF} » Tue May 02, 2017 4:02 am

This is a simple mutator from what I'm reading. I'm guessing you have another mod conflicting or you are just not setting this mutator up the right way.
Image
Image
Image

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Why won't my mutator work ?

Post by sektor2111 » Tue May 02, 2017 10:37 am

Perhaps INT file is wrong or other stuff... Else... I might be doing something like this and... sharing it if you don't mind, because... it do looks simple... Or Not ?

Edit:
It's DONE ! However, I don't see any purpose for such things :omfg:
Drop it in System and... pick mutator called No Items Mutator V1.00
In MonsterHunt you are dead by default... and Bot is retarded.
[attachment=0]NoItems_SK.zip[/attachment]

:noidea
Attachments
NoItems_SK.zip
Bad Idea ? Purpose ?
(1.27 KiB) Downloaded 59 times

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Why won't my mutator work ?

Post by Red_Fist » Tue May 02, 2017 5:32 pm

LoL, it is weird,

I will check it out, this whole code programing thing always makes me feel like there is some OTHER thing wrong, like syntax or if the brackets are surrounding the wrong things, or spelling stupid minigun wrong. :oops:
Binary Space Partitioning

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Why won't my mutator work ?

Post by sektor2111 » Tue May 02, 2017 6:05 pm

Hey, if this is an attempt to solve bad setup (removal with any matter) and it doesn't do entire job, I went to another solution base on "patience", so even maps with static items are properly slapped down.

Now, a bit of... reversal. Mutator making weapons to show up at some mutate command after a previous removal - in case of bad feelings, allowing user to restore weapons back. Huh ? Or... by admin... and/or removal on demand :mrgreen: .

Hint: Actually I don't think is necessary to remove all weapons from Level... just owned ones, the rest can be sent to... rest, LOL.

Red_Fist
Godlike
Posts: 1537
Joined: Sun Oct 05, 2008 3:31 am

Re: Why won't my mutator work ?

Post by Red_Fist » Tue May 02, 2017 6:41 pm

Nope it's working,,, too good, :tu:

But one must be able to keep default weapon, just the pickups-weapons-health need be gone.

I didn't look at your code yet, but whatever you did works, However running with the other mutator MobDrops his oldskool hack won't allow yours to work.
viewtopic.php?f=8&t=12151

your mutator is too powerful :P

Actually using an ini to check off which items you don't want (ALL gametypes), but always keep the default weapon in hand at start.
Like "replace" with "None" of which includes all the old Unreal weapons as well.
Binary Space Partitioning

User avatar
sektor2111
Godlike
Posts: 4138
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Why won't my mutator work ?

Post by sektor2111 » Wed May 03, 2017 12:04 am

Me saying:
The way of removing weaponry using CheckReplacement might be pretty much outdated. Given my Not noob coding knowledge but Extra-Noob rank, I think I can do a mutator which can remove and restore weapons on demand. Agree with default weapon part, this feature can go in account and... I'm not sure if old way of removing items will be answer. Probably destroying items is not an answer - like in real life, if you ruin things you might feel sorry and you'll want them back at a moment. Weaponry (like monsters) can be deactivated and reactivated as needed... Code is probably simple to do, harder was idea...

Post Reply