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
[SOLVED]Collide doesn't work (I must be blind)
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Collide doesn't work (I must be blind)

(08-29-2012, 06:55 PM)beecake Wrote: void OnStart()
{
AddEntityCollideCallback("castle_arched01_1", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 1);

AddEntityCollideCallback("servant_grunt_3", "AreaMonsterDisappear_1", "MonsterDisappear_1", true, 1);

}


void OpenDoorGrunt(string &in asParent, string &in asChild, int alState)
{

AddDebugMessage("CALLING SCRIPT", false);

if(GetLocalVarInt("MonsterIsActive") == 1)
{
return;
}

if(GetLocalVarInt("StopMonster") == 1)
{
return;
}
AddDebugMessage("MONSTER ACTIVE", false);
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_100", 0, "");
SetLocalVarInt("MonsterIsActive", 1);
SetEntityActive("AreaOpenDoorGrunt", false);
}


void MonsterDisappear_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_3", false);
PlaySoundAtEntity("", "Enabled.snt", "AreaStopMonster", 0, false);
}
In OnStart, yu have the functions set to 0 at the end, which is both when colliding and not colliding. Basically, this function will be calling as soon as you start the level. Change them to 1 and try it again.
08-29-2012, 07:55 PM
Find


Messages In This Thread
RE: Collide doesn't work (I must be blind) - by Statyk - 08-29-2012, 07:55 PM



Users browsing this thread: 2 Guest(s)