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
Script Not Working D:
Homicide13 Offline
Senior Member

Posts: 323
Threads: 41
Joined: Nov 2010
Reputation: 14
#1
Script Not Working D:

So I have a script that will count the number of ingredients in an area and will then activate a grunt if all the ingredients are present, but it's not working, and I don't know why....
void Grill(string &in asParent, string &in asChild, int alState)
{
    if(alState == 1)
    {
        if(GetLocalVarInt("NumBodyParts") == 3)
        {
            SetEntityActive("servant_grunt_1",true);
        }
        else
        {
            AddLocalVarInt("NumBodyParts",1);
        }
    }
    else
    {
        AddLocalVarInt("NumBodyParts",-1);
    }
}

With the callback functions

    AddEntityCollideCallback("corpse_male_leg_1","Grill","Grill",false,0);
    AddEntityCollideCallback("corpse_male_arm_1","Grill","Grill",false,0);
    AddEntityCollideCallback("corpse_male_torso_1","Grill","Grill",false,0);

I have used a "playGUIsound" function to test each part of the script above, and each section works except for the section within the
if(GetGlobalVarInt("NumBodyParts") == 3)
        {
            SetEntityActive("servant_grunt_1",true);
        }

It is running the other parts of the code, but either the AddLocalVarInt functions aren't working, or I need to somehow initialize the variable "NumBodyParts" and I do not know how to do this. (From what I could tell from looking at the other Amnesia scripts, this variable should create itself when I use the AddLocalVarInt function, though of course I could be wrong).

11-12-2010, 04:29 AM
Find


Messages In This Thread
Script Not Working D: - by Homicide13 - 11-12-2010, 04:29 AM
RE: Script Not Working D: - by Arvaga - 11-12-2010, 01:31 PM
RE: Script Not Working D: - by Homicide13 - 11-12-2010, 04:19 PM



Users browsing this thread: 2 Guest(s)