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
How do I make an enemy spawn when the player enters a script area?
KHShox Offline
Junior Member

Posts: 28
Threads: 11
Joined: Apr 2011
Reputation: 0
#3
RE: How do I make an enemy spawn when the player enters a script area?

Quote:////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "DoorClose", "CollideScript", true, 1);
}

void CollideScript(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_2", true, true);

AddEntityCollideCallback("Player", "DoorClose", "ScriptArea_2", true, 1);


GiveSanityDamage(2, true);
PlaySoundAtEntity("DoorClose", "react_scare.snt", "Player", 0, false);

AddEntityCollideCallback("Player", "Monster", "Spawn", true, 1);

void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Fag", true);
}





There is my whole code after I added your stuff in it. But I got an error upon loading my map.

[Image: bf3_sig-1298673357.jpg]
04-04-2011, 12:34 AM
Find


Messages In This Thread
RE: How do I make an enemy spawn when the player enters a script area? - by KHShox - 04-04-2011, 12:34 AM



Users browsing this thread: 2 Guest(s)