Frictional Games Forum (read-only)

Full Version: Monster keeps disappearing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

I'm making a custom story. When you come at a new area, a monster will spawn. He will keep patrolling around 30 pathnodes. But after a while he will just disappear. But if I follow him quietly and don't lose my eye on him, he won't dissappear, because than he will just keep following the Pathnodes.
How can I make the monster keep looping his patroll, so he will never stop or dissapear? (until I reach a certain area, but he will disappear already if I reach a certain area early).
I have pasted the part of the patrolling monster right down here. Who can help?

Code:
void OnEnter()
{
AddEntityCollideCallback("Player", "Monster_sleepingrooms", "Grunt_Sleepingrooms", true, 1);
}

void Grunt_Sleepingrooms(string &in asParent, string &in asChild, int alState)
{    
    SetEntityActive("Grunt_Sleepingrooms", true);
    PlayMusic("search_grunt.ogg", true, 2, 0, 1, true);
{for (int x = 0; x <= 4; x += 1)
{    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_1", 2, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_6", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_8", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_9", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_10", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_11", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_12", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_13", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_14", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_15", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_16", 2, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_17", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_18", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_19", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_20", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_21", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_22", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_23", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_24", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_25", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_26", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_27", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_28", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_29", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_30", 4, "");
    }
}
}
I think that it disappears when it gets too far away from you
You have like 200 pathnodes so that he follows them Big Grin
... or the grunt just goes to sleepBig Grin...

okay, that wasn't a very good joke
Monsters automatically deactivate when the player is out of their activation distance. If you edit the monster, you can increase this distance.
(11-02-2011, 03:12 PM)Your Computer Wrote: [ -> ]Monsters automatically deactivate when the player is out of their activation distance. If you edit the monster, you can increase this distance.
" <Var Name="ActivationDistance" Value="40" /> "


This?
(11-02-2011, 03:38 PM)Unearthlybrutal Wrote: [ -> ]
(11-02-2011, 03:12 PM)Your Computer Wrote: [ -> ]Monsters automatically deactivate when the player is out of their activation distance. If you edit the monster, you can increase this distance.
" "


This?


No i think he means using the Model Editor?
Thank you guys, the problem is solved Smile
In Modeleditor just change this:
" <Var Name="ActivationDistance" Value="40" /> "
I've changed it to 9999, so it won't be disappearing again even if I went to Tokyo
(11-02-2011, 03:55 PM)flamez3 Wrote: [ -> ]
(11-02-2011, 03:38 PM)Unearthlybrutal Wrote: [ -> ]
(11-02-2011, 03:12 PM)Your Computer Wrote: [ -> ]Monsters automatically deactivate when the player is out of their activation distance. If you edit the monster, you can increase this distance.
" "


This?


No i think he means using the Model Editor?
It can be changed with both: editing the .ent file or with model editor
(11-02-2011, 07:08 PM)Sauron The King Wrote: [ -> ]Thank you guys, the problem is solved Smile
In Modeleditor just change this:
" "
I've changed it to 9999, so it won't be disappearing again even if I went to Tokyo


No problemSmile
Monsters will only deactivate if they are idle outside of the player's range. If you give them patrol routes they won't deactivate when out of range.
Pages: 1 2