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
More then one monster?
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#1
More then one monster?

Hello! New guy here, I am getting the hang of the scripting so far.

But I wonder about one thing. How can I spawn more than one monster? I mean I walk into an area, and a monster spawns and runs towards me and is an hallusination. The script has done it's job.

But how can I make another area do the same thing? I script my first one, it works exactly like I want it to.

But is there a way to make a another area like this? The first area spawns a grunt, then a another area spawns a another grunt? I've tried and tried and no success.

This is my Script.

void OnStart()
{
AddEntityCollideCallback("Player" , "Monsterscare" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster_scare" , true);
ShowEnemyPlayerPosition("Monster_scare");
GiveSanityDamage(10, true);
}


Where do I place the other script for the 2nd monster to appear?

Please, help would be much appriciated.

-Angerpull. Angel
06-26-2011, 10:12 PM
Find
WatzUpzPeepz Offline
Member

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
#2
RE: More then one monster?

Just copy what you already did and change the names to suit the second monster

Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player" , "Monsterscare" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "Monsterscare2" , "MonsterFunc2" , true , 1);

}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster_scare" , true);
ShowEnemyPlayerPosition("Monster_scare");
GiveSanityDamage(10, true);
}

void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster_scare2" , true);
ShowEnemyPlayerPosition("Monster_scare2");
GiveSanityDamage(10, true);
}




06-26-2011, 10:17 PM
Find
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#3
RE: More then one monster?



Thank you so much! It works! I had no idea how to do it but you saved me ^^
06-26-2011, 10:43 PM
Find




Users browsing this thread: 3 Guest(s)