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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Event: Player seeing monster will stop player moving.
RedFiction12 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
Event: Player seeing monster will stop player moving.

Yo people! Its me again! And i am needing some help right now.

I am planning to do simple "Event" when player collides to certain script area, monster will come out from darkness and player will stop suddenly moving. Monster will come player (while player is looking at it) and hit him ones. After that player fades out into darkness.

I havent done anything big yet, because ive stucked into this one part.

This is my code:

void OnStart()
    {
        AddEntityCollideCallback("Player", "scary_monster", "MonsterFunction", true, 1);
        AddEntityCollideCallback("Player", "scary_monster", "PlayerLookAtGrunt", true, 1);       
    }

void MonsterFunction(string &in asParent, string &in asChild, int alState)
    {
        SetEntityActive("servant_grunt_1", true);
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
    }

void PlayerLookAtGrunt(string &in asChild, string &in asParent, int alState)

    {
        StartPlayerLookAt("servant_grunt_1", 6.0, 6.0, "");
        AddTimer("", 3.0f, "StopLook");
        SetPlayerActive(false);
        SetMessage("Messages", "Message4", 4);
    }

void StopLook(string &in asTimer)
    {
        StopPlayerLookAt();
    }

.lang file


<CATEGORY Name="Messages">
        <Entry Name ="Message4">"What the hell is that thing?!"</Entry>
   </CATEGORY>

Quick tip:
1. Monster path is working good.
2. Scripted area is working correctly.


Quick tip:
1. Player doesnt stop moving.
2. Player wont look at monster.

Current project : Bad Dreams - 9%

Hello my name is Jaakko Uusitalo and i am co-leader of TF2 Organization called Trolling Bunnies.
07-06-2012, 11:40 PM
Website Find


Messages In This Thread
Event: Player seeing monster will stop player moving. - by RedFiction12 - 07-06-2012, 11:40 PM



Users browsing this thread: 1 Guest(s)