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
Move Player / Remove Timers
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#7
RE: Move Player

(05-20-2013, 08:41 PM)Shirder Wrote:
Spoiler below!

(05-20-2013, 06:35 PM)Smoke Wrote: Easiest way to do this is just place a blockbox with an script area in front of it. So the player can't go trough it and the script area for a message like: I can't go there..

Well, that's actually what I try to avoid^^ Invisible walls always seem kinda unrealistic. In this case, the protagonist just doesn't want to go there; better than being blocked.


(05-20-2013, 07:08 PM)Adrianis Wrote: In the Justine expansion you have this extra function, shown at the bottom of hte Player section in the engine scripts page

void MovePlayerForward(float afAmount)

That sounds like what I've been looking for all the time! But how do I do a looping timer? When I use this, it tells me "No matching signatures to 'MovePlayerForward(const unit)'". Might have something to do with it...

Well, have you got the Justine expansion pack? The function won't be available if you don't.
That error message, 'No matching signatures to...', means it doesn't recognise the function you are trying to use.

Heres a very simple example of a looping timer

void OnStart()
{
    AddTimer("Looper", 0.16, "TimerLoop");
}

void TimerLoop(string &in strTimer)
{
    AddTimer("Looper", 0.16, "TimerLoop");
}

So at the start of the game, a timer goes of after 0.16s, which activates the TimerLoop function, which sets a timer for another 0.16s which activates TimerLoop again, and so on and so forth. That will keep looping 60 times a second.

Obviously in your case that first timer should be called when the player collides with a script area, not right at the start of the game, but the principle is exactly the same.

Hope that helps!

EDIT: Gah, ninja'd... oh well, better explanation at least

(This post was last modified: 05-21-2013, 02:51 AM by Adrianis.)
05-21-2013, 02:45 AM
Find


Messages In This Thread
Move Player / Remove Timers - by Shirder - 05-20-2013, 06:10 PM
RE: Move Player - by Slanderous - 05-20-2013, 06:29 PM
RE: Move Player - by OriginalUsername - 05-20-2013, 06:35 PM
RE: Move Player - by Adrianis - 05-20-2013, 07:08 PM
RE: Move Player - by Shirder - 05-20-2013, 08:41 PM
RE: Move Player - by Adrianis - 05-21-2013, 02:45 AM
RE: Move Player - by PutraenusAlivius - 05-21-2013, 02:43 AM
RE: Move Player - by Shirder - 05-21-2013, 10:20 PM
RE: Move Player / Remove Timers - by Shirder - 05-22-2013, 11:33 AM
RE: Move Player / Remove Timers - by Adrianis - 05-22-2013, 01:03 PM



Users browsing this thread: 1 Guest(s)