Page 1 of 1

Guess What... Another UEd coding screw-up

PostPosted: Sat Feb 04, 06 4:00 pm
by Allan
Ok, i'm tryng to make a kind of "Admin Gun", and have had a problem right from the start... Here's the code:

Code: Select all
//=============================================================================
// SpecialAdminGun.
//=============================================================================
class SpecialAdminGun expands DeusExWeapon;

enum EModeNum
{
   MODE_ProjSingle,
   MODE_ProjMultiple,
   MODE_ShotSingle,
   MODE_ShotMultiple,
   MODE_ShotSniperSingle,
   MODE_ShotSniperMultiple,
   MODE_UberOwnage,
   MODE_Fire,
   MODE_Kamikaze,
};

var EModeNum Mode;

replication
{
   reliable if(Role == ROLE_Authority)
   Mode;
}

function Frob(Actor Frobber, Inventory frobWith)
{
   Mode = MODE_ProjSingle;
   Super.Frob(Frobber, FrobWith);
}

simulated function cycleammo()
{
   switch Mode
   {
      case MODE_ProjSingle:
         Mode = MODE_ProjMultiple;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Multi shot projectile mode activated.");
      break;

      case MODE_ProjMultiple:
         Mode = MODE_ShotSingle;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Single shot mode activated.");
         break;

      case MODE_ShotSingle:
         Mode = MODE_ShotMultiple;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Multi shot mode activated.");
         break;

      case MODE_ShotMultiple:
         Mode = MODE_ShotSniperSingle;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Single shot Sniper mode activated.");
         break;
         
      case MODE_ShotSniperSingle:
         Mode = MODE_ShotSniperMultiple;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Multi shot Sniper mode activated.");
         break;

      case MODE_ShotSniperMultiple:
         if (DeusExPlayer(Owner).bAdmin)
         {
         Mode = MODE_UberOwnage;
            if (Role == ROLE_Authority)
            Pawn(Owner).Clientmessage("Uber Ownage mode activated. A miniscule ball comes out of your gun when you shoot, blowing anything near it to pieces! However, it takes ages to detonate...");
         }
         else
         {
         Mode = MODE_Fire;
            if (Role == ROLE_Authority)
            Pawn(Owner).Clientmessage("Fireball shooting mode activated");
         }
         break;
      case Mode_UberOwnage:
         Mode = MODE_Fire;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Fireball shooting mode activated");
         break;
      
      case Mode_Fire:
         Mode = MODE_Kamikaze;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Kamikaze mode activated. A field is generated around you, and anyone who is seen by the field dies(Including you)...");
         break;
      
      case Mode_Kamikaze:
         Mode = MODE_ProjSingle;
         if (Role == ROLE_Authority)
         Pawn(Owner).Clientmessage("Single shot projectile mode activated.");
         break;
   
   }
}
state NormalFire //(Thanks to JimBowen for this Infinite ammo code)
{
   Begin:
      if ((ClipCount >= ReloadCount) && (ReloadCount != 0))
      {
         if (!bAutomatic)
         {
            bFiring = False;
            FinishAnim();
         }
   
         if (Owner != None)
         {
            if (Owner.IsA('DeusExPlayer'))
            {
               bFiring = False;
            }
            else if (Owner.IsA('ScriptedPawn'))
            {
               bFiring = False;
               ReloadAmmo();
            }
         }
         else
         {
            if (bHasMuzzleFlash)
               EraseMuzzleFlashTexture();
            GotoState('Idle');
         }
      }
      if ( bAutomatic && (( Level.NetMode == NM_DedicatedServer ) || ((Level.NetMode == NM_ListenServer) && Owner.IsA('DeusExPlayer') && !DeusExPlayer(Owner).PlayerIsListenClient())))
         GotoState('Idle');
   
      Sleep(GetShotTime());
      if (bAutomatic)
      {
         GenerateBullet();       // In multiplayer bullets are generated by the client which will let the server know when
         Goto('Begin');
      }
      bFiring = False;
      FinishAnim();
   
   /*      // if ReloadCount is 0 and we're not hand to hand, then this is a
      // single-use weapon so destroy it after firing once
      if ((ReloadCount == 0) && !bHandToHand)
      {
         if (DeusExPlayer(Owner) != None)
            DeusExPlayer(Owner).RemoveItemFromSlot(Self);   // remove it from the inventory grid
         Destroy();
      }
      */              // Do i REALLY need all that crap JUST for infinite ammo?
      ReadyToFire();
   Done:
      bFiring = False;
      Finish();
}


Function PreBeginPlay()
{
   PickupMessage="|p2 Press # to toggle the fire modes of this weapon.|p1 And BTW, you found";
   beltDescription="|p0Admin-Gun";
   LowAmmoWaterMark=0;
}

