Jump to content

Implementing Negative Falloff for Projectiles


Recommended Posts

Hello all, I'm currently creating an overhaul for the game for my friends and I, and in reworking all the weapons  I wanted to add a unique attribute to the spears where they do increased damage the farther they travel. I was hoping I could just invert the damage falloff system that's there but I don't see any leads on how to do that. Any ideas are welcome. Thank you.

Link to comment
Share on other sites

I have a rifle that does something similar, but reversed. It's in my Thumper mod. You can check it out if you want. Basically i have a buff that fires off once the player shoots the thumper rifle. It's a short timed buff that i use as a checker to see how far the bullet has traveled. If it has traveled i think .5 seconds (the length of the first buff), it will add a new buff that increases the damage and exp gained from head / body shots. The buffs are removed on the projectile hitting the ground, so its a short term buff. I'm not able to look at my files right this second, but you're welcome to check it out.

Link to comment
Share on other sites

1 hour ago, Telric said:

I have a rifle that does something similar, but reversed. It's in my Thumper mod. You can check it out if you want. Basically i have a buff that fires off once the player shoots the thumper rifle. It's a short timed buff that i use as a checker to see how far the bullet has traveled. If it has traveled i think .5 seconds (the length of the first buff), it will add a new buff that increases the damage and exp gained from head / body shots. The buffs are removed on the projectile hitting the ground, so its a short term buff. I'm not able to look at my files right this second, but you're welcome to check it out.

That sounds legit, I will definitely take a look. Thanks my guy.

Link to comment
Share on other sites

1 hour ago, Telric said:

I have a rifle that does something similar, but reversed. It's in my Thumper mod. You can check it out if you want. Basically i have a buff that fires off once the player shoots the thumper rifle. It's a short timed buff that i use as a checker to see how far the bullet has traveled. If it has traveled i think .5 seconds (the length of the first buff), it will add a new buff that increases the damage and exp gained from head / body shots. The buffs are removed on the projectile hitting the ground, so its a short term buff. I'm not able to look at my files right this second, but you're welcome to check it out.

I'm actually having some trouble finding it, not seeing anything being called by the rifle other than the rifle press and ready buffs. If you could point me where it is when you get a chance, I'd appreciate it. Thanks.

Link to comment
Share on other sites

Right so on the thumper gun, i have

	<effect_group name="Thumper Rifle EXP">
			<requirement name="NotHasBuff" buff="buffThumperRiflePress"/>
			<requirement name="NotHasBuff" buff="buffThumperRifleReady"/>
		<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="buffThumperRiflePress" target="self"/>
	</effect_group>

 

What that does is when the player shoots, as long as they are not under a previously fired bullet's effects, they will get a buff called buffThumperRiflePress.

 

In buffs.xml, that corresponds to a buff at the end which is a .55 second long buff. In it, you can see it has several removebuffs if the projectile hits anything. This will cancel the extra exp / damage buff that is applied after the .55 seconds, if you are still holding the rifle.

If the bullet flies for .55 seconds, you'l get the 2nd buff. This one would increase the bullet's damage by 300%, and add some extra experience on kills. (This guns intent was to reward long range kills with it's bullet drop. I timed the first buff (the .55 second one) to go off as soon as the bullet started to drop in game. took some trial and error to figure out.)

So, what you could do is apply a buff on right click of the spear. This would give a buff that sets your damage at 100% for say .2 seconds. Then this buff would give you another buff that sets your damage to 130% for .2 seconds... And so on. You'd want to test it a lot to see how far your spear flies when you get the different buffs.

 

Hopefully that's all making sense. I can do some crazy stuff with buffs, but i'm like a mad scientist.. It makes sense in my head, but probably doesnt with others. lol.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...