Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Particle Effects Tracer Bullet

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

  • Particle Effects Tracer Bullet

    Hey guys, I'm a little bit of a newb on here and only been doing UnrealScript for about 6 months but I'll try and explain as best I can.

    I've got an emitter for bullets, I've put the material not to render (since most of the time you can't really see bullets at the speed they travel) but I felt that having a tracer round show up every few seconds of firing would look pretty awesome.

    I've got the material and applied it to a new emitter in the particle system but I can't get it to work how I'd like. I've messed with the spawn rate and the burst stuff but it either shows all the bullets as tracers (with the material) or the material doesn't show at all or it shows up a second or two (I'm guessing this is due to the burst time option in the emitter) after firing, thus starting the emitter.

    Anybody know an easier way to do this? Maybe by accessing each emitter in the particle system in UnrealScript and using a timer to activate the tracer emitter every few seconds? If there's a way I can do it without getting into UnrealScript that'd would be good but if need be I'll get stuck in.

    Any response is appreciated.

    Thank you!

  • #2
    If you are spawning an emitter each time it really depends on how you put that together in cascade. You can setup distributions for your systems, and it could be as simple as setting the duration randomly to 0 or 1. Again it really depends on how you set things up in cascade.

    Comment


    • #3
      Well Gedden, is there any chance you could suggest the most efficient way of doing this? I'm doing what I can but if I can't get it working soon I'll take a break. It's purely just to look good but it's the kind of thing I'd get better marks from my lecturer.

      Comment


      • #4
        Originally posted by KoRnyKenny View Post
        ...
        Anybody know an easier way to do this?
        ...
        I suppose, your weapon is EWFT_InstantHit - make it EWFT_Projectile and use StaticMesh not Emitter as physical representation. Play a little with speed, collision etc. and you will have most real effect of Tracer Bullet.

        Last thing, this is not for net game.

        Comment


        • #5
          Yeah there's no reason to dive into script for this. You are right in just having it burst at time 0, but you want to play with random durations as Gedden pointed out. In your required module, EmitterDuration is the high end of your range, and EmitterDurationLow is the low end of your range. Also make sure you check 'emitterDurationUseRange' and 'durationRecalcEachLoop', then set your loops to 0 so you can just keep repeating until you kill the particle system.

          Hope this helps!

          Comment


          • #6
            Cheers for the input guys. I'm following exactly what you guys suggest but it's still just firing the tracers at all times.

            I followed wkladis exact instructions and there's just bright bullets all over the place, though it is very pretty! So far it's:

            Duration back at 1.00, Duration Low back to 0.00 along with EmDurUseRange and DurRecEachLoop both checked, Process Spawn Rate (unchecked or checked, both have the same effect), Process Burst (again changes nothing) with count at 1 and count at -1 and time at 0.00.

            I'll keep trying with it tonight while I do some other stuff with my script but if it doesn't work I'll just move on to something else and pick it up later unless anybody else can throw other suggestions my way. In Cascade the emitter is fine, but when I fire it out of the G36C in game it just sprays tracers everywhere. Something in the script itself could be the issue perhaps...

            Thanks for the help thus far though guys!

            Comment


            • #7
              Originally posted by KoRnyKenny View Post
              Cheers for the input guys. I'm following exactly what you guys suggest but it's still just firing the tracers at all times.

              I followed wkladis exact instructions and there's just bright bullets all over the place, though it is very pretty! So far it's:

              Duration back at 1.00, Duration Low back to 0.00 along with EmDurUseRange and DurRecEachLoop both checked, Process Spawn Rate (unchecked or checked, both have the same effect), Process Burst (again changes nothing) with count at 1 and count at -1 and time at 0.00.

              I'll keep trying with it tonight while I do some other stuff with my script but if it doesn't work I'll just move on to something else and pick it up later unless anybody else can throw other suggestions my way. In Cascade the emitter is fine, but when I fire it out of the G36C in game it just sprays tracers everywhere. Something in the script itself could be the issue perhaps...

              Thanks for the help thus far though guys!
              I have a LMG set up that shoots 2 different types of projectiles (tracer, no tracer)
              I'm sure there's a better more efficient way to do this but here what I did code wise in the WEAPON class:
              Code:
              /**
               * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
               */
              class MachineGun extends UTWeapon;
              
              /* AI properties (for shock combos)
              *var UTProj_ShockBall ComboTarget;
              *var bool bRegisterTarget;
              *var bool bWaitForCombo;
              *var vector ComboStart;
              * ^CRAP FROM THE SHOCK RIFLE CODE^
              */
              
              //var bool TracerFired; <--- REMINDER: Figure out a way to make the tracer code more efficient/less crap to type. There's got to be a better way.
              var class <UTProjectile> TRACERclass;
              var int Ammo;
              
              /*
              *var bool bWasACombo;
              *var int CurrentPath;
              * ^MORE CRAP^
              */
              //-----------------------------------------------------------------
              
              //TRACER CODE
              function class <Projectile> GetProjectileClass()
              {
              	local int ShotsFired;
              
              	ShotsFired = (Ammo - AmmoCount);
              	if ((ShotsFired)==4)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==8)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==12)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==16)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==20)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==24)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==28)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==32)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==36)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==40)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==44)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==48)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==52)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==56)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==60)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==64)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==68)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==72)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==76)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==80)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==84)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==88)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)==92)
              	{
              		return TRACERclass;
              	}
              	else if ((ShotsFired)>=96)
              	{
              		return TRACERclass;
              	}
              	else
              	{
              		return WeaponProjectiles[CurrentFireMode];
              	}
              }

              Comment


              • #8
                Seriously man....
                This code works like yours, and it's waaaay more simple:
                Code:
                /**
                 * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
                 */
                class MachineGun extends UTWeapon;
                
                /* AI properties (for shock combos)
                *var UTProj_ShockBall ComboTarget;
                *var bool bRegisterTarget;
                *var bool bWaitForCombo;
                *var vector ComboStart;
                * ^CRAP FROM THE SHOCK RIFLE CODE^
                */
                
                //var bool TracerFired; <--- REMINDER: Figure out a way to make the tracer code more efficient/less crap to type. There's got to be a better way.
                var class <UTProjectile> TRACERclass;
                var int Ammo;
                
                /*
                *var bool bWasACombo;
                *var int CurrentPath;
                * ^MORE CRAP^
                */
                //-----------------------------------------------------------------
                
                //TRACER CODE
                function class <Projectile> GetProjectileClass()
                {
                	local int ShotsFired;
                
                	ShotsFired = (Ammo - AmmoCount);
                	if ( (4 divides ShotsFired) ||  (ShotsFired>96) )
                	{
                		return TRACERclass;
                	}
                	else
                	{
                		return WeaponProjectiles[CurrentFireMode];
                	}
                }

                Comment


                • #9
                  And I always thought its ShotsFired % 4 == 0 than 4 divides ShotsFired....maybe i am to old ^^

                  Comment


                  • #10
                    Yeah that too...
                    But as far as i know, unrealscript has that useful operator =)
                    Never tryied it anyway.

                    Comment

                    Working...
                    X