View Full Version : Weapon refuses to pass variables to projectile

11th Nov 2001, 08:33 PM
Maybe somebody has an idea cus I'm at a loss.


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.


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...

11th Nov 2001, 10:53 PM
This is from the shockrifle:

Smoke = Spawn(class'ShockBeam',,,SmokeLocation,SmokeRotation);
Smoke.MoveAmount = Vector/NumPoints;
Smoke.NumPuffs = NumPoints - 1;

This is the beam:

var vector MoveAmount;
var int NumPuffs;

// 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...
log(vector.x $" : " $vector.y $" : " $vector.z );

And when you use a float, have you type-casted it?
(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...

13th Nov 2001, 01:26 AM
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.