Weapon refuses to pass variables to projectile

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

SoSilencer

Harry Goz (1932 - 2003)
Nov 27, 2000
834
0
0
43
unrealdev.net
Maybe somebody has an idea cus I'm at a loss.

Weapon....

Beam = Spawn(lots of stuff here);
Beam.EndLocation = Pawn(Owner).Location;

Both Beam and Pawn(Owner).Location are ok and show up fine in logs, not to mention I can see the object spawn at the proper location.

Projectile...

var vector EndLocation;

Logging EndLocation gives None as a result. I am also trying to pass a float variable from the weapon to the ammo and get the same thing. On the weapon side everything is ok yet on the ammo side everything is None.

*Edit: Actually with that float variable, and this is the REALLY weird part. If I log(floatvariable) it returns 0. I know it's not 0 however. How do I know this? Because every tick I set scaleglow to be equal to floatvariable. If floatvariable was indeed 0 so would the scaleglow and the object would be invisible. It is not invisible. In fact it is the exact brightness it should be so I know the variable is being passed yet for some reason logging this variable returns nothing. Weird huh? Unfortunately the location really is passing none and not simply logging it incorrectly...
 
Last edited:

Papapishu

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
This is from the shockrifle:
Code:
Smoke = Spawn(class'ShockBeam',,,SmokeLocation,SmokeRotation);
Smoke.MoveAmount = Vector/NumPoints;
Smoke.NumPuffs = NumPoints - 1;

This is the beam:
Code:
var vector MoveAmount;
var int NumPuffs;

replication
{
// Things the server should send to the client.
unreliable if( Role==ROLE_Authority )
		MoveAmount, NumPuffs;
}

The only thing I can see that differs is that the beam has a replication statement.
Have you tried it?

Also are you sure it's not a format-error?
If you log a vector, you might wanna try loggong all coordinates alone...
like:
log(vector.x $" : " $vector.y $" : " $vector.z );

And when you use a float, have you type-casted it?
like
MyFloat=float(MyInt)
(I don't remember exactly if this is the proper way...)

A tip:
use var() to make it edible, and also it can help in cross-class references.
use var export to make the variable open to any class in the package...

Perhaps you might need to show us a bit more of the code, since the problem can be somewhere else...
 

SoSilencer

Harry Goz (1932 - 2003)
Nov 27, 2000
834
0
0
43
unrealdev.net
My UT somehow got corrupt :( I went to my dads to setup a server and when I tested it there everything worked ok. Came home and reinstalled the game and it worked fine.