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
"if" scripting
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
Question  "if" scripting

I have a problem with the if scripting...
My idea is that a room is patroled by a monster, but to keep the monstermusic from being played all the time, the monster only spawns when you touch the door. Then after a few minutes it goes inactive again because it is has no more pathnodes.

Now, when you pick up a note that says you have to go to the other side of the patroled room, the monster will be gone.

Here is my script:
void OnStart()
{
SetEntityPlayerInteractCallback("door_teacher1", "OnInteract1", false);

}


void OnInteract1(string &in asEntity)
{
if(HasItem("note3") == true)
{

}
else

SetEntityActive("monster_teacher1", true);
AddEnemyPatrolNode("monster_teacher1", "PathNodeArea_1", 1, "");
AddEnemyPatrolNode("monster_teacher1", "PathNodeArea_2", 1, "");
}

The problem is that the monster spawns even though i've got the note

Trying is the first step to success.
03-15-2012, 06:47 PM
Find


Messages In This Thread
"if" scripting - by FlawlessHappiness - 03-15-2012, 06:47 PM
RE: "if" scripting - by ClayPigeon - 03-15-2012, 06:56 PM
RE: "if" scripting - by SilentStriker - 03-15-2012, 07:04 PM
RE: "if" scripting - by FlawlessHappiness - 03-15-2012, 07:12 PM
RE: "if" scripting - by SilentStriker - 03-15-2012, 07:14 PM
RE: "if" scripting - by Your Computer - 03-15-2012, 07:21 PM
RE: "if" scripting - by FlawlessHappiness - 03-15-2012, 07:24 PM



Users browsing this thread: 1 Guest(s)