I think I came up with a way to do it. I call it "__Ace_1_'s Pattented Client/Server Shotgun Spread Without Using More Than One Trigger Code":
your coordinates:
y1 = ((Rand()-0.5)*5);
x1 = ((Rand()-0.5)*5);
y2 = ((Rand()-0.5)*5);
x2 = ((Rand()-0.5)*5);
y3 = ((Rand()-0.5)*5);
x3 = ((Rand()-0.5)*5);
y4 = ((Rand()-0.5)*5);
x4 = ((Rand()-0.5)*5);
y5 = ((Rand()-0.5)*5);
x5 = ((Rand()-0.5)*5);
------------------------------
coding it:
if(y1 < 0)
{
y1=(y1-(2*y1));
}
if(y2 < 0)
{
y2=(y2-(2*y2));
}
if(y3 < 0)
{
y3=(y3-(2*y3));
}
if(y4 < 0)
{
y4=(y4-(2*y4));
}
if(y5 < 0)
{
y5=(y5-(2*y5));
}
codedYcoords = (y1*100000)+(y2*10000)+(y3*1000)+(y4*100)+(y5*10);
if(x1 < 0)
{
x1=(x1-(2*x1));
}
if(x2 < 0)
{
x2=(x2-(2*x2));
}
if(x3 < 0)
{
x3=(x3-(2*x3));
}
if(x4 < 0)
{
x4=(x4-(2*x4));
}
if(x5 < 0)
{
x5=(x5-(2*x5));
}
codedXcoords = (x1*100000)+(x2*10000)+(x3*1000)+(x4*100)+(x5*10);
------------------------------
decoding it:
y1 = (codedYcoords/100000);
y2 = (codedYcoords/10000) - y1*10;
y3 = (codedYcoords/1000) - (y1*10+y2*10);
y4 = (codedYcoords/100)- (y1*10+y2*100+y3*1000);
y5 = (codedYcoords/10)- (y1*10+y2*100+y3*1000+y4*10000);
x1 = (codedXcoords/100000);
x2 = (codedXcoords/10000) - x1*10;
x3 = (codedXcoords/1000) - (x1*10+x2*100);
x4 = (codedXcoords/100) - (x1*10+x2*100+x3*1000);
x5 = (codedXcoords/10) - (x1*10+x2*100+x3*1000+x4*10000);
------------------------------
doing the shotgun spread:
randvec1 = VectorSet(x1, y1, 0);
randvec2 = VectorSet(-x2, y2, 0);
randvec3 = VectorSet(x3, -y3, 0);
randvec4 = VectorSet(-x4, -y4, 0);
randvec5 = VectorSet(x5, y5, 0);
------------------------------
Now this wont be exactly like a real randvec but it should be pretty **** close.
Oh and sombody tell me how to do that code thing on these forums.
[This message has been edited by Ace1 (edited November 21, 2002).]
I am _ Ace_1 _ , and I approve this message.