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
Key Dosen't Open Door
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#1
Key Dosen't Open Door

Hello.
I got a problem with my script (i think it's from the script)

Here's my script


////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "stone_hammer_move_1", "cellar_wood01_1", "break1", false);
AddUseItemCallback("", "stone_hammer_move_1", "castle_silent_1", "break2", false);
AddUseItemCallback("", "key_sewer_1", "prison_1", "UsedKeyOnDoor", true);
SetSanityDrainDisabled(true);
SetEntityPlayerLookAtCallback("sign_cistern_1", "MessageCitern", false);
SetEntityPlayerLookAtCallback("sign_cistern_entrance_chain_1", "MessageCitern2", false);
SetEntityPlayerInteractCallback("castle_silent_1", "MessageDoor", false);
SetEntityPlayerInteractCallback("key_sewer_1", "ActiveArea", true);
SetEntityPlayerInteractCallback("tinderbox_4", "SpawnCorpse", true);
SetEntityPlayerInteractCallback("stone_hammer_move_1", "CompleteQuestlol", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "Hurt", false, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "HammerScare", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Armor", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorClosed("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_1", 0, false);
RemoveItem("key_sewer_1");
GiveSanityBoost();
}

void CompleteQuestlol(string &in asItem, string &in asEntity)
{
CompleteQuest("HammerTakeQuest", "quest01");
}

void MessageDoor(string &in asEntity)
{
SetMessage("MessagesDoor", "One", 3.0f);
}

void Hurt(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(5.0f, "BloodSplat", true, false);
SetMessage("Messages", "One", 4.0f);
}

void HammerScare(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetEntityActive("stone_hammer_move_1", true);
AddPropForce("stone_hammer_move_1", 4600, 0, 0, "world");
StartPlayerLookAt("stone_hammer_move_1", 3.1f, 5.0f, "");
AddTimer("timer01", 0.2f, "TakeDamage");
}

void Armor(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_nice_complete_4", true);
SetEntityActive("armour_nice_complete_5", true);
SetEntityActive("armour_nice_complete_6", true);
SetEntityActive("armour_nice_complete_7", true);
SetEntityActive("armour_nice_complete_8", true);
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "armour_nice_complete_6", 0, false);
AddTimer("timerarmor", 1.0f, "noarmor");
}

void TakeDamage(string &in asTimer)
{
GivePlayerDamage(10.0f, "BloodSplat", true, false);
PlaySoundAtEntity("", "player_falldamage_max.snt", "Player", 0, false);
AddTimer("timer454", 1.0f, "stopnope");
}

void noarmor(string &in asTimer)
{
SetEntityActive("armour_nice_complete_4", false);
SetEntityActive("armour_nice_complete_5", false);
SetEntityActive("armour_nice_complete_6", false);
SetEntityActive("armour_nice_complete_7", false);
SetEntityActive("armour_nice_complete_8", false);
}

void stopnope(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
AddTimer("timerhammerlol", 0.5f, "relook");
}

void relook(string &in asTimer)
{
StartPlayerLookAt("stone_hammer_move_1", 1.0f, 3.0f, "");
SetPlayerActive(false);
AddTimer("timerhammerlol", 2.0f, "redelook");
}

void redelook(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
AddQuest("HammerTakeQuest", "quest01");
}

void MessageCitern(string &in asEntity, int alState)
{
SetMessage("Messages", "Two", 2.0f);
}

void MessageCitern2(string &in asEntity, int alState)
{
SetMessage("Messages", "Three", 3.0f);
}

void break1(string &in asItem, string &in asEntity)
{
SetPropHealth("cellar_wood01_1", 0.0f);
GivePlayerDamage(20, "BloodSplat", false, true);
}

void break2(string &in asItem, string &in asEntity)
{
SetPropHealth("castle_silent_1", 0.0f);
GivePlayerDamage(20, "BloodSplat", false, true);
}

void ActiveArea(string &in asEntity)
{
AddEntityCollideCallback("Player", "ScriptArea_3", "Monster", true, 1);
}

void SpawnCorpse(string &in asEntity)
{
SetEntityActive("corpse_bloody_1", true);
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "corpse_bloody_1", 0, false);
}

void Monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
GiveSanityDamage(5.0f, true);
for(int i = 1; i < 11; i++)
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+i, 0, "Idle");
}
}

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

}

When i take the key , and try to open the door :

-I got the sanity boost , just like in the script
-the "unlock_door" sound is played , just like in the script
-the "key_sewer_1" key is removed , just like in the script

But my Door is still locked.
My door isn't too big (because sometimes , if your door is too big for the doorway , it cannot open.) , and i can move it like 10 degrees , like i didn't did nothing.


Anyone know how to fix this ?


Thanks
02-22-2012, 06:06 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Key Dosen't Open Door

Change:
SetSwingDoorClosed("prison_1", false, true);
To:
SetSwingDoorLocked("prison_1", false, true);
Smile

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 02-22-2012, 06:10 PM by Unearthlybrutal.)
02-22-2012, 06:10 PM
Website Find
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#3
RE: Key Dosen't Open Door

Oh , i'm sorry , i didn't saw this Big Grin

Thanks !
02-23-2012, 04:33 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: Key Dosen't Open Door

(02-23-2012, 04:33 PM)onv Wrote: Oh , i'm sorry , i didn't saw this Big Grin

Thanks !
No Problem Smile

When Life No Longer Exists
Full-conversion mod
02-23-2012, 05:35 PM
Website Find




Users browsing this thread: 1 Guest(s)