Announcement

Collapse
No announcement yet.

Grenade trail.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Grenade trail.

    I'm making a new weapon based off the Assault Rifle. It does exactly what it's suppose to, but when I fire a grenade out of it I don't want the smoke trail to be there anymore. I thought I was doing what was needed to get rid of the trail, but it's still there. Anybody know what functions I need to override to get rid of it?

    #2
    there is probably a default property u can set to none, look in the grenade projectile class, and look for smoke or trail related variable names to set to none, or look in a function something like initEffects or something to see if it creates them inside a function, though it would probably still use a default property to do so.

    Comment


      #3
      Im having the same issue as him


      And believe me, i've gone into both INitEffects() and the def props are removed ALL traces of that ****ing trail

      Still shows.

      Comment


        #4
        postbeginplay ?

        Comment


          #5
          Yup.

          Grenade.uc

          Code:
          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); 
              }
          
              if ( Role == ROLE_Authority )
              {
                  Velocity = Speed * Vector(Rotation);
                  RandSpin(25000);
                  bCanHitOwner = false;
                  if (Instigator.HeadVolume.bWaterVolume)
                  {
                      bHitWater = true;
                      Velocity = 0.6*Velocity;
                  }
              }
          }
          Not exactly that difficult to find

          Comment


            #6
            so they cheaped out with one less defaultproperties entry.... tsk tsk...

            Not that i actually looked anyways

            Comment


              #7
              Well, I had removed that line before, but for some reason I was still calling super.PostBeginPlay(). I feel stupid now

              Comment


                #8
                You can still call the Super() if you really want to, just move it down a bit so that your trail code (or lack thereof) is called before the Super().

                Code:
                simulated function PostBeginPlay()
                {
                	local PlayerController PC;
                	
                    if ( Level.NetMode != NM_DedicatedServer)
                    {
                		PC = Level.GetLocalPlayerController();
                		if ( (PC.ViewTarget != None) && VSize(PC.ViewTarget.Location - Location) < 5500 )
                                        //Trail code deleted...
                     }
                
                    Super.PostBeginPlay();
                }

                Comment


                  #9
                  Or you can, and should, call the function from the Projectile class, not the Grenade class. Super(Projectile).PostBeginPlay(); so that it skips the grenade code altogether, but still calls the code from the base class, which might be important.

                  Comment


                    #10
                    Very good point Bonehed Still, it's useful to know that you can also specify when the Super gets called in a class (and of course in some cases this is essential, such as calling Super.FillPlayInfo(); before anything else in FillPlayInfo() mutator function).

                    Comment


                      #11
                      Or you can just duplicate the fire class code instead of extending it. If you extend a class you are essentially stuck with the default properties of the parent so it is better to just copy the class you want to extend and strip out the code you don't want.

                      Of course, super(myclass) might also have the smoke trail code... :bulb:

                      Comment

                      Working...
                      X