News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 23rd Apr 2012, 05:46 AM   #1
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
Question ut3 mutator help

hi all my name is penpen86

it this day's i am in work to make my first mutator i found a tutorial of ambershee that explain how make this

my mutator in simple: change the stinger with one new stinger but i have a problem... i follow the tutorial step by step ad all work fine
but there is a problem that is not in; the new stinger work but in game i have 2 stinger!!! and i don't know how to remove the old one. someone can help me??

here my .uc

Code:
class MutTheLast_inger extends UTMutator;

function InitMutator(string Options,out string ErrorMessage)
{
if (UTGame(WorldInfo.Game) != None)
{
UTGame(WorldInfo.Game).DefaultInventory[0] = class'UTWeap_MutTheLast_inger';
}

Super.InitMutator(Options,ErrorMessage);
}

function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeap_Stinger') && !Other.IsA('UTWeap_MutTheLast_inger'))
{
ReplaceWith(Other, "UTWeap_MutTheLast_inger");
}

return true;
}

DefaultProperties
{
}
ps. i don't change the name the stinger like to this:

Code:
[UTWeap_EnforcerPlusOne]
ItemName="Enforcer+1"
PickupMessage="Enforcer+1"
becouse i don't want a new name of my stinger, could be a problem??

EDIT: i have this problem becouse i have already the stinger in my "weapon base" this code replace the enforcer or hammer with "DefaultInventory" becouse These two unique weapons can be replaced as the default weapons. i need an help for replace the original stinger when the mutator is activate

thx all for attention
penpen

Last edited by penpen86; 24th Apr 2012 at 11:16 AM.
penpen86 is offline   Reply With Quote
Old 24th Apr 2012, 01:57 PM   #2
Pandemonium
...
 
Pandemonium's Avatar
 
Join Date: Mar. 25th, 2005
Location: Germany, NRW, Siegen
Posts: 86
Hi,

I had trouble while creating a mutator for ut2k4. I used the ReplaceWith()-function for replacing the weaponbases with a new, self created one. At first I had two weaponbases in one place, too.

I had to delete the old weaponbase by adding "Actor(Other).Destroy;" to the CheckReplacement-function.

So maybe something like this helps you:


Code:
function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeap_Stinger') && !Other.IsA('UTWeap_MutTheLast_inger'))
{
ReplaceWith(Other, "UTWeap_MutTheLast_inger");
UTWeap_Stinger(Other).Destroy();
}
return true;
}
-
__________________
bypande.com
photography

-

Last edited by Pandemonium; 24th Apr 2012 at 02:00 PM.
Pandemonium is offline   Reply With Quote
Old 24th Apr 2012, 03:13 PM   #3
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
WORKKKKKKKKKKKKK !!!!!!!!!!!!!!!!! pandemonium for president
thanks a lot friend
penpen86 is offline   Reply With Quote
Old 24th Apr 2012, 03:19 PM   #4
Pandemonium
...
 
Pandemonium's Avatar
 
Join Date: Mar. 25th, 2005
Location: Germany, NRW, Siegen
Posts: 86
Keep it up!

-
__________________
bypande.com
photography

-
Pandemonium is offline   Reply With Quote
Old 24th Apr 2012, 07:04 PM   #5
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
ok 2nd problem lol
now the stinger work perfectly but don't make any damage at vehicle :/
any idea how to make it???

i think now the issues, is to add in UTWeap_MutTheLast_inger the correct variable

Code:
class UTWeap_MutTheLast_inger extends UTWeap_Stinger;

DefaultProperties
{
InstantHitDamage(0)=1.000000
AmmoCount=200
}
wrong way?? :/

Last edited by penpen86; 24th Apr 2012 at 07:18 PM.
penpen86 is offline   Reply With Quote
Old 25th Apr 2012, 01:22 PM   #6
Pandemonium
...
 
Pandemonium's Avatar
 
Join Date: Mar. 25th, 2005
Location: Germany, NRW, Siegen
Posts: 86
Your new weapon is a subclass of an existing weapon, right? So if you don't code something new or change anything in the defaultproperties nothing would be changed at all..

Type in only what you want to be new and omit anything else.

-
__________________
bypande.com
photography

-
Pandemonium is offline   Reply With Quote
Old 25th Apr 2012, 02:51 PM   #7
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
yes is correct is a subclass... but i change only InstantHitDamage and
AmmoCount... i don't know why the damage work only against players and not versus vehicule!!!

my actually MutTheLast_inger.uc

Code:
class MutTheLast_inger extends UTMutator;

function InitMutator(string Options,out string ErrorMessage)
{
if (UTGame(WorldInfo.Game) != None)
{
UTGame(WorldInfo.Game).DefaultInventory[6] = class'UTWeap_MutTheLast_inger';
}

Super.InitMutator(Options,ErrorMessage);
}

function bool CheckReplacement(Actor Other)
{
if (Other.IsA('UTWeap_Stinger') && !Other.IsA('UTWeap_MutTheLast_inger'))
{
ReplaceWith(Other, "UTWeap_MutTheLast_inger");
UTWeap_Stinger(Other).Destroy();
}

return true;
}

DefaultProperties
{
}
and UTWEAP_MutTheLast_inger.uc

Code:
class UTWeap_MutTheLast_inger extends UTWeap_Stinger;

DefaultProperties
{
InstantHitDamage(0)=1.000000
AmmoCount=200
}
now i think the problem is not in utweap, i read the original suorce code of stinger(UTGame.UTWeap_Stinger) that i found in internet,and there is nothing about "damage of vehicle" or something about that,but i may be wrong :S

