Spawn to random point
Posted: Fri Nov 09, 2007 4:26 pm
How do I spawn my enemy pawns to random script point when game starts.
I use this in my death order to respawn which works fine but it will not work in the spawn order. What am I doing wrong?
DEATH[()
{
// chose between 4 different script points
switch(random(1,4))
{
case 1
{
TeleportToPoint("b1",0,0,0);
NewPoint("b1");
RotateToAlign("idle",500,false,"");
}
case 2
{
TeleportToPoint("b2",0,0,0);
NewPoint("b2");
RotateToAlign("idle",500,false,"");
}
case 3
{
TeleportToPoint("b3",0,0,0);
NewPoint("b3");
RotateToAlign("idle",500,false,"");
}
case 4
{
TeleportToPoint("b4",0,0,0);
NewPoint("b4");
RotateToAlign("idle",500,false,"");
}
}
}]
I use this in my death order to respawn which works fine but it will not work in the spawn order. What am I doing wrong?
DEATH[()
{
// chose between 4 different script points
switch(random(1,4))
{
case 1
{
TeleportToPoint("b1",0,0,0);
NewPoint("b1");
RotateToAlign("idle",500,false,"");
}
case 2
{
TeleportToPoint("b2",0,0,0);
NewPoint("b2");
RotateToAlign("idle",500,false,"");
}
case 3
{
TeleportToPoint("b3",0,0,0);
NewPoint("b3");
RotateToAlign("idle",500,false,"");
}
case 4
{
TeleportToPoint("b4",0,0,0);
NewPoint("b4");
RotateToAlign("idle",500,false,"");
}
}
}]