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
Monster appear
Vradcly Offline
Member

Posts: 100
Threads: 6
Joined: Jan 2011
Reputation: 0
#2
RE: Monster appear

Create the monster in your map and make sure its not active (there is a checkbox for that), create pathnodes for where you want the enemy patrol (areas, pathnode), make sure not to set the pathnodes to far apart. Then open your map script and add the first and last point in the enemy path inside void OnStart()
{
AddEnemyPatrolNode("servant_grunt_1","PathNodeArea_1",0.0f, "");
AddEnemyPatrolNode("servant_grunt_1","PathNodeArea_50",0.0f, "");
}
like that for example.

Then create a area of type script and put it in your map where you want the player to be when the enemy activates. Then add a collide callback for that area:
AddEntityCollideCallback("Player", "Script_Area_1", "CollideScript_Area_1", true, 1);
Something like that.

Then you put the CollideScript_Area_1 function outside of your OnStart(), ex above:

void CollideScript_Area_1(string &in asParent, string &in asChild, int alState)
{

}
void OnStart()
{
(lots of code)
}

and at last put the SetEntityActive("servant_grunt_1", true); inside your callision function:

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

like that. Hope that helps, if not I suggest you look at the guides for this, there are lots of information out there...
01-29-2011, 01:01 PM
Find


Messages In This Thread
Monster appear - by Sudden - 01-29-2011, 11:54 AM
RE: Monster appear - by Vradcly - 01-29-2011, 01:01 PM
RE: Monster appear - by Robby - 01-29-2011, 01:04 PM
RE: Monster appear - by Sudden - 01-29-2011, 02:55 PM
RE: Monster appear - by CrushedRaiD - 02-05-2011, 08:35 AM
RE: Monster appear - by Oscar House - 02-05-2011, 09:28 AM
RE: Monster appear - by CrushedRaiD - 02-05-2011, 09:43 AM



Users browsing this thread: 1 Guest(s)