Last edited by penpen86; 25th Apr 2012 at 04:56 PM.
penpen86 is offline   Reply With Quote
Old 25th Apr 2012, 04:10 PM   #8
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
one news, i found in internet this:

in original source code of UTGame.UTWeap_Stinger
it s just a piece of code
Code:
.........
FireInterval(0)=0.100000
   FireInterval(1)=0.280000
   Spread(0)=0.067500
   InstantHitDamage(0)=14.000000
   InstantHitDamageTypes(0)=Class'UTGame.UTDmgType_StingerBullet'
   EquipTime=0.600000
   FireOffset=(X=19.000000,Y=10.000000,Z=-10.000000)
   bInstantHit=True
UTGame.UTDmgType_StingerBullet
........
InstantHitDamageTypes goes to call the othersource code

UTGame.UTDmgType_StingerBullet
Code:
class UTDmgType_StingerBullet extends UTDamageType
    abstract;

defaultproperties
{
   bBulletHit=True
   DamageWeaponClass=Class'UTGame.UTWeap_Stinger'
   DeathAnim="Death_Stinger"
   DeathAnimRate=0.900000
   StopAnimAfterDamageInterval=0.500000
   NodeDamageScaling=0.600000
   KillStatsName="KILLS_STINGER"
   DeathStatsName="DEATHS_STINGER"
   SuicideStatsName="SUICIDES_STINGER"
   RewardCount=15
   RewardAnnouncementSwitch=9
   RewardEvent="REWARD_BLUESTREAK"
   CustomTauntIndex=8
   DeathString="`o was mowed down by `k's Stinger."
   FemaleSuicide="`o turned the Stinger on herself."
   MaleSuicide="`o turned the Stinger on himself."
   bNeverGibs=True
   bCausesBloodSplatterDecals=True
   KDamageImpulse=200.000000
   VehicleDamageScaling=0.600000     <--- maybe this?????
   VehicleMomentumScaling=0.750000
   Name="Default__UTDmgType_StingerBullet"
   ObjectArchetype=UTDamageType'UTGame.Default__UTDamageType'
}
maybe is possible to connected in some way to my mutator???

if i write on my UTWEAP_MutTheLast_inger
Code:
class UTWeap_MutTheLast_inger extends UTWeap_Stinger;

DefaultProperties
{
InstantHitDamage(0)=1
AmmoCount=200
InstantHitDamageTypes(0)=Class'UTGame.UTDmgType_StingerBullet'
}
in theory woul be connect but don't work!!!!!

Last edited by penpen86; 25th Apr 2012 at 04:55 PM.
penpen86 is offline   Reply With Quote
Old 25th Apr 2012, 05:36 PM   #9
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
ok i found a problem!!!! lol

but need help.... :/ i did this mutator for stop stinger abusing(more players in my server vctf complain about it becouse more players abuse of that weapon) but i don't wan't to remove becouse the only way to stop raptor/manta taxi. then i decided to reducer the damage of stinger at minimal enough to fall down the flag carrier on overboard.

this is the problem, if i put
Code:
InstantHitDamage(0)=1.000000
(default is 14.000000)
don't work against vehicle

if i put:
Code:
InstantHitDamage(0)=2.000000
i have a little damage of vehicle and and grows exponentially if i put 3.00000/4.00000/5.00000 ex. ex.

but i want to leave at minimal 1.00000 ; then my question,is possible to separate the two thing??? i want the default damage of stinger against vehicle(14.000000) and the damage against players on 1.000000

is possible???

Last edited by penpen86; 25th Apr 2012 at 05:40 PM.
penpen86 is offline   Reply With Quote
Old 26th Apr 2012, 05:08 PM   #10
penpen86
Registered User
 
Join Date: Apr. 22nd, 2012
Posts: 7
last news:

i try to connect the other UTDmgType_StingerBullet

then now i make:
MutTheLast_inger.uc
Code:
class MutTheLast_inger extends UTMutator;

function InitMutator(string Options,out string ErrorMessage)
{
	if (UTGame(WorldInfo.Game) != None)
	{
		UTGame(WorldInfo.Game).DefaultInventory[6] = class'UTWeap_MutTheLast_inger';
	}
	Super.InitMutator(Options,ErrorMessage);
}

function bool CheckReplacement(Actor Other)
{
	if (Other.IsA('UTWeap_Stinger') && !Other.IsA('UTWeap_MutTheLast_inger'))
	{
		ReplaceWith(Other, "UTWeap_MutTheLast_inger");
		UTWeap_Stinger(Other).Destroy();
	}
	if (Other.IsA('UTDmgType_StingerBullet') && !Other.IsA('UTDmgType_Stinger'))
	{
		ReplaceWith(Other, "UTDmgType_Stinger");
	}

	return true;
}

DefaultProperties
{
}
UTWEAP_MutTheLast_inger.uc
Code:
class UTWeap_MutTheLast_inger extends UTWeap_Stinger;

DefaultProperties
{
InstantHitDamage(0)=1.000000
AmmoCount=200
}
UTDmgType_Stinger.uc
Code:
class UTDmgType_Stinger extends UTDmgType_StingerBullet;
	
defaultproperties
{
VehicleDamageScaling=100     <---- default is 0.600000
}
i try to connect the UTDmgType_StingerBullet with parameter of VehicleDamageScaling modified to mutator... is correct the code??? ut3 compiler don't show any error when compiling the mut but in game nothing happend, don't work the damage at vehicule

please helppppp

thx
penpen86 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:27 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer