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
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Half of the script is firing, but not...

When you vaguely say "they are not taking the action they should be in game", are you talking about animations for new imported models? Have you gotten these models to work in Amnesia before?
Edit: "ThridGrowl" should probably be "ThirdGrowl" but as you have spelled it wrong at both places, that shouldn't cause an error. Cool, though.

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-16-2012, 02:33 AM by Cranky Old Man.)
04-16-2012, 02:30 AM
Find
JetlinerX Offline
Senior Member

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

Meaning the player gets set to inactive, and just stands there, while the debug messages say they are firing the scripts, the player is not moving, sounds are not playing etc.

EDIT: Looks like the only script that seems to be working is the forced walk. The MovePlayerForward script is the only one that is working. But the sounds dont play, and the player does not look at the entities he/she is supposed to.

EDIT 2: Heartbeat sound is working aswell.
*RAGE FACE*

Players cant look at Static Objects, nor can sounds play off of them!!!!!!!!!!!!!!!!!!

Figured it all out. Never mind this topic. Thanks all.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

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




Users browsing this thread: 1 Guest(s)