shotgun??

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
I'm trying to replace the assault rifles grenade launcher with a shot gun blast (still using the orginal grenade ammo, 8 shots of buckshot). I want it to be an instant fire attack, but I'm not sure how I could do this. I only know how to make instant fire shot one bullet at a time. Can anyone help me?

p.s. I can alreayd make a shot gun out of projectiles.
 

Chemos

New Member
Jan 5, 2003
3
0
0
Visit site
You say you've already made a shotgun out of projectiles, does that mean your query is more to how to attach the shot gun you made to the secondary trigger of the assault rifle?
If not, and if you are confused about how to make a shotgun blast, see the primary fire of the Flak Cannon.
If you knew both of those, and you are asking something specific about instant fire weapons, there's a great page on the Wiki which explains instant fire weapons pretty well.

I hope I answered your query, if not, could you please try and state it more clearly?
 

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
I created a shot gun to replace the assault rifles grenade launcher. I used teh flak cannon as a refrence. Thats all fine and dandy, but I don't want to be able to see the projectiles. I want the shot gun blast to be made of "bullets" like the assault rifles primary fire or the mini gun, but I do not know how to make the gun shot more than one bullet at a time using instantfire type attacks.

I guess the question would be:
How do I make a gun shot more than one instant fire bullet at a time?
 
Last edited:

Undertaker989

New Member
Aug 13, 2003
39
0
0
how about making the flak projectiles invisible? you just have to change one thing in the default properties I believe.
 

chunky

Uni bum
Mar 10, 2001
72
0
0
40
Canberra, Australia
Apart from the fact that the flak behaves very differently from buckshot, it would be very inefficient to use projectiles where instant hit tracing will do.

You simply need to make the weaponfire class do multiple traces in slightly different directions instead of a single trace etc. So find the instant hit weaponfire class that the assault rifle, minigun etc use and make it 'do its thing' multiple times per shot.

Since a shotgun has a relatively short range, keep the trace distances down and it will be more efficient again (coz some computers don't like many traces in a single tick so you have to be careful).
 

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
Stick with projectiles, you don't need it to be a trace weapon. Just make the projectile really tiny (Drawscale=0.01 or so should do the trick) then make the projectiles travel ridiculously fast, something like 1000000. That's basically how Legend made the shotgun in Unreal2, no trace required :) And that's incidentally also how I've done a shotgun too. Oh, and make the Lifespan of the projectiles 1, or maybe 2, there's no need to have it higher than that.

edit: Chunky managed to post just before me there, completely contradicting me ;) Go with what you feel happiest coding. My personal preference is projectiles though.
 
Last edited:

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
After playing aorund with my "projectile shotgun", I find that there is a major problem. When ever I hit a fluid surface (i.e. the reflection pool in DM-Antalus) it causes very large and violent waves. Friggin tsunamis. So I see now I need to make it out tracers.
 

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
There was a thread here made by Dark[NSF] about how to do multiple traces.

Code:
local actor Other;
local int i;

for(i=0; i < NumberOfShots; i++)
{
  Other = Trace([i]syntax[/i])
  if(!Other.bWorldGeometry)
  {
    //Do stuff
  }
}

That will do traces defined in NumberOfShots. This is called a FOR loop. However it is a very taxing on Unreal so try to keep the number of shots down.

Also why you are seeing the tsunami's is because the projectile you are using is defined to disturb the FluidSurface. Having multiple ones affect a smallish area in a fluid surface will cause these problems.
 
Last edited:

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
ok...

I'm just starting to code, but to make your code work will I have to create a my own instant fire or do I place the code with in the attack mode (i.e alt fire) I wish to affect (if so how do I set the int)?

Would 8 be to much?
 

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
Ok, I've got it working. But I've still got some problems. There are no sparks/bullet holes/smoke when i shot walls or meshes. How do I get those to happen?

Also, I'm not sure but I think all 8 bullets are hitting the same spot. Does anyone know how to fix this?
 

Dark[NSF]

Northwest Secessionalist Forces
rhinodog said:
Ok, I've got it working. But I've still got some problems. There are no sparks/bullet holes/smoke when i shot walls or meshes. How do I get those to happen?

Also, I'm not sure but I think all 8 bullets are hitting the same spot. Does anyone know how to fix this?


Try extending your fire class to AssaultGunFure or AssaultFire whatever the Assault Guns Fire uc is.. You should have sparks then... Instant fire doesn't have the needed functions for hit effects.
 

rhinodog

I'm gonna eat you
Mar 9, 2002
41
0
0
39
To close to the computer.
Visit site
I used the assaultrifle.uc as my fire and had it refer to my own instant fire. But it still doesn't work.


I have confirmed that I am firing more than one shot pure trigger pull, but I have no confirmed if they are spreading (I do not believe they are). Also, there are still no sparks.

Whats the deal?
 
Last edited:

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
Code:
class BuckshotFire extends InstantFire;

function DoFireEffect()
{
local Vector StartTrace, SpreadRand;
local Rotator R, Aim;
local int i;

	Instigator.MakeNoise(1.0);

	StartTrace = Instigator.Location + Instigator.EyePosition();
	Aim = AdjustAim(StartTrace, AimError);

	for( i=0; i<TracesPerShot; i++ )
	{
		SpreadRand = VRand()*FRand()*Spread;

		R = rotator(vector(Aim) + SpreadRand);

		DoTrace(StartTrace, R);
	}
}