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
Help needed with SetEntityActive in custom story
hagridas Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jan 2017
Reputation: 0
#1
Help needed with SetEntityActive in custom story

Hello. I decided to make a custom story. I am green at scripting, however i can make some simple things like key that unlocks specific doors n stuff. Today i tried to make a script where a monster spawns when player collides with ScriptArea, walks abit and then despawns at certain pathnode. The monster spawns, walks, however it doesnt despawn i tried multiple times watched multiple videos but it doesnt work. I will appreciate any help. My script:

void OnStart()
{
AddEntityCollideCallback("Player", "area", "monster", true,1);
AddEntityCollideCallback("grunt", "PathNodeArea_12", "CollideStop", true, 1);
}

void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt",true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_5", 4, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_6", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_7", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_8", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_9", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_10", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_11", 0.001, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_12", 0.001, "");
}

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

THANK YOU !!!
01-03-2017, 08:41 PM
Find


Messages In This Thread
Help needed with SetEntityActive in custom story - by hagridas - 01-03-2017, 08:41 PM



Users browsing this thread: 1 Guest(s)