The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Monster Spawning and Pathing Question
rybray Offline
Junior Member

Posts: 31
Threads: 9
Joined: Aug 2011
Reputation: 1
#1
Monster Spawning and Pathing Question

First I want to thank the forum for bein' so helpful, I have posted many questions in the past days and really appreciate the advice.

I have my code set up so that when I pick up a key, a monster should spawn. The monster "servant_grunt_1" is set as inactive in the editor, and I think I have the code right, as he follows the commands to look for me along the nodes and dissipates into smoke when he comes too close. The problem is, search_grunt_ogg is playing before I pick up the key. I tried disabling him in the OnStart function, but that didn't work. Is there a script function equivalent that I could not find?

-Also, just a side question, I put path nodes in the spawn monster function, but also wanted to test the ShowEnemyPlayerPosition function. I tried it with and without the pathnode activations in the monster spawn function, and both times no monster spawned. Whats up with that?


void OnStart()
{FadeOut(0);
AddTimer("IntroTimer", 1, "Intro");
AddEntityCollideCallback("Player", "Door_Script", "DoorOpen", true, 1);
AddEntityCollideCallback("Player", "script_memento", "Memento", true, 1);
AddEntityCollideCallback("Player", "memento_complete", "FinishMemento", true, 1);
AddEntityCollideCallback("servant_grunt_1", "hallu_script", "SetHallu", true, 1);
SetEntityPlayerInteractCallback("key_of_death", "SpawnMonster", true);
StartPlayerLookAt("AreaLookAt", 0.1f, 0.1f, "");
AddTimer("donelook", 10.0f, "TimerDoneLookAt");
}

void SetHallu(string &in asParent, string &in asChild, int alState)
{
SetEnemyIsHallucination("servant_grunt_1", true);
}

void SpawnMonster(string &in asEntity)
{
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, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 4, "");
}
08-13-2011, 03:29 AM
Find


Messages In This Thread
Monster Spawning and Pathing Question - by rybray - 08-13-2011, 03:29 AM



Users browsing this thread: 1 Guest(s)