Things I want to know.

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

Moderator: Forum Guards

Postby Allan » Mon Sep 18, 06 12:59 am

Snakey wrote:I've made a gun which 3 different ammo classes, and there are three problems with it;

1. It doesn't make a firing noise for some reason (it has a custom fire noise)
Allan says: Are you sure you managed to get it to save correctly? Try using it in something else, see if it works then.

2. When you pick it up, it has no ammo at all, despite having 3 ammo classes.
Allan says: I assume your thingy in 3: has this fixed.

3. I set the PickupAmmoCount to 10 and the ReloadCount to 5, so that you should have 10 shots when you pick it up but reload after 5. For some reason, if you pick up the gun and then get ammo for it, it has 9 clips containing 5 rounds.
Allan says: PickupAmmoCount in MP is tripled. And if you're using a non-custom ammo class, you could be picking up more than one clip's worth of ammo in one pack. Make a custom ammo class for your weapon, set it up nicely, then set it's pickup ammo to the amount of clips you want per ammo pickup times your reload count.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Dae » Mon Sep 18, 06 7:01 am

The code of a projectile (similar to 20mm shell) that creates gas after explosion, written by The Cassandra Project:
Code: Select all
//-----------------------------
// TCPProjectile35mmGas
// TCP - Tim - 17/8/01
//-----------------------------

// this file is effectively abstract

class TCPProjectile35mmGas extends DeusExProjectile;

auto simulated state Flying
{
   simulated function ProcessTouch (Actor Other, Vector HitLocation)
   {
      if (bStuck)
         return;

      if ((Other != instigator) && (DeusExProjectile(Other) == None) &&
         (Other != Owner))
      {
         damagee = Other;
         Explode(HitLocation, Normal(HitLocation-damagee.Location));

         // DEUS_EX AMSD Spawn blood server side only
         if (Role == ROLE_Authority)
         {
            if (damagee.IsA('Pawn') && !damagee.IsA('Robot') && bBlood)
               SpawnBlood(HitLocation, Normal(HitLocation-damagee.Location));
         }
      }
   }
   simulated function HitWall(vector HitNormal, actor Wall)
   {
      if (bStickToWall)
      {
         Velocity = vect(0,0,0);
         Acceleration = vect(0,0,0);
         SetPhysics(PHYS_None);
         bStuck = True;

         // MBCODE: Do this only on server side
         if ( Role == ROLE_Authority )
         {
            if (Level.NetMode != NM_Standalone)
               SetTimer(5.0,False);

            if (Wall.IsA('Mover'))
            {
               SetBase(Wall);
               Wall.TakeDamage(Damage, Pawn(Owner), Wall.Location, MomentumTransfer*Normal(Velocity), damageType);
            }
         }
      }

      if (Wall.IsA('BreakableGlass'))
         bDebris = False;

      SpawnEffects(Location, HitNormal, Wall);

      Super.HitWall(HitNormal, Wall);
   }
   simulated function Explode(vector HitLocation, vector HitNormal)
   {
      local bool bDestroy;
      local float rad;

      // Reduce damage on nano exploded projectiles
      if ((bAggressiveExploded) && (Level.NetMode != NM_Standalone))
         Damage = Damage/6;

      bDestroy = false;

      if (bExplodes)
      {
         //DEUS_EX AMSD Don't draw effects on dedicated server
         if ((Level.NetMode != NM_DedicatedServer) || (Role < ROLE_Authority))         
            DrawExplosionEffects(HitLocation, HitNormal);

         GotoState('Exploding');
      }
      else
      {
         // Server side only
         if ( Role == ROLE_Authority )
         {
            if (damagee != None) // Don't even attempt damage with a tracer
            {
               if ( Level.NetMode != NM_Standalone )
               {
                  if ( damagee.IsA('DeusExPlayer') )
                     DeusExPlayer(damagee).myProjKiller = Self;
               }
               damagee.TakeDamage(Damage, Pawn(Owner), HitLocation, MomentumTransfer*Normal(Velocity), damageType);
            }
         }
         if (!bStuck)
            bDestroy = true;
      }

      rad = Max(blastRadius*24, 1024);


      SpawnGas();

      // This needs to be outside the simulated call chain
      PlayImpactSound();

      //DEUS_EX AMSD Only do these server side
      if (Role == ROLE_Authority)
      {
         if (ImpactSound != None)
         {
            AISendEvent('LoudNoise', EAITYPE_Audio, 2.0, blastRadius*24);
            if (bExplodes)
               AISendEvent('WeaponFire', EAITYPE_Audio, 2.0, blastRadius*5);
         }
      }
      if (bDestroy)
         Destroy();
   }
   simulated function BeginState()
   {
      local DeusExWeapon W;

      initLoc = Location;
      initDir = vector(Rotation);   
      Velocity = speed*initDir;
      PlaySound(SpawnSound, SLOT_None);
   }
}


