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
Need help making a body creep up behind you
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#1
Need help making a body creep up behind you

Okay, so here's what I've got in this level: a room with a dead body on the table, and a hallway with an monster that activates.

These are the things I'm hoping to accomplish with these rooms, in player interaction order:

1. When Player interacts with door, monster appears on other side and breaks it down and disappears at certain distance from the player. (ACCOMPLISHED)

2.When Player progresses towards end of the hallway, script activates that makes scream come from the dead body in the room behind and the body disappears (ACCOMPLISHED)

3. If Player returns to room to investigate the sound, he most likely steps into a previously inactive script area (activated by the screaming one at the end of the hallway) that makes the dead body appear floating in the air behind him in the hallway which disappears when he looks directly at it and plays a sound. (NOT ACCOMPLISHED)

In summary, my problem is, how do you activate an inactive script that does something?

Here's my room's script so far (It's pretty short, no worries.):

void OnStart()
{
FadeOut (0);
FadeIn(15);

PlayMusic("18_amb.ogg", true, 1.0f, 3.0f, 0, true);
}

void OnEnter()
{
SetEntityPlayerInteractCallback("castle_no_grav_1", "monster", true);
SetEntityPlayerLookAtCallback("antidote_corpse_drilled_2", "disappear", true);
AddEntityCollideCallback("Player", "Scream_Script", "death", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "behind", true, 1);
}

void monster(string& asName)
{
SetEntityActive("servant_grunt_1", true);
}

void death(string&in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "15_man_hunted.snt", "antidote_corpse_drilled_1", 0, false);
SetEntityActive("antidote_corpse_drilled_1", false);
SetEntityActive("ScriptArea_1", true);
}

void behind (string&in asParent, string &in asChild, int alState)
{
SetEntityActive("antidote_corpse_drilled_2", true);
}

void disappear(string&in asEntity, int alState)
{
SetEntityActive("antidote_corpse_drilled_2", false);
}

So I'm basically trying to make the "disappear" function work, but it works on a script that is activated by the first script area for "death". Help?

Fratricide (title not finalized): 2/7 maps. :D
08-21-2011, 05:43 PM
Find


Messages In This Thread
Need help making a body creep up behind you - by Bennick - 08-21-2011, 05:43 PM



Users browsing this thread: 1 Guest(s)