Help with code please!

All about Chaos for Unreal... (UT3, UT2004, UT2003, UT)
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Help with code please!

Post by lord_kungai »

Compiling, but not working the way it should. Everything works but one thingy. I'll quickly put all the classes here...

Code: Select all

class RageThruster extends Weapon;

var int RageLevel;
var float NetRage,RageCooloffRate;
var xEmitter LD,LU,RD,RU;
var bool click;

simulated function bool HasAmmo()
{
    return true;
}

function bool CanAttack(Actor Other)
{
	return false;
}

simulated function bool StartFire(int Mode)
{
	local vector PVec;
	local float Boost; //Because Boost is the secret of OUR ENERGY!!!

	if(!click)
	{
		if(Mode == 0)
		{
			PlaySound(sound'PickupSounds.UDamagePickUp', SLOT_None, 2*TransientSoundVolume);
			NetRage += 1.0;
			NetRage = FMin(NetRage,5.99);
			if ( RageLevel != int(NetRage) ) // condition to avoid unnecessary bNetDirty of ammo
			{
				RageLevel = int(NetRage);
			}
		}
		else if(Mode == 1)
		{
			if(RageLevel > 0)
			{
				PlaySound(Sound'WeaponSounds.P1ShieldGunFire', SLOT_None, 2*TransientSoundVolume);
				if (Instigator != None)
				{
					Boost = 40.0*RageLevel*RageLevel;
					PVec.X = Boost * cos(Instigator.Rotation.Pitch * (pi / 32768));
					PVec.Y = 0.0;
					PVec.Z = Boost * sin(Instigator.Rotation.Pitch * (pi / 32768));
					Instigator.AddVelocity(PVec >> Instigator.Rotation);
				}
				NetRage = 0.0;
			}
		}
	click = true;
	}
	return Super.StartFire(Mode);
}

simulated event StopFire(int Mode)
{
	click = false;
}

simulated function Tick(float dt)
{
	if ( NetRage > 0 )
	{
		NetRage -= dt*RageCooloffRate;
		NetRage = FMax(NetRage,0.0);
		if ( RageLevel != int(NetRage) ) // condition to avoid unnecessary bNetDirty of ammo
		{
			RageLevel = int(NetRage);
		}
	}
}

simulated function float ChargeBar()
{
	return (NetRage - int(NetRage));
}

function StartTrailEffects()
{
	local xPawn P;
	P = xPawn(Instigator);
	DestroyTrailEffects();
	LU = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	LD = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	RU = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	RD = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	P.AttachToBone(LD, 'lfoot');
	P.AttachToBone(RD, 'rfoot');
	P.AttachToBone(LU, 'lfarm');
	P.AttachToBone(RU, 'righthand');
}

function DestroyTrailEffects()
{
	if (LU != None)
	{
		LU.Destroy();
	}
	if (RU != None)
	{
		RU.Destroy();
	}
	if (LD != None)
	{
		LD.Destroy();
	}
	if (RD != None)
	{
		RD.Destroy();
	}
}

simulated function BringUp(optional Weapon PrevWeapon)
{
	StartTrailEffects();
	Super.BringUp(PrevWeapon);
}

simulated function bool PutDown()
{
	DestroyTrailEffects();
	return Super.PutDown();
}

simulated function GetAmmoCount(out float MaxAmmoPrimary, out float CurAmmoPrimary)
{
	MaxAmmoPrimary = 5.0;
	CurAmmoPrimary = float(RageLevel);
}

defaultproperties
{
	RageLevel=0
	NetRage=0.0
	RageCooloffRate=0.5
	click=false

	ItemName="Rage Thrusters"
	Description="The most fundamental aspect of Chaos is Motion. Keeping this in mind, the group known only as The Kala of Rage created a trans-warp supergravity-harnessing thruster, During the creation of the now-fragmentad hyper-armour, The Dark Encyclical. This key component to The Dark Encylical is a cybernetic implant, fueled by the will and fury of its wielder, which can allow the wielder to move in any direction. The wielder may channel one's Rage into the device and thus gain incredible velocities. However, be warned: speed thrills, but kills."
	FireModeClass(0)=RageThrust
	FireModeClass(1)=RageThrustCharge
	PickupClass=class'RageThrusterPickup'

	bShowChargingBar=true
	bCanThrow=false
	InventoryGroup=1

	BobDamping=0.0
	SelectSound=Sound'GameSounds.ComboActivated'

	HudColor=(r=255,g=255,b=255,a=255)
	AIRating=-1.0
	CurrentRating=-1.0

	Priority=2
	CustomCrosshair=6
	CustomCrosshairTextureName="Crosshairs.Hud.Crosshair_Pointer"
	CustomCrosshairColor=(r=255,g=255,b=255,a=255)
	CustomCrosshairScale=1.0
}

Code: Select all

class RageThrusterPickup extends UTWeaponPickup;

defaultproperties
{
	InventoryType=class'RageThruster'
	PickupMessage="You got the Rage Thruster."
	PickupSound=Sound'GameSounds.ComboActivated'

	MaxDesireability=+0.5

	StaticMesh=StaticMesh'E_Pickups.Udamage'
	DrawType=DT_StaticMesh
	DrawScale=0.5
}
(Dummy class)

Code: Select all

class RageThrust extends WeaponFire;

defaultproperties
{
	AmmoClass=None
	AmmoPerFire=0
	FireAnim=Idle
	FireRate=0.1
	BotRefireRate=0.3
}
(Another Dummy class)

Code: Select all

class RageThrustCharge extends WeaponFire;

defaultproperties
{
	AmmoClass=None
	AmmoPerFire=0
	FireAnim=Idle
	FireRate=0.1
	BotRefireRate=0.3
}






Basically, in the main class (Rage Thruster), the StartFire function is being called only once. Rather, the boolean variable 'click' is not becoming false again. it's just remaining true. This is NOT GOOD! ARRGH!



Is there some other function I need to call to get click to become false?
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