function PostBeginPlay()
{
   If (Mode==MODE_ProjSingle)
      {
      ShotTime=0.75;
      RecoilStrength=0.35;
      ProjectileClass=class'DeusEx.Rocket';
      AreaOfEffect=AOE_Point;
      BaseAccuracy=0.6;
      }
      
   If (Mode==MODE_ProjMultiple)
      {
      ShotTime=1.25;
      RecoilStrength=0.95;
      ProjectileClass=class'DeusEx.Rocket';
      AreaOfEffect=AOE_Cone;
      BaseAccuracy=1.0;
      }
      
   If (Mode==MODE_ShotSingle)
      {
      ShotTime=0.19;
      bInstantHit=True;
      AreaOfEffect=AOE_Point;
      HitDamage=4;
      BaseAccuracy=0.6;
      }
      
   If (Mode==MODE_ShotMultiple)
      {
      ShotTime=0.25;
      bInstantHit=True;
      AreaOfEffect=AOE_Cone;
      HitDamage=3;
      BaseAccuracy=1.2;
      }
      
   If (Mode==MODE_ShotSniperSingle)
      {
      ShotTime=2.0;
      BaseAccuracy=0.0;
      MaxRange=65535;
      AccurateRange=65535;
      AreaOfEffect=AOE_Point;
      If (bHasScope==True && bZoomed==True);
         HitDamage=150;
      If (bHasScope==True && bZoomed==False);
         HitDamage=50;
      RecoilStrength=0.5;
      bInstantHit=True;
      }
      
   If (Mode==MODE_ShotSniperMultiple)
      {
      ShotTime=2.0;
      BaseAccuracy=0.0;
      MaxRange=65535;
      AccurateRange=65535;
      AreaOfEffect=AOE_Cone;
      If (bHasScope==True && bZoomed==True);
         HitDamage=150;
      If (bHasScope==True && bZoomed==False);
         HitDamage=50;
      RecoilStrength=1.3;
      bInstantHit=True;
      }
}


It compiles, but when you switch firing mode, the original settings won't change from those in ProjSingle mode... Any Help here? (It's not 100% finished yet, still got to do Uber Ownage mode, Fire Mode, and Kamikaze mode.

PostPosted: Sat Feb 04, 06 4:05 pm
by Gishank
Show me the default properties.

Because the prob could be in there.

PostPosted: Sat Feb 04, 06 4:10 pm
by Allan
The Def.Props: (I used ammo10mm for testing, plan to change it to a custom one)

Code: Select all
defaultproperties
{
     LowAmmoWaterMark=0
     GoverningSkill=Class'DeusEx.SkillWeaponHeavy'
     EnemyEffective=ENMEFF_Organic
     EnviroEffective=ENVEFF_AirVacuum
     HitDamage=0
     maxRange=10000
     AccurateRange=5000
     BaseAccuracy=0.750000
     bHasMuzzleFlash=False
     AmmoName=Class'DeusEx.Ammo10mm'
     ReloadCount=0
     PickupAmmoCount=1
     FireOffset=(X=-16.000000,Y=4.000000,Z=10.000000)
     FireSound=Sound'DeusExSounds.Player.FemalePainSmall'
     AltFireSound=Sound'DeusExSounds.Weapons.ProdReloadEnd'
     CockingSound=Sound'DeusExSounds.Weapons.FlamethrowerReload'
     SelectSound=Sound'DeusExSounds.Weapons.NanoVirusGrenadeSelect'
     Misc1Sound=Sound'DeusExSounds.Generic.PoolballClack'
     InventoryGroup=253
     ItemName="|p4 Specialized Admin Ownage Gun!!!"
     PlayerViewOffset=(X=16.000000,Y=-4.000000,Z=-10.000000)
     PlayerViewMesh=LodMesh'DeusExItems.PlasmaRifle'
     PickupViewMesh=LodMesh'DeusExItems.AssaultGunPickup'
     ThirdPersonMesh=LodMesh'DeusExItems.InvisibleWeapon'
     ThirdPersonScale=0.000000
     PickupSound=Sound'DeusExSounds.Player.MaleLaugh'
     Icon=Texture'DeusExDeco.Skins.AlarmLightTex4'
     Description="Made by the Allan Admin Guns team. This will deliver a shockng blow to anyone within a breath of reasonability..."
     Mesh=LodMesh'DeusExDeco.CrateUnbreakableSmall'
     MultiSkins(1)=Texture'DeusExDeco.Skins.AlarmLightTex7'
     CollisionRadius=10.000000
     CollisionHeight=3.000000
}

PostPosted: Sat Feb 04, 06 4:12 pm
by Gishank
your missing...


Code: Select all
ProjectileClasses(1)=Class''

I think...

PostPosted: Sat Feb 04, 06 4:27 pm
by Allan
No, it shoots the projectiles i set to it ok(Which is only one type, rockets), but it won't switch between the different types of firing, like cone, single, Regular fire, etc... I think it has something to do with the fact it's in "PostBeginPlay", and it's just a pain in the arse anyway...

