Max ammo confusion!

Search, find and discuss about Mutators!
Post Reply
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Max ammo confusion!

Post by mrfrisky330 »

Hello,

I am trying my first mod (woo!) and to start with all I want to do is change the maximum ammo the sniper rifle can have.

Having created a nice folder in the UT directory with a sub folder of "classes" I copied the sniperifle and bulletbox UC files into it changed the name to have "ROG" infront of then and changed the internal class name to match.

What I have noticed is even if I don't change the names of the files/classes if I change the maxammo amount from 50 to say 100 and do the old UCC MAKE (yes I have included the folder name in packages list in unrealtournament.ini) no errors are reported. I can add the mutator and play the game but the maxammo I set is always ignored, why is it??

If I make changes to the rifle itself e.g. rate of fire that works, but ammo amount and max ammo amount changes are ignored by UT, how do I set new values for these things??? :???:
User avatar
[JAG]Teabag
Skilled
Posts: 177
Joined: Wed Oct 01, 2008 9:18 pm
Personal rank: Clan Server Admin
Contact:

Re: Max ammo confusion!

Post by [JAG]Teabag »

Im no coder I have only modified things the way you are doing them.. re creating things in different names ect, taking things out of larger mutators to make specific things into somthing in its own right. basically learning small tasks to understand the bigger picture.
"if" your getting no errors when compiling.
are sure you have the .int file correct?
there's been many times i have done things which have compiled correctly, but it wasnt correct within the .int i created, even tho I assumed it was, when it shows in the mutator list.

you need to look at quite a few .int files for "rifles" since this is what your pretty much working with, look at the folder names and class names ect
make sure yours is done the same way.
..Image
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Max ammo confusion!

Post by Feralidragon »

Yeah, [JAG]Teabag is right.

What is probably happenning is that you did everything right with the classes and the .u file.
But, the .int might have something wrong, a mistake.
Keep in mind that mutators don't need .u files to be showed as ones in UT, UT reads every .int file in the system and shows it up in UT.
So, if the int has some sort of mistake, you can add it in the menu, but in the moment of the play, UT doesn't find the file/actor specified in the .int and simply ignores it, so then you pickup the sniper thinking that it's your own version, but it still is the standard one.
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Re: Max ammo confusion!

Post by mrfrisky330 »

That could be the case as I have not found a plain English explanation of what the syntax of the INT file should be depending on what your trying to do so I butchered this one:

[public]
Object=(Name=ZoomShockRifle.ZoomInstaGibArena,Class=Class,MetaClass=Engine.Mutator,Description="Zoom InstaGib, the beloved InstaGib with shock rifles that zoom. Duh.")


And changed it to this:

[Public]
Object=(Name=test.ROGSniperRifle,Class=Class,MetaClass=Engine.Mutator,Description="Test")


"test" is the folder name and "ROGSniperRifle" is the modified sniper rifle class specified in "ROGSniperRifle.uc"

Where did I go wrong and how do I fix it??
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Max ammo confusion!

Post by Feralidragon »

Oh, I got your problem now.
You have to build a 3rd class, the mutator class.

What you call with the int file now is the sniper itself, which is wrong, you have to call a mutator instead.

Go to the Arena mutators, subclass one and place your weapon as replacement.

Then go to your int and place there the mutator, not the sniper.
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Re: Max ammo confusion!

Post by mrfrisky330 »

So how do I do that then??

I want it to work like the "laser sniper rifle" mutator where by its the normal game with all the weapons except (like in that mutator) the sniper rifle is modified :)
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Max ammo confusion!

Post by Feralidragon »

mrfrisky330 wrote:So how do I do that then??

I want it to work like the "laser sniper rifle" mutator where by its the normal game with all the weapons except (like in that mutator) the sniper rifle is modified :)
Ok, you have the arena or replace every single weapon mutator:

Code: Select all

//=============================================================================
// YourSniperArena.
// replaces all weapons and ammo with YourSniper and YourSniper ammo
//=============================================================================

class YourSniperArena expands Arena;

