Discussions about Coding and Scripting
Barbie
Godlike
Posts: 2842 Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing
Post
by Barbie » Thu Jul 12, 2018 1:04 am
Find the error
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.)
"If Origin not in center it be not in center." --Buggie
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!
Post
by 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
sektor2111
Godlike
Posts: 6423 Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.
Post
by 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
.
Aldebaran
Masterful
Posts: 672 Joined: Thu Jan 28, 2016 7:30 pm
Post
by 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...
Barbie
Godlike
Posts: 2842 Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing
Post
by 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.
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 .
"If Origin not in center it be not in center." --Buggie
sektor2111
Godlike
Posts: 6423 Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.
Post
by 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...
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!
Post
by 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.
It was too easy then, wasn't it?
I suspect there are plenty of other examples in the stock code you could use for further "Spot the Error" posts.
blarg
Barbie
Godlike
Posts: 2842 Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing
Post
by 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.
Again correct, see function
BeginPlay of
DynamicAmbientSound for example.
"If Origin not in center it be not in center." --Buggie