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
Doors behave stangely
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Calling functions from timers

When making timers, the parameters (void Example ()) are always "string &in asTimer". So:

//======================
//Functions
    void AddDebugMessage(string text)// Just for debug purposes
        {
            AddDebugMessage(text, false);
        }
    void StartIntro()//Starts intro sequence
        {
            AddDebugMessage("Intro Started");
            FadeOut(0.0f);
            FadeIn(15.0f);
            SetPlayerActive(false);
            AddTimer("MoveForward", 0.01f, "IntroMove");
            AddTimer("StopMoving", 53.0f, "IntroHalt");
        }
    void IntroMove(string &in asTimer)
        {
            MovePlayerForward(0.005f);
            AddTimer("MoveForward", 0.01f, "IntroMove");
        }
    void IntroHalt(string &in asTimer)
        {
            AddDebugMessage("Player stops");
            RemoveTimer("MoveForward");
            OpenDoor("prison_11");
        }
    void OpenDoor(string door)
        {
            AddDebugMessage("Door opens");
            SetSwingDoorDisableAutoClose(door, true);
            SetSwingDoorClosed(door, false, false);
            SetMoveObjectState(door, 0.1f);
            AddPropForce(door, -500, 0, 0, "world");
        }
//======================
//Run when map first starts
    void OnStart()
        {
            if(ScriptDebugOn() and ! HasItem("lantern"))
                {
                    GiveItemFromFile("lantern", "lantern.ent");
                    SetPlayerLampOil(100.0f);
                    SetPlayerRunSpeedMul(5.0f);
            
                    for(int i = 0;i < 10;i++)
                        {
                            GiveItemFromFile("tinderbox", "tinderbox.ent");
                        }
                }
            StartIntro();
        }

//=====================
//Run when entering map//
    void OnEnter()
        {
            
        }

//=====================
//Run when leaving map//
    void OnLeave()
        {
        
        }

What are you exactly trying to achieve at the OpenDoor thing? I don't understand what you are trying to do.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
03-20-2013, 05:53 PM
Find


Messages In This Thread
Doors behave stangely - by ingedoom - 03-20-2013, 05:36 PM
RE: Calling functions from timers - by The chaser - 03-20-2013, 05:53 PM
RE: Calling functions from timers - by ingedoom - 03-20-2013, 06:01 PM
RE: Calling functions from timers - by Adrianis - 03-22-2013, 12:29 PM
RE: Calling functions from timers - by ingedoom - 03-22-2013, 04:21 PM
RE: Calling home made functions - by ingedoom - 03-21-2013, 07:25 AM
RE: Doors behave stangely - by Adrianis - 03-22-2013, 05:18 PM



Users browsing this thread: 1 Guest(s)