The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Shirder Offline
Junior Member

Posts: 6
Threads: 2
Joined: Dec 2011
Reputation: 0
#1
Move Player / Remove Timers

Hello Forum,

Basically, I want to block a way with a script area. When the player walks into the area, it says something like "You can't go here right now", then the player turns around and can walk again. Everything in-script, no movement enabled.
The script looks like this so far:
Spoiler below!
void ResAreaSign(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetMessage("Thoughts", "RestrictedArea", 5.0);
StartPlayerLookAt("SignArea_1", 5, 5, "");
AddTimer("", 2.0f, "NoWay");
}

void NoWay(string &in asTimer)
{
StartPlayerLookAt("SignArea_3", 5, 5, ""); [180° turn]
AddTimer("", 1.0f, "NoWay2");
}

void NoWay2(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

But here comes the problem: The player needs to step out of the area, otherwise he can just walk backwards through it. I would like to add a function which moves the player to specific coordinates. But exactly there is the problem. I just can't get the player to move. AddPlayerBodyForce is not working, neither is the Force and impulses tutorial (No matter what numbers I use, the player does zero movement). I also tried to teleport, but it just looks bad. Creating an invisible wall also does not work and I don't want to use something like this.

Is there any way of moving the player in 'off-control' mode? Like he does a step back while turning around? 'cause that's exactly what I'm trying to do ^^;

English isn't my first language, so please forgive my grammar mistakes :D
(This post was last modified: 05-22-2013, 11:35 AM by Shirder.)
05-20-2013, 06:10 PM
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)