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...
|