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
GetEntityExists looping timer with monster
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: GetEntityExists looping timer with monster

Good idea! Smile

EDIT: I can't get it to work...

Here is my script.

Spoiler below!

void OnStart()
{
AddEntityCollideCallback("servant_grunt_2", "ScriptArea_10", "OnMonsterCollide_3", true, 1);
}

void OnMonsterCollide_3(string &in asParent, string &in asChild, int alState)
{
AddTimer("IfMonsterCollide", 0.1, "IfMonsterCollide");
}

void IfMonsterCollide(string &in asTimer)
{
if(GetEntitiesCollide("ScriptArea_11", "servant_grunt_2") == false)
{
AddDebugMessage("Level door is unlocked", false);
PlaySoundAtEntity("", "door_level_cellar_open", "Player", 0, false);
SetLevelDoorLocked("level_celler_1", false);
RemoveTimer("ReenableMonsterCollide");
RemoveTimer("IfMonsterCollide");
}
else
AddDebugMessage("Timer_1_active", false);
AddTimer("ReenableMonsterCollide", 0.1, "ReenableMonsterCollide");
}

void ReenableMonsterCollide(string &in asTimer)
{
AddDebugMessage("Timer_2_active", false);
AddTimer("IfMonsterCollide", 0.1, "IfMonsterCollide");
}


The monster disappears, but the timer doesn't get anything...

Trying is the first step to success.
(This post was last modified: 06-08-2012, 08:29 AM by FlawlessHappiness.)
06-07-2012, 01:38 PM
Find


Messages In This Thread
RE: GetEntityExists looping timer with monster - by FlawlessHappiness - 06-07-2012, 01:38 PM



Users browsing this thread: 1 Guest(s)