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
cant get level door to work :(
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
cant get level door to work :(

hey iv been working on a cs "Amnesia : The Castle" and i have made 2 maps but cant get level door to work i have made so you need a key but it says cannot use item bla bla bla... what to do here is the script for the key and door
PHP Code: (Select All)
void OnStart() 
{
SetEntityPlayerInteractCallback("Note_Test04""function"true);
AddUseItemCallback("""Rusty Key""door_1""KeyOnDoor"true); 
AddUseItemCallback("""Mail hall key""leveldoor_1""KeyOnDoor2"true); 
}


void KeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("door_1"falsetrue);
    
RemoveItem("Rusty Key");
    
PlaySoundAtEntity("""unlock_door.snt""door_1"0.0ftrue);
}


void OnEnter() 

{
AddEntityCollideCallback("Player""doorslam_1_area""func_slam"true1);
AddEntityCollideCallback("servant_grunt_1""servant_grunt_1_remove""RemoveMonster"true1);
}
void OnLeave() 
{
}
void function(string&in item)
{
    
SetEntityActive("servant_grunt_1"true);
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_11"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_12"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_13"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_14"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_15"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_16"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_17"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_18"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_19"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_20"4"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_21"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_22"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_23"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_24"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_25"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_26"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_27"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_28"0"");
}
 
 
void RemoveMonster(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"false);
}

void KeyOnDoor2(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("leveldoor_1"falsetrue);
    
RemoveItem("Main hall key");
    
PlaySoundAtEntity("""unlock_door.snt""leveldoor_1"0.0ftrue);


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-29-2011, 01:36 AM
Website Find
Mine Turtle Offline
Senior Member

Posts: 647
Threads: 32
Joined: Mar 2011
Reputation: 29
#2
RE: cant get level door to work :(

if you click on the level door you can choose a map for you to spawn in. click on the level door, then on the entities tab, then you look for ''mapfile'', and find the map you want to spawn in next. there is no need for a scripting for entering a new level, only for this key youre scripting for it. make sure the door's locked aswell (duuh xD)
nevermind that, that wasnt an answer to what you were asking (facepalm)
(This post was last modified: 12-29-2011, 02:04 AM by Mine Turtle.)
12-29-2011, 02:02 AM
Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#3
RE: cant get level door to work :(

(12-29-2011, 01:36 AM)jessehmusic Wrote: hey iv been working on a cs "Amnesia : The Castle" and i have made 2 maps but cant get level door to work i have made so you need a key but it says cannot use item bla bla bla... what to do here is the script for the key and door
PHP Code: (Select All)
void OnStart()  

SetEntityPlayerInteractCallback("Note_Test04""function"true); 
AddUseItemCallback("""Rusty Key""door_1""KeyOnDoor"true);  
AddUseItemCallback("""Mail hall key""leveldoor_1""KeyOnDoor2"true);  

 
 
void KeyOnDoor(string &in asItemstring &in asEntity

    
SetSwingDoorLocked("door_1"falsetrue); 
    
RemoveItem("Rusty Key"); 
PlaySoundAtEntity("""unlock_door.snt""door_1"0.0ftrue); 

 
 
void OnEnter()  
 

AddEntityCollideCallback("Player""doorslam_1_area""func_slam"true1); 
AddEntityCollideCallback("servant_grunt_1""servant_grunt_1_remove""RemoveMonster"true1); 

void OnLeave()  


void function(string&in item

SetEntityActive("servant_grunt_1"true); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_11"2""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_12"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_13"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_14"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_15"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_16"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_17"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_18"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_19"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_20"4""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_21"2""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_22"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_23"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_24"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_25"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_26"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_27"0""); 
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_28"0""); 

  
 
void RemoveMonster(string &in asParentstring &in asChildint alState

SetEntityActive("servant_grunt_1"false); 

 
void KeyOnDoor2(string &in asItemstring &in asEntity

    
SetSwingDoorLocked("leveldoor_1"falsetrue); 
    
RemoveItem("Main hall key"); 
    
PlaySoundAtEntity("""unlock_door.snt""leveldoor_1"0.0ftrue); 


it is also not a swing door.
i used this on my lvl door:
PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""key_prison""prisondoor""unlock_door1"true);
}
///PRISONDOOR
void unlock_door1(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("prisondoor"false);
PlaySoundAtEntity("""unlock_door""prisondoor"0false);
RemoveItem("key_prison");


this should help
12-29-2011, 02:20 AM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#4
RE: cant get level door to work :(

Gonna test it now
it did not work :S

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("leveldoor_1", false);
PlaySoundAtEntity("", "unlock_door", "leveldoor_1", 0, false);
RemoveItem("Main hall key");
}

cant get it to work it worked on my other lvl door but not now Sad

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-29-2011, 03:22 AM by jessehmusic.)
12-29-2011, 03:12 AM
Website Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#5
RE: cant get level door to work :(

you named the key "Mail Hall Key" in the OnStart, NOT "Main Hall Key".... Just fix it in the OnStart

12-29-2011, 03:39 AM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#6
RE: cant get level door to work :(

ty <3!


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-29-2011, 03:46 AM
Website Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#7
RE: cant get level door to work :(

(12-29-2011, 03:46 AM)jessehmusic Wrote: ty <3!


No probs =]
12-29-2011, 06:57 AM
Find




Users browsing this thread: 2 Guest(s)