There is a lot of native magic that happens in the weapon fire class. I would take a look at the source code for all code and see if you can find another reference to it, if not then you may be stuck.

So what are you trying to do as you can probably do this in another place...like maybe the weapon fire class...
Jb
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

Hmmm.........




Agreed, the weaponfire class has lots of native magic... bwaituntilrelease is the ideal one. However, the sniper rifle (lightning gun) and the classic sniper rifle reference a dummy weaponfire class for their scopes. And I used very similar code in those classes to make the ZoomStops and DynamicZoom mutators (which work like dreams... :D )


What method(s) do I need to use to access the starting and stopping firing event by the user?


But I'll try it with an upgraded weaponfire class....






BTW: when any rifle scope is zoomed in (instagib, sniper, target painter, etc) my fps reduces like hell. And this happens on all computers I've played on. Why does this happen?
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

Well you can make a star and stop state in the weapon fire. Thats how are melee weapons work. No native magic there!

Why does the FPS drop off? Usally if you are doing anything speical that you do in the renderoverlays is done every tick or refresh of the screen. So if you do something that is expesive (ie takes time) then it can lower your FPS. So what class are slowing down and take a look at the render overlays
Jb
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

jb wrote:Well you can make a star and stop state in the weapon fire. Thats how are melee weapons work. No native magic there!
The weaponsfire class worked anyways! It only problem is that my code seems to be a bit faulty. I'll keep you updated...!
jb wrote:Why does the FPS drop off? Usally if you are doing anything speical that you do in the renderoverlays is done every tick or refresh of the screen. So if you do something that is expesive (ie takes time) then it can lower your FPS. So what class are slowing down and take a look at the render overlays
I'm not doing anything; this just happens generally, even in the single player (tournament). I was just wondering why this happens... could the render overlays for the translucent stuff that surrounds the lightning gun zoom thingy cause expensiveness? Just a random query... :P
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
Kyllian
Posts: 1181
Joined: Thu Dec 04, 2003 1:13 pm
Location: 29.229.90

Post by Kyllian »

You're not the only one having coding problems
I have a Bender and a ONSGL/RL hybrid and neither of which wants to work right

The Bender is supposed to be one skin when any seat is occupied but I can only get it to work with someone in the driver seat

The ONSGL/RL hybrid I have half-working. It'll stop you from loading/firing any more grenades when Current = Max but if you have 4 or 8 nades out at the time(max is 12, 4 per barrel) it won't stop you from getting another full charge
I tried all kinds of things to get 2k4 to stop loading once the barrel load plus the current nades equals the max allowed but I get nothing but either not working or it gives some error at compile
Image
(Melaneus) Dammit, don't you know Furrysound's actually this hot anthro cat goddess? Who does server administration?
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

I got it to work!!! Yay!

Code: Select all

class RageThruster extends Weapon;

var int RageLevel;
var float NetRage,RageCooloffRate;
var xEmitter LD,LU,RD,RU;

simulated function bool HasAmmo()
{
    return true;
}

function bool CanAttack(Actor Other)
{
	return false;
}

simulated function Tick(float dt)
{
	if ( NetRage > 0 )
	{
		NetRage -= dt*RageCooloffRate;
		NetRage = FMax(NetRage,0.0);
		if ( RageLevel != int(NetRage) )
		{
			RageLevel = int(NetRage);
		}
	}
}

simulated function float ChargeBar()
{
	return (NetRage - int(NetRage));
}

function StartTrailEffects()
{
	local xPawn P;
	P = xPawn(Instigator);
	DestroyTrailEffects();
	LU = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	LD = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	RU = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	RD = Spawn(class'SpeedTrail', P,, P.Location, P.Rotation);
	P.AttachToBone(LD, 'lfoot');
	P.AttachToBone(RD, 'rfoot');
	P.AttachToBone(LU, 'lfarm');
	P.AttachToBone(RU, 'righthand');
}

function DestroyTrailEffects()
{
	if (LU != None)
	{
		LU.Destroy();
	}
	if (RU != None)
	{
		RU.Destroy();
	}
	if (LD != None)
	{
		LD.Destroy();
	}
	if (RD != None)
	{
		RD.Destroy();
	}
}

simulated function BringUp(optional Weapon PrevWeapon)
{
	StartTrailEffects();
	Super.BringUp(PrevWeapon);
}

simulated function bool PutDown()
{
	DestroyTrailEffects();
	return Super.PutDown();
}

simulated function GetAmmoCount(out float MaxAmmoPrimary, out float CurAmmoPrimary)
{
	MaxAmmoPrimary = 5.0;
	CurAmmoPrimary = float(RageLevel);
}

defaultproperties
{
	RageLevel=0
	NetRage=0.0
	RageCooloffRate=0.75

	ItemName="Rage Thrusters"
	Description="The most fundamental aspect of Chaos is Motion. Keeping this in mind, the group known only as The Kala of Rage created a trans-warp supergravity-harnessing thruster, During the creation of the now-fragmentad hyper-armour, The Dark Encyclical. This key component to The Dark Encylical is a cybernetic implant, fueled by the will and fury of its wielder, which can allow the wielder to move in any direction. The wielder may channel one's Rage into the device and thus gain incredible velocities. However, be warned: speed thrills, but kills."
	FireModeClass(1)=RageThrust
	FireModeClass(0)=RageThrustCharge
	PickupClass=class'RageThrusterPickup'

	bShowChargingBar=true
	bCanThrow=false
	InventoryGroup=1

	BobDamping=0.0
	SelectSound=Sound'GameSounds.ComboActivated'

	HudColor=(r=255,g=255,b=255,a=255)
	AIRating=-1.0
	CurrentRating=-1.0

	Priority=2
	CustomCrosshair=6
	CustomCrosshairTextureName="Crosshairs.Hud.Crosshair_Pointer"
	CustomCrosshairColor=(r=255,g=255,b=255,a=255)
	CustomCrosshairScale=1.0
}

