Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replacing tinderboxes and lantern
JonnyAnomaly Offline
Member

Posts: 179
Threads: 20
Joined: Nov 2012
Reputation: 14
#8
RE: Replacing tinderboxes and lantern

Thanks, I managed to get that to work but I'm having a problem. Basically, I want the light to move along the length of a train, and once it gets to a certain point, it will reset and start its movement over again and keep looping. I managed to get the light to move properly at the start, but it won't ever repeat the movement. Here is my script:


void OnStart()

{
SetEntityActive("block_box_1", true);
SetMoveObjectStateExt("block_box_1", 1, 2, 10.0f, 0.1f, true);
AddTimer("", RandFloat(1.0f, 20.0f), "TrainLights");
}
void ResetLights(string &in asParent, string &in asChild, int alState)
{
ResetProp("block_box_1");
AddTimer("", RandFloat(10.0f, 20.0f), "TrainLights");
}
void TrainLights(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("block_box_1", true);
SetMoveObjectStateExt("block_box_1", 1, 2, 10.0f, 0.1f, true);
AddTimer("", RandFloat(25.0f, 30.0f), "ResetLights");
}

I have also set the AutoMoveStateGoal in the model editor to 100 so it will travel enough to cover the length of the train. I have an OpenState of 1.0 and the AutoMove button is checked.
12-03-2012, 09:09 AM
Find


Messages In This Thread
RE: Replacing tinderboxes and lantern - by JonnyAnomaly - 12-03-2012, 09:09 AM



Users browsing this thread: 1 Guest(s)