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)
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
[SOLVED]Collide doesn't work (I must be blind)

This function won't call.
No errors. No alerts.

What should happen is easy:
Door collides with area -> Monster gets active -> Monster follows pathnode -> Monster disappear

Script:

void OnStart()
{
AddEntityCollideCallback("castle_arched01_1", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 0);

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

}


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);
}

None of the 2 debug messages get called. What am I missing?

Trying is the first step to success.
(This post was last modified: 09-01-2012, 10:06 AM by FlawlessHappiness.)
08-29-2012, 06:55 PM
Find
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
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Collide doesn't work (I must be blind)

No why would they call when i start the level?
The door isn't colliding with them... The 0 should not be the problem...
I'm pretty sure it only triggers when it has collided, and then gets out of the area

Trying is the first step to success.
(This post was last modified: 08-29-2012, 09:08 PM by FlawlessHappiness.)
08-29-2012, 09:07 PM
Find
Statyk Offline
Schrödinger's Mod

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

Did you at least try it? I could agree that I'm wrong if it actually failed and try to help you more from there.
08-29-2012, 09:10 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Collide doesn't work (I must be blind)

I will try when i get back from school ^_^

Trying is the first step to success.
08-30-2012, 06:28 AM
Find
Zaffre Away
Posting Freak

Posts: 867
Threads: 50
Joined: Jul 2012
Reputation: 30
#6
RE: Collide doesn't work (I must be blind)

Damn. I had the same problem for Rising Water in its early stages, where a Suitor would come from a door, patrol a bit, then walk into a Script Area and become inactive, but I could never get it right. I eventually scrapped the idea when I came up with the whole "sea level is rising" type thing instead of the "captured and dragged into a mansion, you have to escape" idea which I originally had, instead replacing it with a Lurker that becomes active after you interact with a certain door. If I knew how to fix it, though, I would help you.

Still can't get the Lurker to get unstuck from door frames though Dodgy

As of September 2nd, 2014, I've left the Frictional forums. Check my profile for more details.
(This post was last modified: 09-01-2012, 01:48 AM by Zaffre.)
09-01-2012, 01:43 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Collide doesn't work (I must be blind)

I actually found out that i had to close Amnesia.exe and start it again Wink

Trying is the first step to success.
09-01-2012, 10:06 AM
Find




Users browsing this thread: 1 Guest(s)