Using SetFlag and AddFlagOrder
Posted: Tue Jul 17, 2007 4:34 am
I have a problem with a script not working.
I have two pawns. One as a button, and one as a platform.
When the player clicks on the button with the mouse, the platform is supposed to move to a point and then return.
I have two ScriptPoint entities. One at the point the platform goes to, and the other where it returns.
When I click on the button, the platform moves to the first point (ScriptPoint1), but it stops there and does not return (scriptPoint2).
In ScriptPoint1 szEntityName I have DesPointA, and in the NextPoint I have HomePointA.
In ScriptPoint2 szEntityName I have HomePointA.
In the script for the button I have:
Spawn[()
{
Console(true);
HideFromRadar(true);
Gravity(true);
LowLevel("SelectEntityByMouse");
}]
SelectEntityByMouse[()
{
if(self.lbutton_pressed)
{
SetFlag(1, true); //Start up PlatformA to move
}]
}
Then in the script for the platform I have:
{
Spawn[()
{
HideFromRadar(true);
Gravity(false);
AddFlagOrder(1, true, "ActivateDiscA");
}]
ActivateDiscA[()
{
RotateToPlayer("", 60, false, "");
MoveToPoint("", 30, "my_sounds\\transfer.wav");
NewOrder("Home");
}]
Home[()
{
NextPoint();
MoveToPoint("", 30, "my_sounds\\transfer.wav");
Delay("", 10, "");
}]
}
I don't see anything in the console to show me why the platform is not moving to the second point. Can anyone help me out please?
I have two pawns. One as a button, and one as a platform.
When the player clicks on the button with the mouse, the platform is supposed to move to a point and then return.
I have two ScriptPoint entities. One at the point the platform goes to, and the other where it returns.
When I click on the button, the platform moves to the first point (ScriptPoint1), but it stops there and does not return (scriptPoint2).
In ScriptPoint1 szEntityName I have DesPointA, and in the NextPoint I have HomePointA.
In ScriptPoint2 szEntityName I have HomePointA.
In the script for the button I have:
Spawn[()
{
Console(true);
HideFromRadar(true);
Gravity(true);
LowLevel("SelectEntityByMouse");
}]
SelectEntityByMouse[()
{
if(self.lbutton_pressed)
{
SetFlag(1, true); //Start up PlatformA to move
}]
}
Then in the script for the platform I have:
{
Spawn[()
{
HideFromRadar(true);
Gravity(false);
AddFlagOrder(1, true, "ActivateDiscA");
}]
ActivateDiscA[()
{
RotateToPlayer("", 60, false, "");
MoveToPoint("", 30, "my_sounds\\transfer.wav");
NewOrder("Home");
}]
Home[()
{
NextPoint();
MoveToPoint("", 30, "my_sounds\\transfer.wav");
Delay("", 10, "");
}]
}
I don't see anything in the console to show me why the platform is not moving to the second point. Can anyone help me out please?