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


Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pathnodes help!
johan116360 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Pathnodes help!

Hi, im working on a custom story but im trying to do pathnodes but it never works. plz help and heres the code:


void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityCallbackFunc("key1", "OnPickup");
AddUseItemCallback("", "key1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("crowbar_1", "OnPickups");
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
{

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("monster_a", true);
AddEnemyPatrolNode("monster_a", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("monster_a", "PathNodeArea_6", 4, "");
}





void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key1");
}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
ShowEnemyPlayerPosition("servant_grunt_1");
}








void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door1", 0.0f);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void OnLeave()
{

}
03-18-2012, 03:11 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Pathnodes help!

If that is the exact copy of the script, it'd be worth mentioning that the "
{" at the bottom of your onStart() is backwards, it should be "}" . If that doesn't have any effect, try adding:


ClearEnemyPatrolNodes(string& asEnemyName);



right in between setting the entity active, and adding the nodes. Hope that helps

I rate it 3 memes.
03-18-2012, 06:12 PM
Find
johan116360 Offline
Junior Member

Posts: 9
Threads: 2
Joined: Mar 2012
Reputation: 0
#3
RE: Pathnodes help!

TY buth befor you posted that i saw that the { was wrong but thanks for relpying. Big Grin
03-19-2012, 07:43 PM
Find




Users browsing this thread: 1 Guest(s)