02-25-2012, 08:00 PM
Hello there. What I am hoping to achieve is that I have the player enter a room with a living entity in it. He then pulls a lever, which plays the "guardian activate" sound, and activates a Script Area in the doorway. As soon as he tries to leave and collides with it, he is forced to look back at the entity. The entity then warns him about something.
This is what I have so far, it's pretty much everything except the functions to be executed when leaving through the door.
Edit: Also, the sound file to played will be "warning_1.snt"
void ShelfSwing(string &in asEntity, int alState)
{
if (alState == -1)
{
SetMoveObjectState("shelf_1",1.0f);
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
StartScreenShake(.4, 4, 1, 1);
SetEntityActive("Warning_1", true);
return;
}
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever_1", "ShelfSwing");
AddEntityCollideCallback("Player", "Warning_1", "EntityTalk", true, 1);
}
void EntityTalk(string &in asParent, string &in asChild, int alState)
{
//Function needed for Player to look at entity and have entity speak to him. Then possibly fade to dust? Something like that.
}
I appreciate the help, thank you.
This is what I have so far, it's pretty much everything except the functions to be executed when leaving through the door.
Edit: Also, the sound file to played will be "warning_1.snt"
Spoiler below!
void ShelfSwing(string &in asEntity, int alState)
{
if (alState == -1)
{
SetMoveObjectState("shelf_1",1.0f);
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
StartScreenShake(.4, 4, 1, 1);
SetEntityActive("Warning_1", true);
return;
}
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever_1", "ShelfSwing");
AddEntityCollideCallback("Player", "Warning_1", "EntityTalk", true, 1);
}
void EntityTalk(string &in asParent, string &in asChild, int alState)
{
//Function needed for Player to look at entity and have entity speak to him. Then possibly fade to dust? Something like that.
}
I appreciate the help, thank you.