Code: Select all

class RageThrusterPickup extends UTWeaponPickup;

defaultproperties
{
	InventoryType=class'RageThruster'
	PickupMessage="You got the Rage Thruster."
	PickupSound=Sound'GameSounds.ComboActivated'

	MaxDesireability=+0.5

	StaticMesh=StaticMesh'E_Pickups.Udamage'
	DrawType=DT_StaticMesh
	DrawScale=0.5
}

Code: Select all

class RageThrust extends WeaponFire;

function DoFireEffect()
{
	local float Boost; //Because Boost is the secret of OUR ENERGY!!!
	local Vector X,Y,Z;

	if(RageThruster(Weapon).RageLevel > 0)
	{
		Weapon.PlaySound(Sound'WeaponSounds.P1ShieldGunFire', SLOT_None,5*TransientSoundVolume);
		if (Instigator != None)
		{
			Boost = 500.0*RageThruster(Weapon).RageLevel;
			Weapon.GetViewAxes(X,Y,Z);
			Instigator.AddVelocity(Boost * X);
		}
		RageThruster(Weapon).NetRage = 0.0;
		if ( RageThruster(Weapon).RageLevel != int(RageThruster(Weapon).NetRage) )
		{
			RageThruster(Weapon).RageLevel = int(RageThruster(Weapon).NetRage);
		}
	}
}

defaultproperties
{
	AmmoClass=None
	AmmoPerFire=0
	FireAnim=Idle
	FireRate=0.1
	BotRefireRate=0.3
	bModeExclusive=true
	bWaitForRelease=true
}

Code: Select all

class RageThrustCharge extends WeaponFire;

function DoFireEffect()
{
	Weapon.PlaySound(sound'PickupSounds.UDamagePickUp', SLOT_None,TransientSoundVolume);
	RageThruster(Weapon).NetRage += 1.0;
	RageThruster(Weapon).NetRage = FMin(RageThruster(Weapon).NetRage,5.99);
	if ( RageThruster(Weapon).RageLevel != int(RageThruster(Weapon).NetRage) )
	{
		RageThruster(Weapon).RageLevel = int(RageThruster(Weapon).NetRage);
	}
}

defaultproperties
{
	AmmoClass=None
	AmmoPerFire=0
	FireAnim=Idle
	FireRate=0.1
	BotRefireRate=0.3
	bModeExclusive=true
	bWaitForRelease=true
}

Thanks jb!

This weapon is mainly for moving about the place. It's pretty useful for moving around but can be a pain to control... just as I wanted it to be. With skill, you can move insanely fast around any map. With even more skill, you wont die from impact into walls/ground. :P

Enjoy!






And, Kyllian, post your code on the site. Maybe somebody wil be able to help... :D
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

Oh yeah... forgot to say that you need to use another mut to add this weapon into the game via some other mut... like weapon replacer or something...



This is just one part of the Rage Mutator... :)
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

Glad you got it working and was just stating why it could be slower when you are in zoomed mode. Again that function is being called every time it has to update the screen (the same as your FPS) so any work you do in there will take time away from drawing the screen and lower your FPS..


Kyllian,
thats so weird...anything I can do to help?
Jb
Kyllian
Posts: 1181
Joined: Thu Dec 04, 2003 1:13 pm
Location: 29.229.90

Post by Kyllian »

