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
Help with script
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
Help with script

I have made a very long corridor with rooms on the side and when you run past one room 2 monsters will spawn and when you run past next room 2 more monsters will spawn. For some reason my code wont work? Anyone see what's wrong?


/////////////////////////////
// Run first time starting map
void Onstart()

{
AddEntityCollideCallback("Player", "SpawnMonsters", "SpawnFunction_1", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_2", "SpawnFunction_2", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_3", "SpawnFunction_3", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_4", "SpawnFunction_4", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_5", "SpawnFunction_5", false, 1);
}

void SpawnFunction_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_1", true);
ShowEnemyPlayerPosition("grunt_1");
SetEntityActive("grunt_2", true);
ShowEnemyPlayerPosition("grunt_2");
}

void SpawnFunction_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_3", true);
ShowEnemyPlayerPosition("grunt_3");
SetEntityActive("grunt_4", true);
ShowEnemyPlayerPosition("grunt_4");
}

void SpawnFunction_3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_5", true);
ShowEnemyPlayerPosition("grunt_5");
SetEntityActive("grunt_6", true);
ShowEnemyPlayerPosition("grunt_6");
}

void SpawnFunction_4(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_7", true);
ShowEnemyPlayerPosition("grunt_7");
SetEntityActive("grunt_8", true);
ShowEnemyPlayerPosition("grunt_8");
}

void SpawnFunction_5(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_9", true);
ShowEnemyPlayerPosition("grunt_9");
SetEntityActive("grunt_10", true);
ShowEnemyPlayerPosition("grunt_10");
}




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

}

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

}

11-16-2012, 10:51 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Help with script

OnStart not Onstart

"What you think is irrelevant" - A character of our time

A Christmas Hunt
11-16-2012, 11:46 AM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Help with script

(11-16-2012, 11:46 AM)i3670 Wrote: OnStart not Onstart
Ty, can't believe i don't find these small mistakes....

11-16-2012, 12:28 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Help with script

It's what you have to look for

Trying is the first step to success.
11-16-2012, 12:32 PM
Find




Users browsing this thread: 1 Guest(s)