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
Same issue again; Activating a script area.
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#8
RE: Same issue again; Activating a script area.

void OnPickup(string &in asEntity, string &in type)
{
if(asEntity == "usekey")
{
StopPlayerLookAt();

}
else if(asEntity == "lantern")
{
StopPlayerLookAt();
}
else if(asEntity == "MachineNote")
{
StartPlayerLookAt("puzzleholes", 2, 3, "");
SetMessage("Messages", "puzzleholes", 0);
AddTimer("Z1", 5, "lookatfirstbox");
AddTimer("Z2", 6.5, "lookatfirstbox");
SetPlayerActive(false);
}
else if(asEntity == "rod_2")
{
AddEntityCollideCallback("Player", "spawnmonster", "activatethegrunt", true, 1);
}
}

Yeah sorry FastHunteR my first reply was indeed meant for himynamebob1. But when I posted that your post wasn't there yet, probably due to my terribad internet. But here's my whole pickup script. And I can confirm the first three are working well. And I was messing around putting SetEntityActive in the last part and setting the script area in the level editor inactive and that kinda stuff, but that still didn't work.

And it is kinda weird, because in my very first problem with this this solved it;

void OnPickup(string &in asEntity, string &in type)
{
if(asEntity == "tocarnellroomkey")
{
AddEntityCollideCallback("Player", "pusharea", "Push", true, 1);
PlaySoundAtEntity("", "scare_male_terrified5.snt", "randomatticdoor", 2, false);
}

void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(0, 0, -45000, false);
GiveSanityDamage(15, true);
}

SECOND EDIT: I've added PlayGuiSound("break_glass_bottle.snt", 1); to else if(asEntity == "rod_2") and IT DOES NOT PLAY. So it has to be a problem with the pickup, but I have no idea what to fix, I do not get an error and the script doesn't seem out of the ordinary, and the rod is called rod_2.
(This post was last modified: 07-04-2012, 11:50 AM by ApeCake.)
07-04-2012, 11:11 AM
Find


Messages In This Thread
RE: Same issue again; Activating a script area. - by ApeCake - 07-04-2012, 11:11 AM



Users browsing this thread: 1 Guest(s)