Announcement

Collapse
No announcement yet.

New Emitter for my weapon

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

    New Emitter for my weapon

    I am working on a weapon,
    I want to change the weapons emitter, the one when the beam or projectile hits something, like the player.

    I tried to change a default property of an existing emitter.
    Where do I go from there?

    The thing I am not understanding is that if make a new emitter, how do I save it.
    I click on save package that is selected, but nothing happens.
    Even so, is there a way to save it within the weapon itself, like the .u file that is created when compiling.
    I guess if I can save it I wouldn't have any problems, but for now there is no package for the script to point to.

    #2
    I've got a bunch of new emitters for my mod's weapons. The way I do this is save the new emitter effects in their own script files (subclassed from emitter or xEmitter depending on what they are used for) and compile them into the new package for your weapon. I will sometimes set up the emitter in UnrealEd (getting all of the visual effects set up properly) and then simply highlight the emitter in the editor, copy it (control+C or just Edit->copy) and paste it into the new .uc text file, then edit the pasted text to match the default properties format to get them set up correctly. See the UT2k4 UScript source code for lots of good examples of how to format the new emitters (especially those in the Onslaught package source code).

    Comment


      #3
      I think I can get it to work,
      but still trying to change the color scale.
      I can't seem to find a code that will let me change it on an Emitter.

      Let's say I took the BulldogDust Emitter, and wanted to change the color range to green.
      I got the code for an xEmitter, but not for the Emitter for changing color of emitter.

      The Emitter also has a mesh emitter with it, so there are 2 emitters grouped with BulldogDust,
      Is there a way to change color of both without conflicting with one another?
      That is, only if they were both sprite emitters.

      Comment


        #4
        I can't get it to work yet,
        I tried exporting the script for the emitter that I setup in the UEd,
        I used the Particle System Editor to export the script.
        Is this a good idea to use the Particle System Editor for this.

        When I run the ucc make it runs an unexpected 'Begin' error.
        I could post the code if it helps.

        All I want to do is subclass an existing emitter and use that script.
        I have tried numerous ways, I am a total noob at this.
        Anyone know how to adjust the color range on a subclassed emitter and export the right script.
        I haven't found a good example of this in source code.

        Comment


          #5
          Go ahead and post the code, and preferably describe what you are trying to do (it sound like you want to change the color).

          I personally prefer Emitter subclasses myself as there is more control and in my opinion better documentation (see UDN Two Doc here), but there are a few things that xEmitters can do which Emitters can't.

          Comment


            #6
            Cool, thanks meowcat. I'm not sure if the problems i'm having is because i'm using the bulldogdust emitter.
            I just can't get it to change color of emitter, but I can in the editor.
            I found some code for it in the Onslaught classes, just as you suggested.

            It's a little late, I will pick back up tomorrow.
            I guess I need to also get reacquainted with emitters.

            My first problem was that I was trying to change the projectile trail and not the explosion of the shot, on my new weapon.
            I guess I need to learn more about what is going on when a shot is fired, I wish I would have done this a long time ago.

            Comment


              #7
              What I was trying to do was subclass a BulldogDust emitter,
              and change the color scale,
              Basically I am making a modified Minigun weapon, and the emitter made when it hits the target will be the 'MyBulldogDust' emitter.
              I think this is the explosion, I am not sure if there are any other emitters when bullet hits the ground or opponent.

              I thought it would be better if I copied the code from another emitter to help,
              I can get other emitters to work, but cannot get the color scale to work for me,
              I thought maybe there was more to it than changing the emitter, because I've tried many variations,
              Here is the code I was working with:
              //================================================== ===========================
              // MyBulldogDust.
              //================================================== ===========================
              #exec OBJ LOAD FILE=..\textures\VehicleFX.utx

              class MyBulldogDust extends Emitter
              placeable;

              defaultproperties
              {
              Begin Object Class=SpriteEmitter Name=SpriteEmitter1
              Acceleration=(Z=15.000000)
              UseColorScale=True
              ColorScale(0)=(Color=(B=0,G=255,R=0,A=0))
              ColorScale(1)=(RelativeTime=0.100000,Color=(B=0,G= 255,R=128,A=128))
              ColorScale(2)=(RelativeTime=0.896429,Color=(B=128, G=255,R=128,A=128))
              ColorScale(3)=(RelativeTime=1.000000,Color=(B=64,G =255,R=0,A=0))
              MaxParticles=100
              StartLocationRange=(Y=(Min=-24.000000,Max=24.000000))
              UseRotationFrom=PTRS_Actor
              SpinParticles=True
              SpinsPerSecondRange=(X=(Max=0.025000))
              StartSpinRange=(X=(Max=1.000000))
              UseSizeScale=True
              UseRegularSizeScale=False
              SizeScale(0)=(RelativeSize=0.250000)
              SizeScale(1)=(RelativeTime=1.000000,RelativeSize=1 .000000)
              StartSizeRange=(X=(Min=50.000000,Max=50.000000),Y= (Min=50.000000,Max=50.000000),Z=(Min=50.000000,Max =50.000000))
              UniformSize=True
              DrawStyle=PTDS_AlphaBlend
              Texture=Texture'VehicleFX.Particles.DustyCloud2'
              LifetimeRange=(Min=2.000000,Max=2.000000)
              AutomaticInitialSpawning=False
              InitialParticlesPerSecond=0
              ParticlesPersecond=0
              RespawnDeadParticles=false
              SecondsBeforeInactive=0
              Name="SpriteEmitter1"
              End Object
              Emitters(0)=SpriteEmitter'SpriteEmitter1'
              }

              Comment


                #8
                Does this emitter code spawn anything at all? The reason I ask is that it looks like the 'InitialParticlesPerSecond' and ParticlesPerSecond varoables are set to zero, these should be some other number, and then use MaxParticles to limit how many are spawned. Also, for weapons type effects (where the emitter only needs to exist long enough to spawn the particles and then it may die) its good to set the bAutoDestroy property to true, see the class "ONSAVRiLRocketExplosion" for a good example.

                As for the color range, it looks to me like that should work.

                Comment


                  #9
                  Alright, I think I got it now.
                  I originally tried to subclass the BulldogDust Emitter, which is a subclass of Vehicles.
                  In that code there was something about spawning the particles that I excluded, but the part I included, is what you pointed out about the 'InitialParticlesPerSecond=0'.

                  I also got the code through the Particle System Tool, which doesn't give a full class code that you can compile, so I was trying to add to it, unsuccessfully and many tries later.
                  I guess I should have just looked up the source code, but I was confused thinking the BulldogDust was an extended class of Emitter, but It's an extended class of Vehicles.

                  Oh well, one or two mistakes there, but lesson learned.
                  Thank You meowcat for your help.

                  Comment

                  Working...
                  X