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
Spawn a monster
Funman Offline
Member

Posts: 53
Threads: 10
Joined: Apr 2011
Reputation: 0
#1
Spawn a monster

Here is my code to spawn a monster:

void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}


What do I need to fill in the void MonsterFunc1 line to make it work?
06-15-2011, 05:36 PM
Find
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#2
RE: Spawn a monster

Leave it as it is, it should work Smile

06-15-2011, 05:39 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#3
RE: Spawn a monster

Spawn an enemy in the editor, uncheck the active box and name him "servant_grunt" (crucial that it's exactly the same as in the code), spawn a script area named ScriptArea_1 and save the .hps as the same mapname+.hps and it should work.
06-15-2011, 05:41 PM
Find
Funman Offline
Member

Posts: 53
Threads: 10
Joined: Apr 2011
Reputation: 0
#4
RE: Spawn a monster

Oh, I didn't know to uncheck the active box. Thanks!
06-15-2011, 05:44 PM
Find




Users browsing this thread: 1 Guest(s)