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 Reply
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#2
RE: Need help making a body creep up behind you

Okay, First to activate a script that isn't activated yet.

you just had to put SetEntityActive("ScriptName", true);

I see in your script You already have that down. Do you have your Script Inactive in the level editor?

-Grey Fox

Current Project
Forgotten
08-21-2011, 08:04 PM
Find Reply
Bennick Offline
Member

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

(08-21-2011, 08:04 PM)GreyFox Wrote: Okay, First to activate a script that isn't activated yet.

you just had to put SetEntityActive("ScriptName", true);

I see in your script You already have that down. Do you have your Script Inactive in the level editor?

-Grey Fox

Omg, I just realized... I didn't save the level after I had added the script... disregard my stupidity. Big Grin

Fratricide (title not finalized): 2/7 maps. :D
08-21-2011, 09:53 PM
Find Reply
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#4
RE: Need help making a body creep up behind you

It's okay, it happens. Tongue Any name for this we can look forward to?
08-21-2011, 09:57 PM
Find Reply




Users browsing this thread: 1 Guest(s)