defaultproperties
{
    AmmoName=YourSniperAmmo
    AmmoString="YourPackage.YourSniperAmmo"
    WeaponName=YourSniper
    WeaponString="YourPackage.YourSniper"
    DefaultWeapon=class'YourSniper'
}

And you have the mutator to replace the snipers only:

Code: Select all

class YourSniperReplacer expands Mutator;

function bool CheckReplacement (Actor Other, out byte bSuperRelevant)
{
	//YourSniper replacement
	if ( Other.IsA('SniperRifle') && !Other.IsA('YourSniper') )
	{
		ReplaceWith(Other,"YourPack.YourSniper");
		return False;
	}
    else if ( Other.IsA('BulletBox') && !Other.IsA('YourSniperAmmo') )
	{
		ReplaceWith(Other,"YourPack.YourSniperAmmo");
		return False;
	}

return True;
}
Now it's up to you to choose the mutator that you want: Arena is to replace every weapon, while the other is to replace the sniper only.
Btw, every quote in the code is really to use it.
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Re: Max ammo confusion!

Post by mrfrisky330 »

Ok, using the second bit of code I created a file called "ROGSniperReplacer.uc"

Into which I typed:

class ROGSniperReplacer expands Mutator;

function bool CheckReplacement (Actor Other, out byte bSuperRelevant)
{
//YourSniper replacement
if ( Other.IsA('SniperRifle') && !Other.IsA('ROGSniperRifle') )
{
ReplaceWith(Other,"Test.ROGSniperRifle");
return False;
}
else if ( Other.IsA('BulletBox') && !Other.IsA('ROGBulletBox') )
{
ReplaceWith(Other,"YourPack.ROGBulletBox");
return False;
}

return True;
}

Is this correct and what do I need to put in the INT file to get it to work?
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Max ammo confusion!

Post by Feralidragon »

mrfrisky330 wrote:Ok, using the second bit of code I created a file called "ROGSniperReplacer.uc"

Into which I typed:

class ROGSniperReplacer expands Mutator;

function bool CheckReplacement (Actor Other, out byte bSuperRelevant)
{
//YourSniper replacement
if ( Other.IsA('SniperRifle') && !Other.IsA('ROGSniperRifle') )
{
ReplaceWith(Other,"Test.ROGSniperRifle");
return False;
}
else if ( Other.IsA('BulletBox') && !Other.IsA('ROGBulletBox') )
{
ReplaceWith(Other,"YourPack.ROGBulletBox");
return False;
}

return True;
}

Is this correct and what do I need to put in the INT file to get it to work?
It's right like that, only YourPack must be replaced by Test in the code (red).

The int will be like this:

[Public]
Object=(Name=Test.ROGSniperReplacer,Class=Class,MetaClass=Engine.Mutator,Description="Test")
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Re: Max ammo confusion!

Post by mrfrisky330 »

Whoops! I have corrected the career ruining typo lol!

Have compiled the package, no warning or errors so why is it that now when I run UT it does not now appear in the list of available mutators???
mrfrisky330
Novice
Posts: 14
Joined: Fri Dec 05, 2008 10:05 am
Personal rank: Elite

Re: Max ammo confusion!

Post by mrfrisky330 »

Mystery solved!

Some silly muppet forgot to put the words "Engine." before "Mutator" in the INT file, if I could feel more stupid i'd like to see that!! :oops:

Does the description in the INT file have to match the package name or can I put anything in it?

Many, many thanks for your patience! I am now suitably in the know to go and really ruin the balance of the game!!! :D
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Max ammo confusion!

Post by Feralidragon »

mrfrisky330 wrote:Mystery solved!

Some silly muppet forgot to put the words "Engine." before "Mutator" in the INT file, if I could feel more stupid i'd like to see that!! :oops:

Does the description in the INT file have to match the package name or can I put anything in it?

Many, many thanks for your patience! I am now suitably in the know to go and really ruin the balance of the game!!! :D
No problem :tu:

And no, the int file doesn't have to match the package name, people usually makes it match just to make it more organized and to identify the correct files and such. But it works both ways.
Post Reply