03-15-2012, 06:47 PM
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
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