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
Problem with Scripts: AddPropForce not working
Webber1900 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jan 2013
Reputation: 0
#5
RE: Problem with Scripts: AddPropForce not working

I did some changes to the script and the objects in the level editor, and seems I can now only get it to work until after I interact with the door.

Here is the modified script:

//This is only executed when the map is loaded for the first time. Only happens once. Can be used for adding effects that should not repeat.//
void OnStart()
{  
    SetPlayerLampOil(70);
    GiveItemFromFile("lantern", "lantern.ent");
    AddEntityCollideCallback("Player", "TestDoorScript", "TestFunction", false, 1);
}

void TestFunction(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("mansion_1", false, false);
    SetSwingDoorDisableAutoClose("mansion_1", true);
    AddTimer("swing_door", 0.001f, "TimerDoor");
}

void TimerDoor(string &in asTimer)
{
    AddPropForce("mansion_1", -1000.0f, 0.0f, 0.0f, "world");
}

//This is executed every time you enter the level. Can be executed several times. Can be used for playing music and adding checks.//
void OnEnter()
{
    AddEntityCollideCallback("Player", "ReturnPlayerArea_0", "ReturnPlayer", false, 1);
}

void ReturnPlayer(string &in asParent, string &in asChild, int alState)
{
    TeleportPlayer("PlayerStartArea_1");
}

//This is executed every time you leave the level. Can be executed several times. Can be used for stopping music//
void OnLeave()
{

}
06-06-2013, 03:33 AM
Find


Messages In This Thread
RE: Problem with Scripts: AddPropForce not working - by Webber1900 - 06-06-2013, 03:33 AM



Users browsing this thread: 1 Guest(s)