Ripper Mutator

  • 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.

OshadowO

Irregular
Feb 10, 2000
4,775
0
36
CA
I'm not sure how to do it but I'm pretty sure that it would end up slowing down your system.
 

simianangel

New Member
Aug 12, 2001
46
0
0
46
Delaware, USA
I am not 100% sure, but i think you will have to copy the ripper's projectile- botpack.razor2 and find the line that looks like this:

NumWallHits++;
SetTimer(0, False);
MakeNoise(0.3);
if ( NumWallHits > 6 )
Destroy();



now, change the number of times it needs to hit walls to be destroyed from 6 to something large, for example:

if ( NumWallHits >100 )
Destroy();



then save as a new razor projectile and create a copy of ripper with a new name that points to your new razor projectile as its primary ProjectileClass in default properties.

you may also want to increase the lifespan value under the default properties of your new razor projectile.

I have not tested this so i am not sure, but i do know that if it does work you will slow down your system just as OshadowO has stated, even if there is only one of them(new ripper weapon) in the level.
 

FireSlash

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
38
Central Ohio
www.unrealannihilation.com
replace
Code:
         NumWallHits++;
		SetTimer(0, False);
		MakeNoise(0.3);
		if ( NumWallHits > 5 )
			Destroy();
		Velocity -= 2 * ( Velocity dot HitNormal) * HitNormal;  
		SetRoll(Velocity);
with
Code:
	SetTimer(0, False);
		MakeNoise(0.3);
		Velocity -= 2 * ( Velocity dot HitNormal) * HitNormal;  
		SetRoll(Velocity);

and i belive hes right. in defaule properties, change
Code:
LifeSpan=6.000000
to
Code:
LifeSpan=6000000
 

Twisted Metal

Anfractuous Aluminum
Jul 28, 2001
7,122
3
38
39
Long Island, NY
Ok, thank you all, I will have to try this later. However I have another question. How would I make these changes without overwriting old settings. I want to be able to go back to normal if it does not work out well. Is it hard to make this into a mutator? Any tutorials that would show me? Sorry, I am new to this UScript stuff. In fact, I am new to programming in general. I passed Pascal 1 with a 100 average and Pascal 2 with a 98 average last year. I'm taking C++ 1 and 2 this year. Thanks again guys. :)
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
you should never over-write the core classes anyway :)

chimeric at PU has a good tute on making a basic weapon replacement i think.
basically, you do this:

create a new ripper & new ripper blade as subclasses of the originals.
create a mutator that on loading a map goes through & replaces all rippers with your ripper class.
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
You know, a LifeSpan of zero means forever, so that would be the ultimate.
Besides you spare your fingertips when you don't have to type in seven digits ;)
You could build it right into a mutator very easy:
I pressume you know the basics...
Make a file for the weapon, subclassing the ripper and make the suggested changes, make a subclass of the ripperblade and make your ripper use it as it's projectile, then make a class subclassing Mutator and make a classic switcheroo:
Code:
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if ( Other.IsA('ripper') && !Other.IsA('MyRipper')) //Dont forget or you'll get an endless loop
{
ReplaceWith(Other, "MyPackage.MyRipper");
return false;
}
Return True;  //Don't forget, or the map can't spawn the actor...
}

If your ripper has the correct settings, this mutator will change all rippers into "MyRipper" that will bounce until the end of time...
 

Twisted Metal

Anfractuous Aluminum
Jul 28, 2001
7,122
3
38
39
Long Island, NY
Originally posted by papapishu
You know, a LifeSpan of zero means forever, so that would be the ultimate.
Besides you spare your fingertips when you don't have to type in seven digits ;)
You could build it right into a mutator very easy:
I pressume you know the basics...
Make a file for the weapon, subclassing the ripper and make the suggested changes, make a subclass of the ripperblade and make your ripper use it as it's projectile, then make a class subclassing Mutator and make a classic switcheroo:
Code:
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if ( Other.IsA('ripper') && !Other.IsA('MyRipper')) //Dont forget or you'll get an endless loop
{
ReplaceWith(Other, "MyPackage.MyRipper");
return false;
}
Return True;  //Don't forget, or the map can't spawn the actor...
}

If your ripper has the correct settings, this mutator will change all rippers into "MyRipper" that will bounce until the end of time...

No I do not know the basics.... Ahhhhh
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
Brushes and decorations for example have a lifespan of zero...
(Wonder what would happend if someone set them to a random number. After 5 minutes, -whoa, where did the blue base go? :))

The basics:
Open Unrealed
Open the actor browser
Load all .u-files that contain stuff you like (so that you can get the source)
press "Export all scripts" and confirm
All sourcecode is exported ti your \unrealtournament\ directory
in this pattern:
x:\unrealtounament\SomePackageName\classes\
where you'll find all the .uc-files that make up the classes
one file per class, the classes are derived from eachother (parent-child) and overwrite eachother (it'll become clear once you've programmed some...)

Personaly, I put all the source in a different directory, because there is a chance that someone clumsy like me, could overwrite important files (I have done that, believe me)
:hmm:
:stupid:
Now you have an SDK to steal code from...

Create (in \unrealtournament\ ) a directory with the packagename you're creating, and under that a directory calles classes, like: \unrealtournament\MyOwnRipper\Classes\

create three files called something like:
MyRipper.uc
MyRipperBlade.uc
MyRipperMUT.uc

----Write code-----

