Spawn to random point

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Spawn to random point

Post by creekmonkey »

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,"");
}
}

}]
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

RESOLVED

Post by creekmonkey »

Commented out // NewOrder("Idle");

And changed the switch statement to the following

switch(random(1,4)) // chose between 4 death animations
{
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,"");
}
}
Post Reply