jb wrote:Kyllian,
thats so weird...anything I can do to help?
My Bender code still has all my various attempts to get it to work in it(there's a lot of // and /*) but my GL/RL hybrid only has my more recent attempt.

I can post them here if you want to take a look and figure out what I'm doing wrong or missing
Image
(Melaneus) Dammit, don't you know Furrysound's actually this hot anthro cat goddess? Who does server administration?
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

Kyllian wrote:
jb wrote:Kyllian,
thats so weird...anything I can do to help?
My Bender code still has all my various attempts to get it to work in it(there's a lot of // and /*) but my GL/RL hybrid only has my more recent attempt.

I can post them here if you want to take a look and figure out what I'm doing wrong or missing

Can always try to help but no promises...
Jb
Kyllian
Posts: 1181
Joined: Thu Dec 04, 2003 1:13 pm
Location: 29.229.90

Post by Kyllian »

jb wrote:Can always try to help but no promises...
Thank ya sir, here's what I got(the GL/RL hybrid uses that Flak/RL hybrid firemode to boot, this is actually the 3rd weapon that uses it)

StealthBender: (removed references to custom textures)

Code: Select all

class sHB extends ONSPRV;

#exec OBJ LOAD FILE=zInvisCrap.utx
//#exec OBJ LOAD FILE=XabienTex.utx

var() Material     RedXabSkin;
var() Material     BlueXabSkin;

/*
simulated function PostBeginPlay() //<- This is a useful place to set properties through code. BigJim
{
    Super.PostBeginPlay();
       Self.RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
       Self.BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';
}
*/


function KDriverEnter(Pawn p)
{
	local int x;

	if (bDriving == True && Team == 0)
		RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
//                Skins[0] = RedXabSkin;
                for (x = 0; x < WeaponPawns.length; x++)
			if (WeaponPawns[x].Driver != None)
			{
                        RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
//                        Skins[0] = RedXabSkin;
              		}

	if (bDriving == True && Team == 1)
		BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
//                Skins[0] = BlueXabSkin;
                for (x = 0; x < WeaponPawns.length; x++)
			if (WeaponPawns[x].Driver != None)
			{
                        BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
//                        Skins[0] = BlueXabSkin;
              		}


/*     {
         if (Team == 0)// && RedFullSkin != None)
              Skins[0] = RedEmptySkin;

         else if (Team == 1)// && BlueFullSkin != None)
              Skins[0] = BlueEmptySkin;
     }


      Self.Skins[0] = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
      Self.RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
      Self.BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';


       if (Team == 0)
            RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
       if (Team == 1)
            BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

       if (Team == 0)
       {
            if (Driver == None && WeaponPawns[0].Driver == None && WeaponPawns[1].Driver == None)
                 RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
                      else RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';


            if (Driver != None)
                 RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

            if (WeaponPawns[0].Driver != None)
                 RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

            if (WeaponPawns[1].Driver != None)
                 RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

                      else RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
       }


       if (Team == 1)
       {
            if (Driver == None && WeaponPawns[0].Driver == None && WeaponPawns[1].Driver == None)
                 BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';
                      else BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';


            if (Driver != None)
                 BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

            if (WeaponPawns[0].Driver != None)
                 BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

            if (WeaponPawns[1].Driver != None)
                 BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';

                      else BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';
        }*/

    super.KDriverEnter( P );
}


function DriverLeft()
{

	local int x;

	if (bDriving == False && Team == 0)
                RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
                //		Skins[0] = RedSkin;
                for (x = 0; x < WeaponPawns.length; x++)
			if (WeaponPawns[x].Driver != None)
			{
                        RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
//                        Skins[0] = RedSkin;
              		}

	if (bDriving == False && Team == 1)
                BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';
//		Skins[0] = BlueSkin;
                for (x = 0; x < WeaponPawns.length; x++)
			if (WeaponPawns[x].Driver != None)
			{
                          BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';
//                        Skins[0] = BlueSkin;
              		}


/*
       Self.Skins[0] = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';   //<- This is the only one that works
       Self.RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';
       Self.BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';

   if(bDriving == False)
     {
         if (Team == 0)// && RedEmptySkin != None)
              Skins[0] = RedFullSkin;

         else if (Team == 1)// && BlueEmptySkin != None)
              Skins[0] = BlueFullSkin;
     }


       if (Team == 0)
       {
            if (Driver == None && WeaponPawns[0].Driver == None && WeaponPawns[1].Driver == None)
                 RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
                      else RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';


            if (Driver != None)
                 RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';

            if (WeaponPawns[0].Driver != None)
                 RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';

            if (WeaponPawns[1].Driver != None)
                 RedSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED';

                      else RedSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
       }


       if (Team == 1)
       {
            if (Driver == None && WeaponPawns[0].Driver == None && WeaponPawns[1].Driver == None)
                 BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
                      else BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';


            if (Driver != None)
                 BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';

            if (WeaponPawns[0].Driver != None)
                 BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';

            if (WeaponPawns[1].Driver != None)
                 BlueSkin = Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue';

                      else BlueSkin = FinalBlend'XEffectMat.Combos.InvisOverlayFB';
        }*/

    Super.DriverLeft();
}


static function StaticPrecache(LevelInfo L)
{
    Super.StaticPrecache(L);

	L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellTire');
	L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellDoor');
	L.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellGun');
	L.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris2');
	L.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris1');

    L.AddPrecacheMaterial(Material'AW-2004Particles.Energy.SparkHead');
    L.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp2_frames');
    L.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp1_frames');
    L.AddPrecacheMaterial(Material'ExplosionTex.Framed.we1_frames');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Fire.MuchSmoke1');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Fire.NapalmSpot');
    L.AddPrecacheMaterial(Material'EpicParticles.Fire.SprayFire1');
    L.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.newPRVnoColor');
    L.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVcolorRED');
    L.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVcolorBLUE');
    L.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
    L.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
    L.AddPrecacheMaterial(Material'VMWeaponsTX.ManualBaseGun.baseGunEffectcopy');
    L.AddPrecacheMaterial(Material'VehicleFX.Particles.DustyCloud2');
    L.AddPrecacheMaterial(Material'VMParticleTextures.DirtKICKGROUP.dirtKICKTEX');
    L.AddPrecacheMaterial(Material'Engine.GRADIENT_Fade');
    L.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
//    L.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVtagFallBack');
    L.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
//    L.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.prvTAGSCRIPTED');
}

simulated function UpdatePrecacheStaticMeshes()
{
	Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellTire');
	Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellDoor');
	Level.AddPrecacheStaticMesh(StaticMesh'ONSDeadVehicles-SM.HELLbenderExploded.HellGun');
	Level.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris2');
	Level.AddPrecacheStaticMesh(StaticMesh'AW-2004Particles.Debris.Veh_Debris1');

    Super.UpdatePrecacheStaticMeshes();
}

simulated function UpdatePrecacheMaterials()
{
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Energy.SparkHead');
    Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp2_frames');
    Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.exp1_frames');
    Level.AddPrecacheMaterial(Material'ExplosionTex.Framed.we1_frames');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Fire.MuchSmoke1');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Fire.NapalmSpot');
    Level.AddPrecacheMaterial(Material'EpicParticles.Fire.SprayFire1');
    Level.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.newPRVnoColor');
    Level.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVcolorRED');
    Level.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVcolorBLUE');
    Level.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
    Level.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
    Level.AddPrecacheMaterial(Material'VMWeaponsTX.ManualBaseGun.baseGunEffectcopy');
    Level.AddPrecacheMaterial(Material'VehicleFX.Particles.DustyCloud2');
    Level.AddPrecacheMaterial(Material'VMParticleTextures.DirtKICKGROUP.dirtKICKTEX');
    Level.AddPrecacheMaterial(Material'Engine.GRADIENT_Fade');
    Level.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
//    Level.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.PRVtagFallBack');
    Level.AddPrecacheMaterial(Material'XEffectMat.Combos.InvisOverlayFB');
//    Level.AddPrecacheMaterial(Material'VMVehicles-TX.NEWprvGroup.prvTAGSCRIPTED');

	Super.UpdatePrecacheMaterials();
}