copmpiling:
open unrealtournament.ini and locate the lines saying EditPackages and add (after them):
EditPackages=MyOwnRipper
(your packagename)

bring up a command console, change to Unrealtournament\system and type:

ucc make

This compiles the package into a .u-file

Open unrealtournament, bring up the console and type:
open ctf-face?mutator=MyOwnRipper.MyRipperMUT
to test you mutator on the level (which you may chose for yourself, ctf-face is easy to write, that's all :))


This is the basics, you create all packages like this and compile
them to a .u-file

Any questions?
 

Twisted Metal

Anfractuous Aluminum
Jul 28, 2001
7,122
3
38
39
Long Island, NY
Ok, I know to copy code from the originals, but papapishu told me to create 3 files:

MyRipper.uc
MyRipperBlade.uc
MyRipperMUT.uc

And then he told me to write the code. Which original files match up with these that I should copy the code from?
 

FireSlash

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
38
Central Ohio
www.unrealannihilation.com
ok.
myripper.uc should be using ripper.uc. then change in default properties, "ProjectileClass=Class'Botpack.Razor2'" to "ProjectileClass=Class'myripper.myripperblade'". remove all lines that start with a #. change "class Ripper extends TournamentWeapon;" to "class myripper extends TournamentWeapon;".

myripperblade.uc should be razor2.uc. make the changes i said in my post, (but make 6.00000 to 0) then remove all the lines that start with # and change "class Razor2 extends Projectile;" to "class myripperblade extends Projectile;"

myripperMUT.uc, use this code (please correct me if im wrong, i never have done this before)
Code:
class myripperarena expands Arena;

defaultproperties
{
     WeaponName=myripper
     AmmoName=Bladehopper
     WeaponString="myripper.myripper"
     AmmoString="botpack.bladehopper"
     DefaultWeapon=Class'myripper.myripper'
}

now move all the files into the directory 'Myripper\classes' under x:\unrealtournament. (they should be in x:\unrealtournament\myripper\classes) go into x:\unrealtournament\system and edit unrealtournament.ini. find the lines that have editpackages=... and add a line Editpackages=myripper. now. open a Dos prompt, then type this. where x is the drive Unrealtournament is installed.

x:\
cd unrealtournament\system
ucc make

afeter its done, it will tell you how many errors/warnings there were. if it comes up with anything more that 0 tell me.

you can write a .int file to select it as a mutator, ill go into this later. for now, just go into a OFFLINE game, and in the console (to open the console, press `) type 'summon myripper.myripper' the ripper should appear infront of you. that ripper alone has the infinate bounces.
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
well, well, I'm gone a few hours and there's chaos ;)
no, just kidding:

If I where you I'd do like this:
Important
First, let your ripper extend the old ripper and not tournamentweapon, then let your ripperblade extend razor2 instead of projectile. since then you don't have to rewrite all the advanced code...

in MyRipper.uc:

Code:
class myripper extends ripper;

defaultproperties
{
     ProjectileClass=Class'MyPackage.MyRipperBlade'
}

This uses the same stuff as the usual ripper, but alters the first-fire projectile to your own class.

Then attack Razor2 in MyRipperBlade.uc:

Code:
class MyRipperBlade extends Razor2;

defaultproperties
{
     LifeSpan=0.000000
}

Now your weapon is ready and you only had to write 10 lines of code instead of 1000... ;)

Now to the mutator:
I think Fireslash have missjudged the mutator coding a bit, or maybe not...
That would make a mutator, but it would be an Arena mutator, like instagib... y'know when you only have one weapon...
But I think that you'd want to use the other weapons as well...
(Arena is derived from mutator, so it's partly right)

it should look something like this:

Code:
class MyRipperMUT extend Mutator; //Mutator is, well, a mutator...

function bool CheckReplacement(Actor Other, out byte bSuperRelevant) //The lovely "switch-stuff-if-you-find-it" function
{
 If (Other.IsA('ripper') && !Other.IsA('MyRipper'))
 {
  ReplaceWith(Other,"MyPackage.MyRipper");
  Return False;
 }
 Return True;
}

explains:
this function is called everytime something is put into the world, and the stuff that is put into the world is contained in the variable "Other"
So we check: if other is a ripper (Other.IsA...) then Replace Other with a MyRipper (ReplaceWith)
And return false so that the original destroys, and we don't get two different rippers, or worse, an error...
If Other isn't a ripper then return true so that the object will stay...

What about:
If (Other.IsA('ripper') && !Other.IsA('MyRipper')

This means "If this object I'm checking is a ripper AND it is NOT (!) a MyRipper, then do the stuff..."
This is because when you use replacewith, a new thing is spawned, your weapon, and this function will be called and since your weapon basicaly is a ripper it will be removed and respawned until UT objects...
It's so that you wont get a recursion error. (that a function calls itself in all eternity)

After this Fireslash is correct; you can start UT and spawn your weapon through the console, but you can also start your mutator from there like this:

open ctf-face?mutator=MyPackage.MyRipperMUT

And voilá, all ripperblades bounce forever (I hope)

The .int file should be like this:
Code:
[Public]
Object=(Name=MyPackage.MyRipperMUT,Class=Class,MetaClass=Engine.Mutator,Description="Eternal Ripper, Makes the razorblades bounce till the end if time...")
(Fun Facts: The comma in the description sepparates the part that is shown on the menu from the part that is shown on the status line)