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
Script Help MovePlayerForward
vengey Offline
Member

Posts: 79
Threads: 7
Joined: Feb 2013
Reputation: 0
#7
RE: MovePlayerForward

Here let me explain it quite simply.


void atwalkto(string &in asTimer)
{
MovePlayerForward(10.0f);
AddTimer("looper", 0.12f, "restart_walk");
}
void restart_walk(string &in asTimer)
{
AddTimer("restarter", 0, "atwalkto");
}

Notice how it is setup
The MovePlayerForward is a SINGLE time event that pushes the player forward, so we need this process to repeat
So we add a timer of a very small time to give the illusion the player is walking
The timer is setup so when the timer goes to zero it activates the method: restart_walk
Within restart_walk we have a timer that is a reseter

It is set to zero so that it automatically returns to the atwalkto method
Then the process repeats
Then you add a script area the player collides with that will cause the process to stop and re-enable the player
void timer13(string &in asTimer)
{
RemoveTimer("looper");
RemoveTimer("restarter");
TeleportPlayer("teleport2");
SetPlayerActive(true);
AddTimer("T14", 1.0f, "timer14");
}

This is a timer that is activated after the player enters the script area
This deletes the timers that were used in the walking simulation which makes sure it doesn't push the player forward anymore and does not loop anymore, then we set the player active again so he can move after the cinematic is done and over with

Before you do anything at all YOU MUST do this BEFORE the moveplayerforward sequence: SetPlayerActive(false);

Now then, if you would like to change the SPEED of the event, there are two methods of going about it.

METHOD 1:
To make the player slower, make the moveplayerforward command have a smaller number and the looper have a tad larger number. To make the player faster do the exact opposite.

METHOD 2:
Use the SetPlayerSpeedMul command to make the player itself slower or faster

(This post was last modified: 07-13-2013, 02:26 AM by vengey.)
07-13-2013, 02:23 AM
Find


Messages In This Thread
MovePlayerForward - by Pshyched - 07-03-2013, 04:07 PM
RE: MovePlayerForward - by PutraenusAlivius - 07-03-2013, 04:23 PM
RE: MovePlayerForward - by Adrianis - 07-03-2013, 05:14 PM
RE: MovePlayerForward - by DeAngelo - 07-03-2013, 04:33 PM
RE: MovePlayerForward - by WALP - 07-04-2013, 10:41 AM
RE: MovePlayerForward - by DeAngelo - 07-04-2013, 08:57 PM
RE: MovePlayerForward - by vengey - 07-13-2013, 02:23 AM
RE: MovePlayerForward - by Adrianis - 07-15-2013, 01:50 PM



Users browsing this thread: 1 Guest(s)