PostPosted: Sat Feb 04, 06 4:31 pm
by ~ô¿ô~Nobody~
er.. merge the stuff that is in postbeginplay with the stuff in CycleAmmo and leave it in the CycleAmmo function
this should work

PostPosted: Sat Feb 04, 06 4:39 pm
by Allan
Yay! It works! *Hugs [A]Nobody :D*

PostPosted: Sat Feb 04, 06 5:12 pm
by Spiderbot01
Who else are you planning admin to? I should have known you were having an affair!!!

PostPosted: Sat Feb 04, 06 5:33 pm
by Allan
Lol? No, im not planning to give out my admin (Or have an affair), as my server doesnt work anyway (Still... :S :@). But it's so bloomin obvious what the PW is anyway, anyone could guess it. :P :lol:

Im just trying to make guns that admins could use/test on their servers.

PostPosted: Sat Feb 04, 06 9:49 pm
by MainMan
I'm actually making a similar admin tool. (The idea was given to me by [A]lex on msn.)

The different options on the tool will be:

Warning Lag (tells them not to mess with me)
Power Lag (crashes dx)
Kill
Change name to something stupid
etc

PostPosted: Sat Feb 04, 06 9:53 pm
by Allan
Hmm, prehaps an adaptation of this is in order... A Decoration summoning Gun anyone?

PostPosted: Sat Feb 04, 06 10:00 pm
by Wasted
Like truning ppl into rats?

PostPosted: Sat Feb 04, 06 10:23 pm
by Siva
I AM MAKING THE DECO GUN, SO PFFF.

PostPosted: Sat Feb 04, 06 10:28 pm
by Wasted
clam donw.. loads of ppl amke em..

PostPosted: Sat Feb 04, 06 10:38 pm
by Siva
Pffffff.

PostPosted: Sun Feb 05, 06 12:28 pm
by Mastakilla
~Wasted~ wrote:clam donw.. loads of ppl amke em..


Clams :]

PostPosted: Sun Feb 05, 06 1:07 pm
by Allan
Lol, Wasted looks lke he had a few too many, with all those letter mixups lol :lol:

Edit: 225 Posts :D

PostPosted: Sun Feb 05, 06 2:09 pm
by Mastakilla
lol.

80 posts meh.

PostPosted: Sun Feb 05, 06 3:42 pm
by Gishank
1433 POST'S.


SpiderBot01 OWNED! wrote:OWNED BIATCH!!!!!

PostPosted: Sun Feb 05, 06 6:17 pm
by ~ô¿ô~Nobody~
<~>K}Ã?Ã?<~> wrote:1433 POST'S.


SpiderBot01 OWNED! wrote:OWNED BIATCH!!!!!



spammer :P

PostPosted: Sun Feb 05, 06 6:27 pm
by Gishank
[ANobody, what you just posted is spam aswell so don't go around calling me a spammer. ¬_¬

PostPosted: Mon Feb 06, 06 8:39 am
by Alex
But Nobody is Nobody, so he's allowed to.

PostPosted: Mon Feb 06, 06 5:17 pm
by Mastakilla
Weird... Klop is spamming then you say nobody is allowed to spam... I think klop is a 'somebody' as in, a person?

PostPosted: Mon Feb 06, 06 9:59 pm
by Siva
In the spirit of the moment -

SPAM <.<

PostPosted: Mon Feb 06, 06 10:04 pm
by MainMan
Think about this phrase:

"Nobody is allowed to spam."

PostPosted: Thu Feb 09, 06 9:49 pm
by Spiderbot01
Alrightythen has teh awesome mods for such hoo hah..I <3 Alrightythen :D

PostPosted: Fri Feb 10, 06 12:02 pm
by Gishank
[Z]_Spiderbot01_[Z] wrote:Alrightythen has teh awesome mods for such hoo hah..I <3 Alrightythen :D

Spidey, alrightys mods own, but some arse is going around impersonating him.

PostPosted: Fri Feb 10, 06 5:25 pm
by Siva
Where is alrighty at? Haven't talked to hehm in a whyle. :S

He gave me teh alrightygame V4 beta ;) Teh yays.

PostPosted: Sat Feb 11, 06 4:12 pm
by Allan
... Guess What... I got another coding dilemma... I wanted the "ActorDisplayWindow" class to appear when i put the scope on, but so far, all my efforts end in budkiss... :P

By The Way, ActorDisplayWindow is a kind of debug window, showing stuff like Fieldofsight, collision radiuses, all the good stuff :D. If you can sort out how i can go about fixing this, there is cookies in it for you ;)

PostPosted: Sat Feb 11, 06 5:45 pm
by Wasted
<~>K}��<~> wrote:[ANobody, what you just posted is spam aswell so don't go around calling me a spammer. ¬_¬


Exactly nobody posted spam so you shoudlnt either.