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
Multiple Issues Help Half of the script is firing, but not...
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Half of the script is firing, but not...

So I have a huge scare here, and I have been trying to troubleshoot it for hours. I have added debug messages to all the timers, and everything is firing off. Yet, they are not taking the action they should be in game. The whole script for the map is 230 lines of code, so I dont want to post it all, but if it helps, here is the scare part of it. Tell me if you can spot anything. I am willing to upload the script somewhere if need be.

The Collide Scripts at the top look like:

        AddEntityCollideCallback("Player", "DogAttackArea", "DogAttack", true, 1);
        AddEntityCollideCallback("Player", "Stopdawalk", "StopWalking", true, 1);

And the functions down below look like:

//------------------------------------------------------------------------------------------------//
void DogAttack(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "wolf1.snt", "GrowlTarget1", 0, false);
        SetEntityActive("Stopdawalk", true);
        SetPlayerActive(false);
        AddTimer("", 2.0f, "NextGrowl");
        AddDebugMessage("Start Script Fired.", false);
}
//------------------------------------------------------------------------------------------------//
void NextGrowl(string &in asTimer)
{
        PlaySoundAtEntity("", "wolf2.snt", "GrowlTarget2", 0, false);
        AddTimer("", 2.0f, "ThridGrowl");
        AddDebugMessage("Sound and Start Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void ThridGrowl(string &in asTimer)
{
        PlaySoundAtEntity("", "wolf2.snt", "Lookat", 0, false);
        AddTimer("", 0.5f, "TheLook");
        AddDebugMessage("Next Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void TheLook(string &in asTimer)
{
        StartPlayerLookAt("Lookat", 1, 1, "");
        AddTimer("", 4.0f, "TheWalk");
        AddDebugMessage("Look at Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void TheWalk(string &in asTimer)
{
        SetPlayerMoveSpeedMul(0.2);
        AddTimer("", 2.3f, "Walk");
        PlaySoundAtEntity("", "Heartbeatslow.snt", "Player", 0, false);
        AddDebugMessage("Walk Timer Fired", false);
}
//------------------------------------------------------------------------------------------------//
void Walk(string &in asTimer)
{
        MovePlayerForward(5.0f);
        AddTimer("", 0.1f, "restart_walk");    
        AddDebugMessage("You're walking", false);
}
//------------------------------------------------------------------------------------------------//
void restart_walk(string &in asTimer)
{
        AddTimer("restarter", 0, "atwalkto");
}
//------------------------------------------------------------------------------------------------//
void atwalkto(string &in asTimer)
{
        MovePlayerForward(10.0f);
        AddTimer("looper", 0.1f, "restart_walk");
}
//------------------------------------------------------------------------------------------------//
void StopWalking(string &in asParent, string &in asChild, int alState)
{
        RemoveTimer("looper");
        RemoveTimer("restarter");
        MovePlayerForward(0.0f);
        SetPlayerMoveSpeedMul(1);
        AddTimer("", 2.0, "Attack");
        AddDebugMessage("You Stopped Walking", false);
}
//------------------------------------------------------------------------------------------------//
void Attack(string &in asTimer)
{
        StartPlayerLookAt("DogAttack", 10, 10, "");
        PlaySoundAtEntity("", "barkgrowl.snt", "Player", 0, false);
        SetEntityActive("DogAttack", false);
        AddDebugMessage("Dog Attacking Now.", false);
}
//------------------------------------------------------------------------------------------------//

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 04-16-2012, 02:21 AM by JetlinerX.)
04-16-2012, 02:21 AM
Website Find


Messages In This Thread
Half of the script is firing, but not... - by JetlinerX - 04-16-2012, 02:21 AM



Users browsing this thread: 1 Guest(s)