defaultproperties
{
     TorqueCurve=(Points=((OutVal=9.500000),(InVal=300.000000,OutVal=10.500000),(InVal=2250.000000,OutVal=11.500000),(InVal=3750.000000)))
     GearRatios(2)=0.850000
     GearRatios(3)=1.300000
     GearRatios(4)=1.800000
     bAllowAirControl=True
     bAllowChargingJump=True
     MaxJumpForce=275000.000000
     MaxJumpSpin=80.000000
     JumpChargeTime=2.000000
     AirTurnTorque=50.000000
     AirPitchTorque=50.000000

//     PassengerWeapons(1)=(WeaponPawnClass=Class'Xabien13.StealthGunPawn')

     RedSkin=Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED'
     BlueSkin=Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue'

//      RedXabSkin=Shader'VMVehicles-TX.NEWprvGroup.PRVcolorRED'
//      BlueXabSkin=Shader'VMVehicles-TX.NEWprvGroup.PRVcolorBlue'

      RedXabSkin=FinalBlend'XEffectMat.Combos.InvisOverlayFB'
      BlueXabSkin=FinalBlend'XEffectMat.Combos.InvisOverlayFB'

     bDrawDriverInTP=False
     VehiclePositionString="in a Stealth Bender"
     VehicleNameString="Stealth Bender"
     Skins(0)=Texture'VMVehicles-TX.NEWprvGroup.newPRVnoColor'
     Skins(1)=FinalBlend'XEffectMat.Combos.InvisOverlayFB'
     Skins(2)=FinalBlend'XEffectMat.Combos.InvisOverlayFB'
     Skins(3)=FinalBlend'XEffectMat.Combos.InvisOverlayFB'
     Skins(4)=FinalBlend'XEffectMat.Combos.InvisOverlayFB'
     SoundVolume=30

     bEjectPassengersWhenFlipped=False
     bHasHandbrake=False
     bScriptedRise=True
     bSpawnProtected=True
     TPCamDistance=500.000000
     DriverDamageMult=0.100000

     HornSounds(0)=Sound'ONSVehicleSounds-S.Horns.Dixie_Horn'
//     HornSounds(1)=Sound'Xabien13.Horn.Dixie'
     GroundSpeed=5000.000000
     HealthMax=2500.000000
     Health=2500
}
ScatterGrenade: (Pickup, Ammo/AmmoPickup and Attachement are mostly the same for the ONSGL and the RL)

Code: Select all

//-----------------------------------------------------------
//
//-----------------------------------------------------------
class ScaGrenadeLauncher extends RocketLauncher
	config(User);

#exec OBJ LOAD FILE=HudContent.utx
#EXEC OBJ LOAD FILE=InterfaceContent.utx

var array<ScaMiniGrenade> Grenades;
var int CurrentGrenades; //should be sync'ed with Grenades.length
var int MaxGrenades;
var color FadedColor;

replication
{
	reliable if (bNetOwner && bNetDirty && ROLE == ROLE_Authority)
		CurrentGrenades;
}

simulated function DrawWeaponInfo(Canvas Canvas)
{
	NewDrawWeaponInfo(Canvas, 0.705*Canvas.ClipY);
}

simulated function NewDrawWeaponInfo(Canvas Canvas, float YPos)
{
	local int i, Half;
	local float ScaleFactor;

	ScaleFactor = 99 * Canvas.ClipX/3200;
	Half = (MaxGrenades + 1) / 2;
//	Half = Min(9,AmmoAmount(1));
	Canvas.Style = ERenderStyle.STY_Alpha;
	Canvas.DrawColor = class'HUD'.Default.WhiteColor;

   for (i = 0; i < Half; i++)
	{
		if (i >= CurrentGrenades)
			Canvas.DrawColor = FadedColor;
		Canvas.SetPos(Canvas.ClipX - (0.5*i+1) * ScaleFactor, YPos);
		Canvas.DrawTile(Material'HudContent.Generic.HUD', ScaleFactor, ScaleFactor, 174, 259, 46, 45);
//		Canvas.SetPos(Canvas.ClipX - (0.5*i+1) * ScaleFactor, YPos);
//		Canvas.DrawTile( Material'HudContent.Generic.HUD', ScaleFactor, ScaleFactor, 174, 259, 46, 45);
	}
	for (i = Half; i < MaxGrenades; i++)
	{
		if (i >= CurrentGrenades)
			Canvas.DrawColor = FadedColor;
		Canvas.SetPos(Canvas.ClipX - (0.5*(i-Half)+1) * ScaleFactor, YPos - ScaleFactor);
		Canvas.DrawTile(Material'HudContent.Generic.HUD', ScaleFactor, ScaleFactor, 174, 259, 46, 45);
//		Canvas.SetPos(Canvas.ClipX - (0.5*(i-8)+1) * ScaleFactor, YPos - ScaleFactor);
//		Canvas.DrawTile( Material'HudContent.Generic.HUD', ScaleFactor, ScaleFactor, 174, 259, 46, 45);
	}
}

simulated function bool HasAmmo()
{
    if (CurrentGrenades > 0)
    	return true;

    return Super.HasAmmo();
}

simulated function bool CanThrow()
{
	if ( AmmoAmount(0) <= 0 )
		return false;

	return Super.CanThrow();
}

simulated function OutOfAmmo()
{
}

simulated singular function ClientStopFire(int Mode)
{
	if (Mode == 1 && !HasAmmo())
		DoAutoSwitch();

	Super.ClientStopFire(Mode);
}

simulated function Destroyed()
{
	local int x;

	if (Role == ROLE_Authority)
	{
		for (x = 0; x < Grenades.Length; x++)
			if (Grenades[x] != None)
				Grenades[x].Explode(Grenades[x].Location, vect(0,0,1));
		Grenades.Length = 0;
	}

	Super.Destroyed();
}


simulated function AnimEnd(int Channel)
{
    local name anim;
    local float frame, rate;
    GetAnimParams(0, anim, frame, rate);

    if (anim == 'AltFire')
        LoopAnim('Aim', 1.0, 0.1);
    else
        Super.AnimEnd(Channel);
}


