Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Entity Activate/Deactivate?
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#14
RE: Entity Activate/Deactivate?

void OnStart()
{
SetEntityPlayerInteractCallback("key_tower_1", "ActivateMonster", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityCallbackFunc("chemical_container_full_1", "OnPickup");
}

void OnEnter()
{


}



void OnLeave()
{

}

void ActivateMonster(string &in asEntity) //You have the wrong callback syntax.
{

SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_13", 0.001f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_15", 0.001f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0.001f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0.001f, "");
//I replaced 0 with 0.001f so that the monster won't stop at each PathNode.
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door_2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("armour_nice_complete_8", true);
SetEntityActive("armour_nice_complete_7", true);
SetEntityActive("armour_nice_complete_6", false);
SetEntityActive("armour_nice_complete_5", false);
PlaySoundAtEntity("","impact_wood_heavy_low.snt","armour_nice_complete_7", 0.1f, true);

PlaySoundAtEntity("","impact_wood_heavy_low.snt","armour_nice_complete_8", 0.1f, true);
}

Fixed.
Word of advice: When using sounds, at least check if they match or not.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-20-2013, 02:50 AM
Find


Messages In This Thread
Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 08:05 AM
RE: Entity Activate/Deactivate? - by Kullin - 05-19-2013, 08:32 AM
RE: Entity Activate/Deactivate? - by Romulator - 05-19-2013, 08:39 AM
RE: Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 04:09 PM
RE: Entity Activate/Deactivate? - by 7heDubz - 05-19-2013, 04:12 PM
RE: Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 04:29 PM
RE: Entity Activate/Deactivate? - by Kullin - 05-19-2013, 04:57 PM
RE: Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 05:07 PM
RE: Entity Activate/Deactivate? - by Kullin - 05-19-2013, 05:53 PM
RE: Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 05:56 PM
RE: Entity Activate/Deactivate? - by Kullin - 05-19-2013, 06:56 PM
RE: Entity Activate/Deactivate? - by Bonehead - 05-19-2013, 07:36 PM
RE: Entity Activate/Deactivate? - by PutraenusAlivius - 05-20-2013, 02:50 AM



Users browsing this thread: 2 Guest(s)