Implementing augs for npcs, need help

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

Moderator: Forum Guards

Postby RedDynasty » Mon Jun 04, 12 4:30 pm

Well everyone i just need to fix the energy sheild so it doesnt let npcs catch fire and fix the effects.
Ive checked the code a ton of times but i cant seem to find out what is wrong.
Here is an example taken from TNMPawn:

Code: Select all
function augdamage( int damage, pawn instigatedby, vector hitlocation, vector momentum, name damagetype)
{
   local int newdamage;
   local tnmaugmentation TNMA;

   newdamage = damage;

   if ((damageType == 'Shot') || (damageType == 'AutoShot'))
   {
      TNMA = TNMPAM.findaug(class'tnmAugBallistic');
      if ((TNMA != none) && (TNMA.bisactive))
      {
         newDamage *= TNMA.value;
         Spawn(Class'BallisticShieldFX',Self);
      }
   }

In BallisticSheildFX.uc u just find a texture import line with a Texture in the defaultproperties.The uc is subclassed into AugFX, which comes as follows:

Code: Select all
class AugFX extends Effects
   abstract;

simulated function Tick(float deltaTime)
{
   Super.Tick(deltaTime);

   ScaleGlow=LifeSpan/Default.LifeSpan;

   if (Owner == None)
      Destroy();
   else
   {
      if(Fatness!=Owner.Fatness)
         Fatness=Owner.Fatness;

      if(PrePivot!=Owner.PrePivot)
         PrePivot=Owner.PrePivot;
   }
}

simulated function PostBeginPlay()
{
   local int i;

   Super.PostBeginPlay();

   Mesh = Owner.Mesh;
   DrawScale = Owner.DrawScale;

   //don't draw masked stuff, blackmasktex will be completely translucent
   for(i=0;i<8;i++)
      if(Owner.MultiSkins[i]==None||Owner.MultiSkins[i]==Texture'BlackMaskTex'||Owner.MultiSkins[i]==Texture'PinkMaskTex'||Owner.MultiSkins[i]==Texture'GrayMaskTex')
         MultiSkins[i]=Texture'BlackMaskTex'; //don't show masked stuff
      else
         MultiSkins[i]=Texture;

   //don't draw glasses, they don't look good with their material settings and the firetexture
   if   (Mesh==LodMesh'GM_DressShirt_B')
   {
      MultiSkins[4]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_DressShirt')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_Jumpsuit' || Mesh==LodMesh'mp_jumpsuit')
   {
      MultiSkins[5]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_DressShirt_F')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_DressShirt_S')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_Suit')
   {
      MultiSkins[5]=Texture'BlackMaskTex';
      MultiSkins[6]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_Trench')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GM_Trench_F')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GFM_TShirtPants')
   {
      MultiSkins[3]=Texture'BlackMaskTex';
      MultiSkins[4]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GFM_SuitSkirt_F')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GFM_SuitSkirt')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GFM_Trench')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GFM_Dress')
   {
      //no glasses
   }
   else if   (Mesh==LodMesh'GMK_DressShirt_F')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }
   else if   (Mesh==LodMesh'GMK_DressShirt')
   {
      MultiSkins[6]=Texture'BlackMaskTex';
      MultiSkins[7]=Texture'BlackMaskTex';
   }

   Texture=Owner.Texture;
   bTrailerSameRotation = true;
   bAnimByOwner = true;

   SetBase(Owner);
}

defaultproperties
{
    bTravel=True
    Physics=11
    LifeSpan=1.00
    DrawType=2
    Style=3
    ScaleGlow=0.70
    bUnlit=True
    bOwnerNoSee=True
}


Any ideas or suggestions?
Last edited by RedDynasty on Mon Jun 04, 12 4:34 pm, edited 1 time in total.
Image
Your not a gamer until you played this.
User avatar
RedDynasty
Wannabe
 
Posts: 130
Joined: Sun Apr 01, 12 8:12 pm
Location: Portugal

Postby Allan » Mon Jun 04, 12 10:29 pm

There's a coded call in TakeDamageBase to CatchFire that gets run whenever an NPC takes Flamed damage. You'll either need to make the damage function call it only when there is no Energy Shield, or simply make the function not work if there is no energy shield.

I'll show you the basic outline of the simpler version:

Code: Select all
function CatchFire()
{
   if(*however you would check there is no energy shield active*)
      Super.CatchFire();
}


Simply dump that into your custom Pawn class, and they shouldn't catch fire if the energy shield is active.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby RedDynasty » Tue Jun 05, 12 7:54 pm

well i dont know how to make it detect the sheild is not on\there but maybe i can make it call only when there is no energy sheild.
Will this work?
Code: Select all
function CatchFire()
{
   local tnmaugmentation TNMA;

   TNMA = TNMPAM.findaug(class'tnmAugSheild');
   if((TNMA != none) && (TNMA.bisactive))
   
return false
}

I know this is badly coded but i was in a rush, but i think u can get what im trying to say
Last edited by RedDynasty on Tue Jun 05, 12 10:09 pm, edited 2 times in total.
Image
Your not a gamer until you played this.
User avatar
RedDynasty
Wannabe
 
Posts: 130
Joined: Sun Apr 01, 12 8:12 pm
Location: Portugal

Postby Allan » Tue Jun 05, 12 10:23 pm

Kinda right, but not quite.

Code: Select all
function CatchFire()
{
   local tnmaugmentation TNMA;

   TNMA = TNMPAM.findaug(class'tnmAugSheild');
   if((TNMA != none) && (!TNMA.bisactive))
      Super.CatchFire();
}


You can stick a ! before a bool operator (in this case, bisactive) to check if it's false, as opposed to true.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby RedDynasty » Tue Jun 05, 12 10:34 pm

so i just add a ! next to bisactive and then just add the Spawn effect( even though it does not work) thing and paste it somewhere in TNMPawn?
Image
Your not a gamer until you played this.
User avatar
RedDynasty
Wannabe
 
Posts: 130
Joined: Sun Apr 01, 12 8:12 pm
Location: Portugal

Previous

Return to Editing issues

Who is online

Users browsing this forum: No registered users and 19 guests