//Cloned/Tweaked from RL/Other
simulated event ClientStartFire(int Mode)
{
    if ( Pawn(Owner).Controller.IsInState('GameEnded') || Pawn(Owner).Controller.IsInState('RoundEnded') )
        return;
    if (Role < ROLE_Authority)
    {
        if (StartFire(Mode))
        {
            ServerStartFire(Mode);
        }
    }
    else
    {
        StartFire(Mode);
    }
    Super.ClientStartFire(Mode);
}

function Tick(float dt)
{
}

simulated function bool StartFire(int Mode)
{
    local int alt;

    if (!ReadyToFire(Mode))
        return false;

    if (Mode == 0)
        alt = 1;
    else
        alt = 0;

    FireMode[Mode].bIsFiring = true;
    FireMode[Mode].NextFireTime = Level.TimeSeconds + FireMode[Mode].PreFireTime;

    if (FireMode[alt].bModeExclusive)
    {
        // prevents rapidly alternating fire modes
        FireMode[Mode].NextFireTime = FMax(FireMode[Mode].NextFireTime, FireMode[alt].NextFireTime);
    }

    if (Instigator.IsLocallyControlled())
    {
        if (FireMode[Mode].PreFireTime > 0.0 || FireMode[Mode].bFireOnRelease)
        {
            FireMode[Mode].PlayPreFire();
        }
        FireMode[Mode].FireCount = 0;
    }

    return true;
}

//End Cloning


defaultproperties
{
     FireModeClass(0)=Class'GathisTS.ScaGrenadeFire'
     FireModeClass(1)=Class'GathisTS.ScaGrenadeAltFire'

    MaxGrenades=12

     Description="Crap to go here at some point"

     HudColor=(B=255,G=0,R=0)

     InventoryGroup=7
     GroupOffset=1

     PickupClass=Class'GathisTS.ScaGrenadePickup'
     AttachmentClass=Class'GathisTS.ScaGrenadeAttachment'

     ItemName="ScatterGrenade"

     FadedColor=(B=128,G=128,R=128,A=160)

     Mesh=SkeletalMesh'Weapons.RocketLauncher_1st'
//     Mesh=SkeletalMesh'ONSWeapons-A.GrenadeLauncher_1st'
}

Code: Select all

class ScaGrenadeFire extends ProjectileFire;

var int MaxLoad;
var int ChargedNades; //Attempt to make weapon stop charging if Charged + Current = Max

event ModeHoldFire()
{
    if (Instigator.IsLocallyControlled())
		PlayStartHold();
	else
		ServerPlayLoading();
}

simulated function ServerPlayLoading()
{
	ScaGrenadeLauncher(Weapon).PlayOwnedSound(Sound'WeaponSounds.RocketLauncher.RocketLauncherLoad', SLOT_None,,,,,false);
}

function PlayFireEnd()
{
}

function PlayStartHold()
{
    ScaGrenadeLauncher(Weapon).PlayLoad(false);
}

function PlayFiring()
{
    if (Load > 1.0 && Nades > 4.0)
        FireAnim = 'AltFire';
    else
        FireAnim = 'Fire';
    Super.PlayFiring();

    ScaGrenadeLauncher(Weapon).PlayFiring((Load == MaxLoad));
	Weapon.OutOfAmmo();
    ScaGrenadeLauncher(Weapon).PlayFiring((Nades == ChargedNades));
	Weapon.OutOfAmmo();
}

event ModeDoFire()
{
    super.ModeDoFire();
	NextFireTime = FMax(NextFireTime, Level.TimeSeconds + FireRate);
}



function ModeTick(float dt)
{
//     local int QuadAM;
//     QuadAM = (Weapon.AmmoAmount(ThisModeNum) * 4);

    // auto fire if loaded last rocket
    if (HoldTime > 0.0 && Load >= Weapon.AmmoAmount(ThisModeNum) && Nades >= 12 && !bNowWaiting)
    {
        bIsFiring = false;
    }

    Super.ModeTick(dt);

    if (Load == 1.0 && Nades == 4.0 && HoldTime >= FireRate)
    {
        if (Instigator.IsLocallyControlled())
        	ScaGrenadeLauncher(Weapon).PlayLoad(false);
		else
			ServerPlayLoading();

        Load = Load + 1.0;
        Nades = Nades + 4;
    }
    else if (Load == 2.0 && Nades == 8.0 && HoldTime >= FireRate*2.0)
    {
        Load = Load + 1.0;
        Nades = Nades + 4;
    }
}

function InitEffects()
{
    Super.InitEffects();
    if ( FlashEmitter != None )
		Weapon.AttachToBone(FlashEmitter, 'tip');
}

function StartBerserk()
{
    FireRate = default.FireRate * 0.6;
     FireAnimRate = default.FireAnimRate/0.6;
    ReloadAnimRate = default.ReloadAnimRate/0.6;
    Spread = default.Spread * 0.6 ;
}

function StopBerserk()
{
    FireRate = default.FireRate;
     FireAnimRate = default.FireAnimRate;
    ReloadAnimRate = default.ReloadAnimRate;
    Spread = default.Spread;
}

simulated function bool AllowFire()
{
	if (ScaGrenadeLauncher(Weapon).CurrentGrenades >= ScaGrenadeLauncher(Weapon).MaxGrenades)
        	return false;

	return Super.AllowFire();
}

function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
	local ScaMiniGrenade G;

	G = ScaMiniGrenade(Super.SpawnProjectile(Start, Dir));
	if (G != None && ScaGrenadeLauncher(Weapon) != None)
	{
		G.SetOwner(Weapon);
		ScaGrenadeLauncher(Weapon).Grenades[ScaGrenadeLauncher(Weapon).Grenades.length] = G;
		ScaGrenadeLauncher(Weapon).CurrentGrenades++;
	}

	return G;
}


