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
Why doesnt this script work!?
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#5
RE: I see no Problems!?

(07-09-2011, 12:57 AM)Snuffalofagus Wrote: I'm not so sure about the path nodes but for the entity to spawn, try this:

In the level editor, create an enemy area (i think thats the name of the type of area) where you want it to spawn, then in the .hps file add this

void OnStart()
{
AddEntityCollideCallback("Player" , "GruntCorner" , "MonsterFunc1" , true , 1);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
CreateEntityAtArea("grunt_1", "servant_grunt.ent", "SpawnArea", true);
AddEnemyPatrolNode("CornerGrunt", "Path1", 0, "");
AddEnemyPatrolNode("CornerGrunt", "Path2", 5, "");
AddEnemyPatrolNode("CornerGrunt", "Path3", 0, "");
AddEnemyPatrolNode("CornerGrunt", "Path4", 0, "");
}

"SpawnArea" is the name of what you named the area, it doesn't have to be "SpawnArea"

P.S. If there is no area named "EnemyArea" or whatever in the level editor, just use a regular "ScriptArea"

I like to use the Activate Entity better.

But here's my Script.

Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player" , "ZP" , "MonsterFunc1" , true , 1);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Z1" , true);
AddEnemyPatrolNode("Z1", "Path1", 0, "");
AddEnemyPatrolNode("Z1", "Path2", 5, "");
AddEnemyPatrolNode("Z1", "Path3", 0, "");
AddEnemyPatrolNode("Z1", "Path4", 0, "");
}

Now let me explain. Z1 = The Grunt that is Spawning. ZP Is the Script AREA. Can you tell me what is wrong?

07-09-2011, 01:24 AM
Find


Messages In This Thread
Why doesnt this script work!? - by Angerpull - 07-08-2011, 10:59 PM
RE: I see no Problems!? - by Zypherzemus - 07-08-2011, 11:12 PM
RE: I see no Problems!? - by Angerpull - 07-08-2011, 11:50 PM
RE: I see no Problems!? - by Zypherzemus - 07-09-2011, 12:57 AM
RE: I see no Problems!? - by Angerpull - 07-09-2011, 01:24 AM



Users browsing this thread: 1 Guest(s)