BruteProjectile

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

BruteProjectile

Post 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.)
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
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: BruteProjectile

Post by MrLoathsome »

This:

Code: Select all

Velocity = Vector(Rotation) * speed;
needs to be the last line in the function.
blarg
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: BruteProjectile

Post 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: .
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: BruteProjectile

Post 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...
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: BruteProjectile

Post 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.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: BruteProjectile

Post 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...
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: BruteProjectile

Post 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:
blarg
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: BruteProjectile

Post 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
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply