Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Enemy Patroling and Disapearing: Help!
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#22
RE: Enemy Patroling and Disapearing: Help!

(04-27-2012, 11:11 AM)heyitsrobert97 Wrote:
(04-27-2012, 08:21 AM)Cocomunches Wrote:
Quote: ////////////////////////////
// Run when entering map
void OnStart()

{
SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);
}

void OnPickup(string &in asEntity)
{
SetEntityActive ("Monster_Grunt", true);
AddTimer("monsterstart", 60.0f, "byegrunt");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_1", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_2", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_3", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_4", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_5", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_6", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_7", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_8", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_9", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_10", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_11", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_12", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_13", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_14", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_15", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_16", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_17", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_18", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_19", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_20", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_21", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_22", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_23", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_24", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_25", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_26", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_27", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_28", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_29", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_30", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_31", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_32", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_33", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_34", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_35", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_36", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_37", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_38", 0, "");
}

void byegrunt(string &in asTimer)
{
SetEntityActive ("Monster_Grunt", false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(2.0f, 0);
}
You Can Delete The Collide area to create areanodes. you just add them right after you spawn the grunt like i did. I also Added Something to The void OnLeave() to help you. it will stop the music (if you have any) and fade it out when you exit the map to main menu or another map Big Grin

haha, thanks! Also, very stupid question, how do you add music?


(04-27-2012, 11:56 AM)TeamSD Wrote: AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_1", 2, "");

Is this supposed to be

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

That is the name of a default pathnode. Unless you erased that last letter on purpose, it might cause the grunt to follow nothing. Just wondering.
:| i feel stupid. haha, thanks very much, IT WORKS!!!!

(This post was last modified: 04-27-2012, 09:07 PM by Cocomunches.)
04-27-2012, 08:45 PM
Find


Messages In This Thread
RE: Enemy Patroling and Disapearing: Help! - by Cocomunches - 04-27-2012, 08:45 PM



Users browsing this thread: 1 Guest(s)