Stop redeemer boost

Discussions about Coding and Scripting
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Stop redeemer boost

Post by JackGriffin »

iloveut99 wrote: How should I exactly do it? Extend to Shockwave is enough? Or do I need to replace all reedemers with custom ones with the current new shockwave class?
You'll have to replace the shockwave as it spawns. Really I'd try to do this from the player velocity end. If you replace the shockwave you'll have to poll it's damage, size, etc and copy those values to your new one before you call it onto the level. There are several variants of the shockwave and multiple weapons that use them. It's gonna be much easier to address redeemerdeath and velocity.
So long, and thanks for all the fish
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Stop redeemer boost

Post by Feralidragon »

I thought a bit on this, and I have a sugestion to keep the pawn speed:

Add this:

Code: Select all

var float globalDelta;

event Tick(float Delta)
{
	globalDelta = Delta;
}
Change the Victim velocity handeling to this:

Code: Select all

Victim.Velocity *= 0;
Victim.AddVelocity((Victim.Location - Victim.OldLocation)/globalDelta);
I have no idea if that will work well (I didn't test this piece of code at all), but I will explain the idea:
- First, we need the time between Ticks at a global level;
- Second, OldLocation is a variable implemented nativelly in the Actor class, that records the Location of the Actor 1 tick ago, Location itself is the Location now. The new location will be only updated in the next tick given a new Velocity, therefore we just have to keep the old velocity within the same Tick.
Well, Velocity = distance / time, and in this case distance is measured from the oldlocation to the actual location, the tick time is our time, and therefore we can give the old speed to the pawn again, even in multiple shockwaves.

Now, this is just a theory so far, and again, not sure if this will work out, but perhaps it might worth trying it this way and see what happens.