Page 1 of 1

BruteProjectile

Posted: Thu Jul 12, 2018 1:04 am
by Barbie
Find the error :mrgreen:

Code: Select all

function SetUp()
{
	PlaySound(SpawnSound);
	Velocity = Vector(Rotation) * speed;
	if ( ScriptedPawn(Instigator) != None )
	{
		Speed = ScriptedPawn(Instigator).ProjectileSpeed;
		if ( Instigator.IsA('LesserBrute') )
			Damage *= 0.7;
	}
}
(Taken from BruteProjectile.uc.)

Re: BruteProjectile

Posted: Thu Jul 12, 2018 1:50 am
by MrLoathsome
This:

Code: Select all

Velocity = Vector(Rotation) * speed;
needs to be the last line in the function.

Re: BruteProjectile

Posted: Thu Jul 12, 2018 6:07 am
by sektor2111

Code: Select all

function SetUp()
{
   PlaySound(SpawnSound);
   if ( ScriptedPawn(Instigator) != None )
   {
      Speed = ScriptedPawn(Instigator).ProjectileSpeed;
      Velocity = Vector(Rotation) * Speed;
      if ( Instigator.IsA('LesserBrute') )
         Damage *= 0.7;
   }
}
By fixing this code some funky things will occur in certain maps where mapper was dumb... So I think my fix will be like this:

Code: Select all

function SetUp()
{
   PlaySound(SpawnSound);
   if ( ScriptedPawn(Instigator) != None )
   {
      if ( Instigator.IsA('LesserBrute') )
         Damage *= 0.7;
   }
}
Or maybe this

Code: Select all

function SetUp()
{
   PlaySound(SpawnSound);
   if ( ScriptedPawn(Instigator) != None )
   {
      if ( ScriptedPawn(Instigator).ProjectileSpeed > 2048 )
            ScriptedPawn(Instigator).ProjectileSpeed = 800;
      Speed = ScriptedPawn(Instigator).ProjectileSpeed;
      Velocity = Vector(Rotation) * Speed;
      if ( Instigator.IsA('LesserBrute') )
         Damage *= 0.7;
   }
}
I'll think about...
The good thing is that they can be conformed with original in order to work perfectly On-Line. The bad thing is that I will increase the list with updates needed to NsMonster :omfg: .

Re: BruteProjectile

Posted: Thu Jul 12, 2018 10:16 am
by Aldebaran
It seems that Mercenaries use BruteProjectiles too?

Mercenary.uc:
RangedProjectile=Class'UnrealI.MercRocket'
MercRocket.uc:
class MercRocket extends BruteProjectile;
I wonder why my server crashed sometimes after Brutes using BruteProjectiles but not after Mercs using BruteProjectiles...

Re: BruteProjectile

Posted: Thu Jul 12, 2018 5:06 pm
by Barbie
MrLoathsome wrote:This:

Code: Select all

Velocity = Vector(Rotation) * speed;
needs to be the last line in the function.
Yes, you are right. 8) It was too easy then, wasn't it?
sektor2111 wrote:By fixing this code some funky things will occur in certain maps where mapper was dumb...
BruteProjectile's speed (default 700) is limited by MaxSpeed (default 900). So these projectiles won't be so fast even if mapper has used astronomic high values for Brute's ProjectileSpeed.

Re: BruteProjectile

Posted: Thu Jul 12, 2018 5:56 pm
by sektor2111
Ah, yeah I see it even clamped by Engine natively - thanks God - Good Move, Epic.

Okay, I can drink a beer for you, guys. It looks like I have some updates to do...

Re: BruteProjectile

Posted: Fri Jul 13, 2018 2:37 am
by MrLoathsome
Barbie wrote:
MrLoathsome wrote:This:

Code: Select all

Velocity = Vector(Rotation) * speed;
needs to be the last line in the function.
Yes, you are right. 8) It was too easy then, wasn't it?
8)

I suspect there are plenty of other examples in the stock code you could use for further "Spot the Error" posts. :omfg:
:loool:

Re: BruteProjectile

Posted: Fri Jul 13, 2018 5:08 pm
by Barbie
MrLoathsome wrote:I suspect there are plenty of other examples in the stock code you could use for further "Spot the Error" posts. :omfg: :loool:
Again correct, see function BeginPlay of DynamicAmbientSound for example.
Solution