BruteProjectile

Discussions about Coding and Scripting

BruteProjectile

Postby Barbie » Thu Jul 12, 2018 1:04 am

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

Re: BruteProjectile

Postby MrLoathsome » Thu Jul 12, 2018 1:50 am

This:
Code: Select all
Velocity = Vector(Rotation) * speed;

needs to be the last line in the function.
blarg
MrLoathsome
Inhuman
 
Posts: 945
Joined: Wed Mar 31, 2010 9:02 pm
Location: MrLoathsome fell out of the world!
Personal rank: I am quite rank.

Re: BruteProjectile

Postby sektor2111 » Thu Jul 12, 2018 6:07 am

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: .
User avatar
sektor2111
Godlike
 
Posts: 3428
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: BruteProjectile

Postby Aldebaran » Thu Jul 12, 2018 10:16 am

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

Re: BruteProjectile

Postby Barbie » Thu Jul 12, 2018 5:06 pm

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

Re: BruteProjectile

Postby sektor2111 » Thu Jul 12, 2018 5:56 pm

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...
User avatar
sektor2111
Godlike
 
Posts: 3428
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: BruteProjectile

Postby MrLoathsome » Fri Jul 13, 2018 2:37 am

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
MrLoathsome
Inhuman
 
Posts: 945
Joined: Wed Mar 31, 2010 9:02 pm
Location: MrLoathsome fell out of the world!
Personal rank: I am quite rank.

Re: BruteProjectile

Postby Barbie » Fri Jul 13, 2018 5:08 pm

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


Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 1 guest