defaultproperties
{
     MaxLoad=3
     ChargedNades=12
     ProjPerFire=4
     ProjSpawnOffset=(X=25.000000,Y=6.000000,Z=-6.000000)

     bSplashJump=False
     bTossed=True

     bFireOnRelease=True
     MaxHoldTime=2.300000
     FireAnim="AltFire"
     TweenTime=0.000000
//     FireSound=SoundGroup'WeaponSounds.BioRifle.BioRifleFire'
     FireSound=SoundGroup'WeaponSounds.RocketLauncher.RocketLauncherFire'
     FireForce="RocketLauncherFire"

     FireRate=0.750
     AmmoClass=Class'GathisTS.ScaGrenadeAmmo'
     AmmoPerFire=1
     ProjectileClass=Class'GathisTS.ScaMiniGrenade'
     FlashEmitterClass=Class'XEffects.RocketMuzFlash1st'
     Spread=1200.0
     SpreadStyle=SS_Random

     ShakeRotTime=2.000000
     ShakeOffsetMag=(X=-20.000000)
     ShakeOffsetRate=(X=-1000.000000)
     ShakeOffsetTime=2.000000

     BotRefireRate=0.600000
     WarnTargetPct=0.700000
}

Code: Select all

#exec OBJ LOAD FILE=..\Sounds\MenuSounds.uax

class ScaMiniGrenade extends Projectile;

var bool bCanHitOwner;
var xEmitter Trail;
var() float DampenFactor, DampenFactorParallel;
var class<xEmitter> HitEffectClass;
var float LastSparkTime;
var Actor IgnoreActor; //don't stick to this actor
var byte Team;
//K var Emitter Beacon;

replication
{
	reliable if (bNetDirty && Role == ROLE_Authority)
		IgnoreActor, Team;
}

simulated function Destroyed()
{
    if ( Trail != None )
        Trail.mRegen = false; // stop the emitter from regenerating
    //explosion
    if ( !bNoFX )
    {
		if ( EffectIsRelevant(Location,false) )
		{
			Spawn(class'NewExplosionA',,, Location, rotator(vect(0,0,1)));
			Spawn(ExplosionDecal,self,, Location, rotator(vect(0,0,-1)));
		}
		PlaySound(sound'WeaponSounds.BExplosion3',,1.5*TransientSoundVolume);
	}
    if ( ScaGrenadeLauncher(Owner) != None)
    	ScaGrenadeLauncher(Owner).CurrentGrenades--;

//K	if ( Beacon != None )
//K		Beacon.Destroy();

    Super.Destroyed();
}

simulated function PostBeginPlay()
{
	local PlayerController PC;

    Super.PostBeginPlay();

    if ( Level.NetMode != NM_DedicatedServer)
    {
		PC = Level.GetLocalPlayerController();
		if ( (PC.ViewTarget != None) && VSize(PC.ViewTarget.Location - Location) < 5500 )
	        Trail = Spawn(class'GrenadeSmokeTrail', self,, Location, Rotation);
    }

    Velocity = Speed * Vector(Rotation);
    RandSpin(25000);
    if (PhysicsVolume.bWaterVolume)
        Velocity = 0.6*Velocity;

    if (Role == ROLE_Authority && Instigator != None)
    	Team = Instigator.GetTeamNum();
}

simulated function PostNetBeginPlay()
{
	if ( Level.NetMode != NM_DedicatedServer )
	{
		if (Team == 0)  // Changes the skin used based on Owner's Team
			Skins[0] = Texture'WeaponSkins.Skins.GrenadeTex';
//			Skins[0] = Texture'GathisTSTex.ScaSkinz.ScaNadeRed';
		else
			Skins[0] = Texture'WeaponSkins.Skins.GrenadeTex';
//			Skins[0] = Texture'GathisTSTex.ScaSkinz.ScaNadeBlue';

//K		if (Beacon != None)
//K			Beacon.SetBase(self);
	}
	Super.PostNetBeginPlay();
}

simulated function Landed( vector HitNormal )
{
    HitWall( HitNormal, None );
}

simulated function ProcessTouch( actor Other, vector HitLocation )
{
    if (!bPendingDelete && Base == None && Other != IgnoreActor && (!Other.bWorldGeometry && Other.Class != Class && (Other != Instigator || bCanHitOwner)))
	Stick(Other, HitLocation);
}

simulated function HitWall( vector HitNormal, actor Wall )
{
    local Vector VNorm;
	local PlayerController PC;

    if (Vehicle(Wall) != None)
    {
        Touch(Wall);
        return;
    }

    // Reflect off Wall w/damping
    VNorm = (Velocity dot HitNormal) * HitNormal;
    Velocity = -VNorm * DampenFactor + (Velocity - VNorm) * DampenFactorParallel;

    RandSpin(100000);
    Speed = VSize(Velocity);

    if ( Speed < 40 )
    {
        bBounce = False;
        SetPhysics(PHYS_None);
        if ( Trail != None )
            Trail.mRegen = false; // stop the emitter from regenerating
    }
    else
    {
		if ( (Level.NetMode != NM_DedicatedServer) && (Speed > 250) )
			PlaySound(ImpactSound, SLOT_Misc );
        if ( !Level.bDropDetail && (Level.DetailMode != DM_Low) && (Level.TimeSeconds - LastSparkTime > 0.5) && EffectIsRelevant(Location,false) )
        {
			PC = Level.GetLocalPlayerController();
			if ( (PC.ViewTarget != None) && VSize(PC.ViewTarget.Location - Location) < 2000 )
				Spawn(HitEffectClass,,, Location, Rotator(HitNormal));
            LastSparkTime = Level.TimeSeconds;
        }
    }
}

simulated function Explode(vector HitLocation, vector HitNormal)
{
    LastTouched = Base;
    BlowUp(HitLocation);
    Destroy();
}

simulated function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType)
{
	local Actor A;

	if (Damage > 0)
	{
		if (Base != None && DamageType != MyDamageType)
		{
			if (EventInstigator == None || EventInstigator != Instigator)
			{
				UnStick();
				return;
			}
		}
		else if (IgnoreActor != None) //just got knocked off something I was stuck to, so don't explode
			foreach VisibleCollidingActors(IgnoreActor.Class, A, DamageRadius)
				return;

		Explode(Location, vect(0,0,1));
	}
}

