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
Patrol 2 enemy
nemero Offline
Junior Member

Posts: 2
Threads: 1
Joined: Sep 2012
Reputation: 0
#1
Patrol 2 enemy

Hi, I would like to do it on one map, patrol 2 enemies in other places. I created in level editor scriptarena 1 that make enemy 1 spawn. I found and applied to:

void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

and it works. Now I would like to do that for the second place. I scriptarena 2 and the enemy2, patchnote 11-15. How to do to make it work, first and second together?
09-03-2012, 08:11 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#2
RE: Patrol 2 enemy

well just...

void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollideTwo", "MonsterFunctionTwo", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

void MonsterFunctionTwo(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_15", 0, "");

}

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
09-03-2012, 08:29 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Patrol 2 enemy

What do you mean?
If you want the monster to follow a path and disappear, it's very simple.


void OnStart()
AddEntityCollideCallback("Player", "ScriptCollide", "Mons", true, 1);
AddEntityCollideCallback("Monster", "Erase area", "Disa", true, 1);

void Mons (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, ""); (Where the Erase area is set)
}

void Disa(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", false);
}

If you want them to patrol, so they are always there, moving, I have a more complicated system.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-03-2012, 09:57 PM
Find
nemero Offline
Junior Member

Posts: 2
Threads: 1
Joined: Sep 2012
Reputation: 0
#4
RE: Patrol 2 enemy

thx steve
it is what I meant

end 1 more question. For monster waterlurker I need to create water on the floor?
09-04-2012, 08:20 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Patrol 2 enemy

Yea search on how to make water. You figure it out, but remember to place pathnodes everywhere the Kaernk could get stuck

Trying is the first step to success.
09-04-2012, 08:25 PM
Find




Users browsing this thread: 1 Guest(s)