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
Script Help SetEntityActive help?!
Mojake Offline
Junior Member

Posts: 7
Threads: 6
Joined: Mar 2012
Reputation: 0
#1
SetEntityActive help?!

I'm trying to make a statue appear as the player enters an area, however the statue always remains in map before I've even reached the area... The entity is definitely set as inactive. Also, when I put a PlayerLookAt function to look at the statue; it doesn't look at the statue and just gives sanity damage. Here's my script:


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Crowbar", "mansion_1", "Break", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "mansion_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "StartMusic_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "StatueAppear", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "StatueShock", true, 1);
}

////////Openmansion_1////////
void Break(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("Crowbar");
}

////////DoorSlam////////
void mansion_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(10.0f, true);
SetPlayerActive(false);
StartPlayerLookAt("mansion_1", 3.0f, 5.0f, "");
AddTimer("timer01", 1.5f, "StopLook");
}

void StopLook(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

////////Music_1////////

void StartMusic_1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambience_swoop_myst.ogg", true, 0.2, 2, 1, true);
}

////////StatueAppear////////


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

void StatueShock(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("deformed_man_1", 3.0f, 5.0f, "");
AddTimer("timer01", 1.5f, "StopLookStatue");
GiveSanityDamage(20.0f, true);
PlaySoundAtEntity("", "scare_male_terrified3.ogg", "Player", 0, false);
}


void StopLookStatue(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}


Eternal gratitude to whoever can sort this out for me! Heart
03-16-2012, 09:23 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: SetEntityActive help?!

Statues like that can't be disabled.

03-17-2012, 04:07 AM
Find




Users browsing this thread: 1 Guest(s)