Announcement

Collapse
No announcement yet.

Projectile Emitter Trail

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

    Projectile Emitter Trail

    I want to change the emitter trail on the link projectile, but the only thing I could come up with is to make my own trail, is there an easy way to code just the emitter and still have it work online.


    Edit: I forgot to mention that this is for a projectile trail that my new monster is shooting. From what I get, some Emitters are harder to change than others and it's better to change the whole emitter itself. I found some code to change the Link gun projectile trail to the Flak gun projectile trail, but would be nice if it were a little more simpler than that.

    #2
    In this case I think your cleanest code option would be to subclass the link projectile with a new one that used your new emitter trail instead. I would think you should be able to change the projectile class in the monster's class (assuming the author set the projectile type as a variable rather than a hard coded reference) via a mutator in the CheckReplacement function (you don't actually have to replace anything with that function, just modify stuff as it is spawned). I'm pretty sure projectiles (and maybe effects too) don't get passed to the mutator linked list (optimization), so looking for the projectile via CheckReplacement won't work (though you could still try...assuming the emitter is not a hardcoded reference in the link projectile...).

    An ugly, ugly hack, would be to create an actor that exists both server and client-side that polls all dynamic actors for the link projectile and forces the new emitter trail on any link projectiles found....

    Comment


      #3
      I got it to work finally, I just used an different stock emitter for the projectile's trail.
      I did not get it to work the way I was trying to do it, after numerous tries. I was trying to modify my own emitter for the trail, and for some reason it just wouldn't work no matter what I did.
      I've had problems like this before, I guess I will keep track of what I know already, it's easy to change the projectile and sounds, but the hardest for me is the trail, sometimes customizing one is tough.

      Comment


        #4
        How did you end up changing the emitter though? Did you create a new projectile subclass and swap it via mutator? Did you rewrite the monster's or projectile's code?

        Comment


          #5
          I wrote a little code to change the projectile and trail within the monster code of Iniquitous's monsters. Most of what I do as far as coding is using what code is used in tutorials like what Iniquitous has to offer on his site for creating monsters for Invasion.
          I did do a Pumpkin Cannon this time last year where I changed the projectile. I have also been using the training videos that come with UT2004. I am working on a couple monsters. I do eventually want to do some animations of my own. I would like to learn to use Character FX like you had suggested, but I may need a tutorial on how it is done. I love doing these little mods, but it is tough to fit in some of the complicated stuff.

          Comment


            #6
            I am still working out some issues with projectiles that the monster shoots, which I guess would apply to a weapon if I extended the class of one.
            I used this code here to change the Projectiles Emitter Trail (Link Gun Projectile).
            It works good

            Code:
            var Emitter NewTrail;
            
            
            simulated function PostNetBeginPlay()
            {
            	Super.PostNetBeginPlay()
            	
            	;if (Trail !=None)
            	{
            
            	Trail.Destroy();
            
            	NewTrail=spawn(class'RedeemerTrail',self);
            	
            }
            Now, I want to change the Emitter that is triggered when the projectile hits the wall. I think it is called 'Simulated Function Explode'.
            So could I just use this same code and replace the word 'Trail' with the word 'Explode'. Then replace the emitter trail 'RedeemerTrail' with another emitter that I find?

            I tried using some code that came from the tutorial on wiki.beyondunreal that was for changing the explosion of the projectile, but it was conflicting I think. At least I am extending a Ling Gun Projectile,
            and that code was for the Minigun.

            Comment


              #7
              For the explosion effect (assuming you are using a subclass of LinkProjectile), just overwrite the function by copying the whole function and then changing the two classes of effects that are spawned to the type that you want, see below:
              Code:
              simulated function Explode(vector HitLocation, vector HitNormal)
              {
                  if ( EffectIsRelevant(Location,false) )
              	{
                      if (Links == 0)
                          Spawn(class'LinkProjSparks',,, HitLocation, rotator(HitNormal)); // change the stuff in red
                      else
                          Spawn(class'LinkProjSparksYellow',,, HitLocation, rotator(HitNormal));// change the stuff in red
              	}
                  PlaySound(Sound'WeaponSounds.BioRifle.BioRifleGoo2');
              	Destroy();
              }
              If you call super.Explode instead before you spawn your new effect, it will call the link version too, and therefore spawn those same link effects as well as your new one (rather than in place of).

              Comment


                #8
                Alright cool thanks, that worked, I was beginning to think I needed the code I posted to stop the original emitter.
                I'm still working on familiarizing myself with the different terms, I was about to try and add code to change the explosion class.
                Also yes I was subclassing the the LinkProjectile, I guess I really am not writing new code, just changing it a little.

                Comment

                Working...
                X