Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unlock level door?
Author Message
Gladoshatesyou Offline
Junior Member

Posts: 20
Joined: Apr 2014
Reputation: 0
Post: #1
Unlock level door?

I can use scripts to unlock a normal door, easy. But when I try with a level door, it never works. Maybe some thing in effect is the fact that the level door is always like the 2nd locked door in the level so maybe its just a matter of combining scripts, but here you go. Here is my script- (castle_1 is the level door.)

void OnStart()
{
AddUseItemCallback("", "key_study_1", "mansion_door_1", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "castle_1", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "SpawnEnemy", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "Script_Scare", "Scare", true, 1);
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("character_infected_1", true);
SetEntityActive("deformed_man_7", true);
SetEntityActive("deformed_man_8", true);
SetEntityActive("deformed_man_9", true);
SetEntityActive("deformed_man_10", true);
SetEntityActive("deformed_man_11", true);
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("character_infected_1", "PathNodeArea_11", 4, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_door_1", 0, false);
RemoveItem(asItem);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem(asItem);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("deformed_man_12", true);
SetEntityActive("deformed_man_13", true);
SetEntityActive("deformed_man_14", true);
SetEntityActive("deformed_man_15", true);
}
void MoveShelf(string &in asEntity, int alState)
{
if (GetLocalVarInt("Check") == 0)
{
if (alState == 1)
{
SetMoveObjectState("Shelf", 1);

PlaySoundAtEntity("", "quest_completed.snt", "Shelf", 0, false);

SetLocalVarInt("Check", 1);

return;
}
}
}
04-25-2014 01:10 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Unlock level door? - Gladoshatesyou - 04-25-2014 01:10 AM
RE: Unlock level door? - Mudbill - 04-25-2014, 08:23 AM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 12:17 PM
RE: Unlock level door? - DnALANGE - 04-25-2014, 01:26 PM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 01:33 PM
RE: Unlock level door? - DnALANGE - 04-25-2014, 01:35 PM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 01:38 PM
RE: Unlock level door? - DnALANGE - 04-25-2014, 01:47 PM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 01:56 PM
RE: Unlock level door? - DnALANGE - 04-25-2014, 02:03 PM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 02:11 PM
RE: Unlock level door? - PutraenusAlivius - 04-25-2014, 02:15 PM
RE: Unlock level door? - DnALANGE - 04-25-2014, 02:28 PM
RE: Unlock level door? - Gladoshatesyou - 04-25-2014, 02:35 PM
RE: Unlock level door? - PutraenusAlivius - 04-25-2014, 02:52 PM



User(s) browsing this thread: 1 Guest(s)