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
How do I make a lever???
Brute Offline
Member

Posts: 197
Threads: 10
Joined: Aug 2011
Reputation: 3
#7
RE: How do I make a lever???

It doesn't work again, but thanks for your try DRedshot! Big Grin
At this point I show you my script :
------------------------------------------------------------------------------------------------------
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player" , "Enemy02_appear" , "Enemy02_appear" , true , 1);
AddEntityCollideCallback("LeverExit" , "ExitOpen" , "OpentheExit" , true , 1);
SetEntityPlayerInteractCallback("Library_Key", "Enemy03_appear", true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
SetPlayerLampOil(0);
PlayMusic("10_amb.ogg", true, 1.0f, 0, 0, true);
AddUseItemCallback("", "PrisonDoor_Key", "PrisonDoor", "KeyOnDoor1", true);
AddUseItemCallback("", "Ceiling_Key", "Ceiling", "KeyOnDoor2", true);
AddUseItemCallback("", "Library_Key", "Library", "KeyOnDoor3", true);
}

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

}
////////////////////////////
// Actual functions

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("PrisonDoor", false, true);
RemoveItem("PrisonDoor_Key");
PlaySoundAtEntity("", "unlock_door.snt", "PrisonDoor", 0.0f, true);
SetEntityActive("Enemy01" , true);
}

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

void Enemy03_appear(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Enemy03" , true);
AddEnemyPatrolNode("Enemy03", "Path0", 1000000.0f, "true");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Ceiling", false, true);
RemoveItem("Ceiling_Key");
PlaySoundAtEntity("", "unlock_door.snt", "Ceiling", 0.0f, true);
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Library", false, true);
RemoveItem("Library_Key");
PlaySoundAtEntity("", "unlock_door.snt", "Library", 0.0f, true);
}

void OpentheExit(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Basement", false, true);
SetEntityActive("Guard01" , true);
PlaySoundAtEntity("LeverExit", "levelexitopen.ogg", "Player", 0.5f, false);
SetEntityActive("Guard02" , true);
SetEntityActive("Guard03" , true);
}
------------------------------------------------------------------------------------------------------
(I have removed the PatrolNodes, because they would explode my post)
The Lever has the settings:
Name: LeverExit
The ScriptArea has the setting:
Name: ExitOpen

Huh Huh Huh
So what is wrong? Any ideas?





09-24-2011, 11:52 AM
Find


Messages In This Thread
How do I make a lever??? - by Brute - 09-23-2011, 03:43 PM
RE: How do I make a lever??? - by Homicide13 - 09-23-2011, 04:37 PM
RE: How do I make a lever??? - by Brute - 09-23-2011, 05:48 PM
RE: How do I make a lever??? - by DRedshot - 09-23-2011, 06:22 PM
RE: How do I make a lever??? - by Brute - 09-24-2011, 08:13 AM
RE: How do I make a lever??? - by DRedshot - 09-24-2011, 08:51 AM
RE: How do I make a lever??? - by Brute - 09-24-2011, 11:52 AM
RE: How do I make a lever??? - by Brute - 09-24-2011, 03:21 PM



Users browsing this thread: 4 Guest(s)