Guess What... Another UEd coding screw-up

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Guess What... Another UEd coding screw-up

Postby Allan » Sat Feb 04, 06 4:00 pm

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.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Gishank » Sat Feb 04, 06 4:05 pm

Show me the default properties.

Because the prob could be in there.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Allan » Sat Feb 04, 06 4:10 pm

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
}
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Gishank » Sat Feb 04, 06 4:12 pm

your missing...


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

I think...
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Allan » Sat Feb 04, 06 4:27 pm

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...
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby ~ô¿ô~Nobody~ » Sat Feb 04, 06 4:31 pm

er.. merge the stuff that is in postbeginplay with the stuff in CycleAmmo and leave it in the CycleAmmo function
this should work
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby Allan » Sat Feb 04, 06 4:39 pm

Yay! It works! *Hugs [A]Nobody :D*
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Spiderbot01 » Sat Feb 04, 06 5:12 pm

Who else are you planning admin to? I should have known you were having an affair!!!
<center>------</center><center>
Image</center>
<center>Image</center><
User avatar
Spiderbot01
Alpha
 
Posts: 5363
Joined: Wed Nov 30, 05 8:24 pm
Location: LONDON!!!!

Postby Allan » Sat Feb 04, 06 5:33 pm

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.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby MainMan » Sat Feb 04, 06 9:49 pm

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
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Allan » Sat Feb 04, 06 9:53 pm

Hmm, prehaps an adaptation of this is in order... A Decoration summoning Gun anyone?
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Wasted » Sat Feb 04, 06 10:00 pm

Like truning ppl into rats?
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND

Postby Siva » Sat Feb 04, 06 10:23 pm

I AM MAKING THE DECO GUN, SO PFFF.
//..
User avatar
Siva
doesn't care about augmented people
 
Posts: 6757
Joined: Tue Dec 06, 05 4:56 pm

Postby Wasted » Sat Feb 04, 06 10:28 pm

clam donw.. loads of ppl amke em..
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND

Postby Siva » Sat Feb 04, 06 10:38 pm

Pffffff.
//..
User avatar
Siva
doesn't care about augmented people
 
Posts: 6757
Joined: Tue Dec 06, 05 4:56 pm

Postby Mastakilla » Sun Feb 05, 06 12:28 pm

~Wasted~ wrote:clam donw.. loads of ppl amke em..


Clams :]
When life gives you lemons... Squeeze them into your eyes and run across a busy intersection, faggot.
User avatar
Mastakilla
Forum Super Hero
 
Posts: 3634
Joined: Wed Aug 17, 05 7:47 pm

Postby Allan » Sun Feb 05, 06 1:07 pm

Lol, Wasted looks lke he had a few too many, with all those letter mixups lol :lol:

Edit: 225 Posts :D
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Mastakilla » Sun Feb 05, 06 2:09 pm

lol.

80 posts meh.
When life gives you lemons... Squeeze them into your eyes and run across a busy intersection, faggot.
User avatar
Mastakilla
Forum Super Hero
 
Posts: 3634
Joined: Wed Aug 17, 05 7:47 pm

Postby Gishank » Sun Feb 05, 06 3:42 pm

1433 POST'S.


SpiderBot01 OWNED! wrote:OWNED BIATCH!!!!!
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby ~ô¿ô~Nobody~ » Sun Feb 05, 06 6:17 pm

<~>K}Ã?Ã?<~> wrote:1433 POST'S.


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



spammer :P
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby Gishank » Sun Feb 05, 06 6:27 pm

[ANobody, what you just posted is spam aswell so don't go around calling me a spammer. ¬_¬
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Alex » Mon Feb 06, 06 8:39 am

But Nobody is Nobody, so he's allowed to.
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Mastakilla » Mon Feb 06, 06 5:17 pm

Weird... Klop is spamming then you say nobody is allowed to spam... I think klop is a 'somebody' as in, a person?
When life gives you lemons... Squeeze them into your eyes and run across a busy intersection, faggot.
User avatar
Mastakilla
Forum Super Hero
 
Posts: 3634
Joined: Wed Aug 17, 05 7:47 pm

Postby Siva » Mon Feb 06, 06 9:59 pm

In the spirit of the moment -

SPAM <.<
//..
User avatar
Siva
doesn't care about augmented people
 
Posts: 6757
Joined: Tue Dec 06, 05 4:56 pm

Postby MainMan » Mon Feb 06, 06 10:04 pm

Think about this phrase:

"Nobody is allowed to spam."
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Spiderbot01 » Thu Feb 09, 06 9:49 pm

Alrightythen has teh awesome mods for such hoo hah..I <3 Alrightythen :D
<center>------</center><center>
Image</center>
<center>Image</center><
User avatar
Spiderbot01
Alpha
 
Posts: 5363
Joined: Wed Nov 30, 05 8:24 pm
Location: LONDON!!!!

Postby Gishank » Fri Feb 10, 06 12:02 pm

[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.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Siva » Fri Feb 10, 06 5:25 pm

Where is alrighty at? Haven't talked to hehm in a whyle. :S

He gave me teh alrightygame V4 beta ;) Teh yays.
//..
User avatar
Siva
doesn't care about augmented people
 
Posts: 6757
Joined: Tue Dec 06, 05 4:56 pm

Postby Allan » Sat Feb 11, 06 4:12 pm

... 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 ;)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Wasted » Sat Feb 11, 06 5:45 pm

<~>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.
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 41 guests