Possible to hide sniper shells ?

Get some cool tips about how to tweak your UT graphic, gameplay, and much more!
Post Reply
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Possible to hide sniper shells ?

Post by esnesi »

Hi all!

I just switched from instagib to freestyle sniping.
And i was wondering if you can hide the shells that fall from your gun as you shoot.

Instagibbers offcourse got everything hidden and switched off haha!

Thanks in advance!
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Possible to hide sniper shells ?

Post by JackGriffin »

Sure but you'll need to either code a server mod or a custom rifle to do it. See this part of the code in the sniper rifle:

Code: Select all

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
    local UT_Shellcase s;

    s = Spawn(class'UT_ShellCase',, '', Owner.Location + CalcDrawOffset() + 30 * X + (2.8 * FireOffset.Y+5.0) * Y - Z * 1);
    if ( s != None ) 
    {
        s.DrawScale = 2.0;
        s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160);              
    }
Just remove that from your new rifle.
So long, and thanks for all the fish
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Possible to hide sniper shells ?

Post by Spectra »

Why not use SpawnNotify rather than coding a new rifle??
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Possible to hide sniper shells ?

Post by JackGriffin »

You def could, I just wanted him to understand the why and how the shells come into being. SpawnNotify is esoteric and way harder to grasp, especially if you don't yet understand the way things are spawned.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Possible to hide sniper shells ?

Post by sektor2111 »

I think AlwaysKeep can turn them off as well if wants, right ?
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Possible to hide sniper shells ?

Post by EvilGrins »

If i may offer an alternative solution?

You said you started with instagibs... so are you familiar with the Sniper-Instagib??
Attachments
ZoomShockRifle.zip
(6.33 KiB) Downloaded 103 times
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Possible to hide sniper shells ?

Post by MrLoathsome »

That ZoomShockRifle is good. Think that is the same one I use on a couple of my servers.

However it is not a sniper rifle with no shells.

Although screwing around with AlwaysKeep or SpawnNotify would do it, that will still require some code
in a mutator or some place would it not?
And then you have extra processing going on to deal with hiding the shells anyway in real time.

Probably not a huge performance hit or anything, but I still don't like it. Not efficient. Bad. Horrible. Etc. :loool:

Jacks first suggestion is the best. And it only takes 5 minutes to create from scratch, with another 5 to test
and zip it up.

Here is the entire source:

Code: Select all

//=============================================================================
// LNSRifle - by MrLoathsome
// A default SniperRifle with no shells
//=============================================================================
class LNSRifle extends SniperRifle;

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
	if (Other == Level) 
		Spawn(class'UT_HeavyWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
	else if ( (Other != self) && (Other != Owner) && (Other != None) ) 
	{
		if ( Other.bIsPawn )
			Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);
		if ( Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight) 
			&& (instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice)) )
			Other.TakeDamage(100, Pawn(Owner), HitLocation, 35000 * X, AltDamageType);
		else
			Other.TakeDamage(45,  Pawn(Owner), HitLocation, 30000.0*X, MyDamageType);	
		if ( !Other.bIsPawn && !Other.IsA('Carcass') )
			spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9);	
	}
}

defaultproperties
{
}
Summon or add the thing via class "LNSRifle.LNSRifle".
I even included an int file. *Edit: Not sure the int file does what I want it too..... :( Int files all suck. :wth:
This is the final version. :tongue:

See attached.
Attachments
LNSRifle1.0.zip
Loathsome's No Shell SniperRifle
(1.73 KiB) Downloaded 104 times
blarg
UTX
Skilled
Posts: 214
Joined: Fri Aug 28, 2015 3:39 am

Re: Possible to hide sniper shells ?

Post by UTX »

There are several ways to do things in Unreal, you could make a mutator with a Tick that destroyed all shellcase that spawned as well, I'm sure there may even be other things to do the same thing.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Possible to hide sniper shells ?

Post by MrLoathsome »

UTX wrote:There are several ways to do things in Unreal, you could make a mutator with a Tick that destroyed all shellcase that spawned as well, I'm sure there may even be other things to do the same thing.
But why?

Then you got an extra mutator loading, with a Tick function running all the time that is destroying something you don't want to be there that only shows up
when a sniperrifle is fired.

That quicky Rifle I posted, eliminates the need for any of that.
By not spawning the shells in the first place, every other suggestion so far is just not needed, and would slow things down, with unneeded code.

K.I.S.S.

*Edit. This post is EVIL. Post number 666 for me. :satan: :mad2: :mad2: :satan:
Last edited by MrLoathsome on Mon Jan 25, 2016 12:39 am, edited 2 times in total.
blarg
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Possible to hide sniper shells ?

Post by JackGriffin »

As soon as someone says "Tick" I automatically know there's a better way and they are guessing at a fix (no offense UTX). Tick should
NEVER
get used unless you specifically know what you are doing with it.

I've seen tick used to update location of lights. On moving things. With multiple copies running on the server.

(((((((shudder)))))))
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Possible to hide sniper shells ?

Post by sektor2111 »

Idea is that if you want a tick I'm guessing you'll need a foreach inside each tick. Now I figured that you did not read threads where I was talking about clocking and optimizing code because chained lists let's say in normal default matches it's cute, iterators used aren't so friendly as supposed.
They help heavy loaded games but not so much. I will except you from seeking forum. Just a note for a Level type MH with more than 1400 actors (pawns, items, ect.) doing a foreach takes some time increasing interval between ticks, especially if something is tested there, leading in LAGS for a stupid shell-case. Only powerful machines will handle that but still cycles are devastated and A.I. won't be so nice (I'm talking from a lot of tests with maps, creatures and mods, not from stories).
Such lousy things, developing a mutator for a tiny fart might do a slow-down leading in a wacky game-play which no one wants. This thing combined with other default actors doing iterations you only can imagine the result.
If you get such ideas I warmly give you an advice to learn using XC_Core or clock stuff different and MIND performance.
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Possible to hide sniper shells ?

Post by Chamberly »

I agree with having no tick and setting up the code to not spawn the shells. :)

It would take a bit less resource to not spawn the shells.
Image
Image
Image Edit: Why does my sig not work anymore?
User avatar
esnesi
Godlike
Posts: 1018
Joined: Mon Aug 31, 2015 12:58 pm
Personal rank: Dialed in.

Re: Possible to hide sniper shells ?

Post by esnesi »

Wow allot of people are interested and want to help thnx! haha

I don't know much about unrealscript or coding a new mutator unfortunatly.
And i guess our serveradmin wont put this on the server :(

I had my hopes on a line in the UT.ini or something haha, like for example flashes you see when you get hit by a sniperrifle (screenflashes=false)

Thanks for the code though!
UTX
Skilled
Posts: 214
Joined: Fri Aug 28, 2015 3:39 am

Re: Possible to hide sniper shells ?

Post by UTX »

Chill, all I said is that there are many ways to do something here.
User avatar
Hitman
Adept
Posts: 281
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden
Contact:

Re: Possible to hide sniper shells ?

Post by Hitman »

iSenSe wrote:Wow allot of people are interested and want to help thnx! haha

I don't know much about unrealscript or coding a new mutator unfortunatly.
And i guess our serveradmin wont put this on the server :(

I had my hopes on a line in the UT.ini or something haha, like for example flashes you see when you get hit by a sniperrifle (screenflashes=false)

Thanks for the code though!
Hey isense, no I wont put it on since we use a zeroping-rifle and I doubt that will work together :sniper3:
Post Reply