function SpawnGas()
{
   //defined in subclasses
}



defaultproperties
{
}
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Snakey » Mon Sep 18, 06 3:53 pm

And this will give the effect I mentioned wanting on the first page?
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby Dae » Mon Sep 18, 06 6:29 pm

Snakey wrote:And this will give the effect I mentioned wanting on the first page?

Yes, but
1. It's not a rocket, but a shell.
2. We need to redefine gas damage (easy to do).
+ the script needs to be converted to standard format since TCP uses its own weapon class. I'll do that soon.
A gun that fires a rocket which, when it hits a surface, explodes releasing gas that, if it hits a player, the player has a specified amount of time before dying (say, 1 minute) unless they find a certain pickup in this time.
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Snakey » Wed Sep 20, 06 4:47 pm

~[A]Daedalus~ wrote:
Snakey wrote:And this will give the effect I mentioned wanting on the first page?

Yes, but
1. It's not a rocket, but a shell.
2. We need to redefine gas damage (easy to do).
+ the script needs to be converted to standard format since TCP uses its own weapon class. I'll do that soon.


Thanks Dae!

Anyways, I've got a minor problem with the pickup skin of a gun I made, it fits well besides on the top of the gun and the handle, which look like this:

Image

As opposed to what it should look like (playerview)

Image
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby Snakey » Thu Sep 21, 06 3:44 pm

ANYONE?
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby Dae » Thu Sep 21, 06 4:14 pm

Tbh I don't really get the essence of your problem.
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Snakey » Thu Sep 21, 06 4:16 pm

Skin doesn't fit properly in pickup view.
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby MainMan » Thu Sep 21, 06 6:06 pm

Okay, this is caused because there are 2 versions of the gun when it is in hand: the 3rd person (seen by others), and the 1st person (seen by you).

The pickup is basically the 3rd person (at least it is for this).

So what we want, effectively, is to make the player see things on his screen, different to what others see. Yes?

Well, for that, we find the function that renders(draws) the gun as an image on the canvas (screen) for the 1st person.

Code: Select all
simulated event RenderOverlays( canvas Canvas )


So when the function is called, we want the skin to be the 1st person skin (so it is rendered with the 1st person skin, for the 1st person view).

Code: Select all
simulated event RenderOverlays( canvas Canvas )
{
//set 1st person skin here, before the function is called.

//called here:
   Super.RenderOverlays( Canvas );

//set 3rd person skin here, because after you have drawn it on the players screen, it is fine for the player, and now you need to draw it on the other people's screen.
}


Also, in the MultiSkins[i] property of the weapon class, set the skins to the 3rd person ones (because it will be 3rd person when it is spawned).


I hope this is better, that I have explained my train of thought, and how I came to the solution, because I hate it when people are like 'omg H0w d0 1 d0 this!!??11', and someone else just says 'here copy and paste this', then in effect, the noobie doesn't learn anything.
<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 Snakey » Thu Sep 28, 06 5:45 pm

[A] Cataclyzm wrote:First of all, why do you need a syringe + spray can?
Second, in first person view, do you want the hand to hold the spray can and syringe, or no?


One as a pickup, the other as an ammo class.

Yeah I want it seen in FP View.
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Previous

Return to Editing issues

Who is online

Users browsing this forum: No registered users and 1 guest
cron