The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Unlock level door?
Gladoshatesyou Offline
Junior Member

Posts: 20
Threads: 5
Joined: Apr 2014
Reputation: 0
#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


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



Users browsing this thread: 1 Guest(s)