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
What is wrong with this script.
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
What is wrong with this script.

Hi.

Im trying to get that when the lever: "Lever1" collides tih "Lever1Area" it should trigger some functions but it doesnt work Sad

Can anybody see whats wrong with my script??:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Stench", "WhatIsThat", true, 1);
AddEntityCollideCallback("Player", "CAVEIN", "OMG", true, 1);
AddEntityCollideCallback("Lever1", "Lever1Area", "UnlockDoor", true, 1);
}

void UnlockDoor(string &in asParent, string &in asChild, int alState)
{
SetLevelDoorLocked("prison_2", false, false);
PlaySoundAtEntity("Lever1Area", "lever_wood_move.ogg", "Player", 0.0, false);
}

void OMG(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("SoundFromCaveIn", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea2");
PlaySoundAtEntity("SoundFromCaveIn", "explosion_rock_large.ogg", "Player", 0.0, false);
SetEntityActive("cave_in_1",true);
CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "AreaEffects", false);
PlayMusic("11_event_tree.ogg", false, 1, 3, 0, false);
}

void StopLookAtArea2(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought7", 0);
PlaySoundAtEntity("SoundFromCaveIn", "react_pant6.ogg", "Player", 0.0, false);
StopPlayerLookAt();
}

void WhatIsThat(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Gravel", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea1");
PlaySoundAtEntity("Gravel", "react_breath_slow1.ogg", "Player", 0.0, false);
}

void StopLookAtArea1(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought6", 0);
StopPlayerLookAt();
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 3, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
03-18-2011, 08:21 AM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: What is wrong with this script.

Only thing I can think is wrong, right now, is that the entity or the area is misnamed. They are named correctly, right?
03-18-2011, 08:42 AM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#3
RE: What is wrong with this script. (SOLVED)

(03-18-2011, 08:42 AM)Russ Money Wrote: Only thing I can think is wrong, right now, is that the entity or the area is misnamed. They are named correctly, right?

Yes, i got it working though Big Grin
I had to edit the level door script thingy xD
03-18-2011, 10:08 AM
Find




Users browsing this thread: 1 Guest(s)