simulated function Stick(actor HitActor, vector HitLocation)
{
    if ( Trail != None )
        Trail.mRegen = false; // stop the emitter from regenerating

    bBounce = False;
    LastTouched = HitActor;
    SetPhysics(PHYS_None);
    SetBase(HitActor);
    if (Base == None)
    {
    	UnStick();
    	return;
    }
    bCollideWorld = False;
    bProjTarget = true;

	PlaySound(Sound'MenuSounds.Select3',,1.5*TransientSoundVolume);
}

simulated function UnStick()
{
	Velocity = vect(0,0,0);
	IgnoreActor = Base;
	SetBase(None);
	SetPhysics(PHYS_Falling);
	bCollideWorld = true;
	bProjTarget = false;
	LastTouched = None;
}

simulated function BaseChange()
{
	if (!bPendingDelete && Physics == PHYS_None && Base == None)
		UnStick();
}

simulated function PawnBaseDied()
{
	Explode(Location, vect(0,0,1));
}

defaultproperties
{
     DampenFactor=0.500000
     DampenFactorParallel=0.800000
     HitEffectClass=Class'XEffects.WallSparks'
     Speed=1200.0
     MaxSpeed=1200.0
     TossZ=0.000000
     bSwitchToZeroCollision=True
     Damage=50.0     //100.0
     DamageRadius=125.0
     MomentumTransfer=50000.000000
     MyDamageType=Class'Onslaught.DamTypeONSGrenade'
     ImpactSound=ProceduralSound'WeaponSounds.PGrenFloor1.P1GrenFloor1'
     ExplosionDecal=Class'Onslaught.ONSRocketScorch'
     DrawType=DT_StaticMesh
     DrawScale=1.0 //0.075000
//     StaticMesh=StaticMesh'GathisCloneMesh.Sca.NadeMesh'  // Not sure why I did this... Maybe to ensure custom skins worked
     StaticMesh=StaticMesh'WeaponStaticMesh.GrenadeMesh'
//     StaticMesh=StaticMesh'VMWeaponsSM.PlayerWeaponsGroup.VMGrenade'
     CullDistance=5000.000000
     bNetTemporary=False
     bOnlyDirtyReplication=True
     Physics=PHYS_Falling
     LifeSpan=0.000000
     AmbientGlow=100

     bHardAttach=True
     bUseCollisionStaticMesh=True
     CollisionRadius=1.000000
     CollisionHeight=1.000000

     bProjTarget=True
     bBounce=True
     bFixedRotationDir=True
     DesiredRotation=(Pitch=12000,Yaw=5666,Roll=2334)

//     Skins(0)=Texture'GathisTSTex.ScaSkinz.ScaNadeRed'
     Skins(0)=Texture'WeaponSkins.Skins.GrenadeTex'
}

Code: Select all

class ScaGrenadeAltFire extends WeaponFire;

var ScaGrenadeLauncher Gun;

function PostBeginPlay()
{
	Super.PostBeginPlay();

	Gun = ScaGrenadeLauncher(Weapon);
}

simulated function bool AllowFire()
{
	return (Gun.CurrentGrenades > 0);
}

function DoFireEffect()
{
	local int x;

	for (x = 0; x < Gun.Grenades.Length; x++)
		if (Gun.Grenades[x] != None)
			Gun.Grenades[x].Explode(Gun.Grenades[x].Location, vect(0,0,1));

	Gun.Grenades.length = 0;
	Gun.CurrentGrenades = 0;
}

defaultproperties
{
     FireRate=0.1
     BotRefireRate=0.0
}
Image
(Melaneus) Dammit, don't you know Furrysound's actually this hot anthro cat goddess? Who does server administration?
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

About the Grenade launcher...

1) What are you aiming at doing?
2) Why extend the rocket launcher? Won't making a new weapon by itself be much more... uninhibited?

Just my 2 paisa...
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
Kyllian
Posts: 1181
Joined: Thu Dec 04, 2003 1:13 pm
Location: 29.229.90

Post by Kyllian »

1. Kind of a twisted combo of the Flak, RL and ONS grenade launcher. Mostly trying to make it more useful in a firefight(that and for gits and shiggles)

2. Mostly because I didn't want to copy over all the stuff from the RL regarding barrel rotation and such
I have a hard enough time trying to figure out what I'm trying to do
For the most part, I can understand UScript, but I have trouble making it
Image
(Melaneus) Dammit, don't you know Furrysound's actually this hot anthro cat goddess? Who does server administration?
lord_kungai
Posts: 711
Joined: Tue Apr 27, 2004 3:41 am
Location: Mumbai, India

Post by lord_kungai »

It's... ALIVE!!! Well, almost...





Ok, so here's the thingy. I've been working on a sort of pseudo-UT-magic mut, which uses weapons to do 'magical' things. Right now, I have three weapons - Rage Thruster, Rage Regenerator and Rage Ravager - which can cause the player to fly, heal and kill respectively. These weapons need to be manually 'charged' with the primary fire before they can be 'fired' by the alternate fire. Then they do their mojo.




All is working except for one thing. The weapons seem to override each other. All of them fit into the translocator slot and the translocator can be accessed, but the weapons don't seem to want to come into the game together.

Code: Select all

class RageWeaponsMutator extends Mutator;

function ModifyPlayer(Pawn Other)
{
	Other.CreateInventory("Rage.RageThruster");
	Other.CreateInventory("Rage.RageRavager");
	Other.CreateInventory("Rage.RageRegenerator");
}

defaultproperties
{
     FriendlyName="RageWeaponsMutator"
     Description="Blah"
}

This is the current mut code. What do I need to do to get this to work???


So close... yet so far...
<center><a href="http://home.att.net/~slugbutter/evil/" target="new"><img src="http://home.att.net/~slugbutter/evil/pureevil.jpg" border=0></a></center>
Post Reply