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
Amnesia Level Editor: AREA SCRIPTS NOT WORKING
woot903 Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Shocked  Amnesia Level Editor: AREA SCRIPTS NOT WORKING

For some odd
reason all of my area scripts work except for any new ones I try to create. All
of the entity collide callbacks used refer to script areas. Please take a look
at my code and you will notice the test_this function and scare_light function.
BOTH of these functions do not work. What I mean by that is that clearly in the
game the player will collide with these areas but nothing at all will happen. I
have double checked spelling and such and all is good. I even enabled physics
debug to make sure that the player actually collides with the invisible script
area (which they do) and still haven't found the problem. All other functions
and script areas work fine.


If someone
could please help me debug this little problem I would appreciate a lot! Smile


Thanks,
Woot903


MY SCRIPT:
Quote:void OnStart ()
{
PlayMusic("02_amb_strange.ogg", true, .8, 0, 1, true);
AddEntityCollideCallback("Player", "scare_1_trig", "MonsterFunction", true, 1);
SetEntityCallbackFunc("key_1", "scare_2_trig");
AddEntityCollideCallback("Player", "testing", "test_this", true, 1);
AddEntityCollideCallback("Player", "scare_3", "scare_light", true, 1);
AddEntityCollideCallback("Player", "scare_2_text", "scare_2_t", true, 1);
SetEntityActive("scare_3_trig1", true);
//DEBUG (DEVELOPER TOOLS)

}

//Functions
void test_this(string &in asEntity, string &in type)
{
SetEntityActive("test", true);
}
void scare_light(string &in asEntity, string &in type)
{
SetLampLit("r1", true, true);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0F, false);
PlaySoundAtEntity("", "amb_alert.snt", "scare_1", 0.0F, false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0F, false);
GiveSanityDamage(50.0f, true);

SetEntityActive("scare_1", true);
AddEnemyPatrolNode("scare_1", "PathNodeArea_1", 0, "");
}

void scare_2_trig(string &in asEntity, string &in type)
{
//removes items from room and creates statue when script area is triggered
SetEntityActive("c1", false);
SetEntityActive("c2", false);
SetEntityActive("c3", false);
SetEntityActive("c4", false);
SetEntityActive("c5", false);
SetEntityActive("c6", false);
SetEntityActive("c7", false);
SetEntityActive("c8", false);
SetEntityActive("c9", false);
SetEntityActive("c10", false);
SetEntityActive("c11", false);
SetEntityActive("c12", false);
SetEntityActive("c13", false);
SetEntityActive("c14", false);
SetEntityActive("c15", false);
SetEntityActive("c16", false);
SetEntityActive("c17", false);
SetEntityActive("c18", false);
SetEntityActive("c19", false);
SetEntityActive("c20", false);
SetEntityActive("c21", false);
SetEntityActive("c22", false);
SetEntityActive("c23", false);
SetEntityActive("c24", false);
SetEntityActive("c25", false);
SetEntityActive("c26", false);
SetEntityActive("c27", false);
SetEntityActive("c28", false);
SetEntityActive("c29", false);
SetEntityActive("c30", false);
SetEntityActive("c31", false);

SetEntityActive("t1", false);
SetEntityActive("t2", false);
SetEntityActive("t3", false);
SetEntityActive("t4", false);
//tables incactive
SetEntityActive("scare_2_by", false);
SetEntityActive("scare_2_text", true);
SetEntityActive("scare_2_shad", true);
SetEntityActive("scare_2_stat", true);
SetLightVisible("scare_2_light", true);
SetLightVisible("scare_2_light_2", true);
//turns off lights
SetLightVisible("c32", false);
SetLightVisible("c33", false);
}

void scare_2_t(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "Popup2", 6);
}

03-06-2012, 04:05 AM
Find


Messages In This Thread
Amnesia Level Editor: AREA SCRIPTS NOT WORKING - by woot903 - 03-06-2012, 04:05 AM



Users browsing this thread: 1 Guest(s)