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
Help me
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#1
Help me

I'v got this problem with my door , though i got already one door working but the second one isn't working.
It wont open when i use the key on it.
Please help Smile

PS: The door with the error is locked_door0

( I will post everything that i need help with in this thread so i wont flood the forum with my noobness Confused )

HPS Script:

Spoiler below!
void OnStart()

{
AddUseItemCallback("", "key_0", "locked_door0", "UsedKeyOnDoor0", true);
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
SetEntityCallbackFunc("key_1", "OnPickup");
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddEntityCollideCallback("Player", "Message_2", "Message2", true, 1);
AddEntityCollideCallback("Player", "Message_3", "Message3", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("locked_door1", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);

RemoveItem("key_1");

}

void UsedKeyOnDoor0(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("locked_door0", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "locked_door0", 0, false);

RemoveItem("key_0");

}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
AddTimer("", 20.0f, "GruntDisable");
ShowEnemyPlayerPosition("servant_grunt_1");

}
void GruntDisable(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("gruntdoorss") == true)
{

SetMessage("Messages", "gruntdoor", 2);

}
}

//////////////////////////////////////////////////////////////////

void OnEnter()


{

AddUseItemCallback("", "trap", "locked_door1", "Trapitup", true);

SetEntityCallbackFunc("trap", "OnPickup1");

}

void Trapitup(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("locked_door1", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);

RemoveItem("trap");

}

void OnPickup1(string &in asEntity, string &in type)
{
SetEntityActive("1", true);
ShowEnemyPlayerPosition("1");
SetEntityActive("2", true);
ShowEnemyPlayerPosition("2");
SetEntityActive("3", true);
ShowEnemyPlayerPosition("3");
SetEntityActive("4", true);
ShowEnemyPlayerPosition("4");
SetEntityActive("5", true);
ShowEnemyPlayerPosition("5");

}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 0);
}

void Message2(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup2", 0);
}

void Message3(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup3", 0);
}

////////////////////////////////////////////////////////////////////////////////////


void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("vase_1", 0);
SetPropHealth("vase_2", 0);
}

///////////////////////////////////////////////////////////////
(This post was last modified: 10-10-2012, 05:09 PM by naseem142.)
10-10-2012, 05:07 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: Help me

I'm not seeing anything wrong. Double-check the names. In the editor too. Key and door names.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-10-2012, 05:10 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#3
RE: Help me

(10-10-2012, 05:10 PM)Nemet Robert Wrote: I'm not seeing anything wrong. Double-check the names. In the editor too. Key and door names.
I don't think the names are the problem , they are right. :/
10-10-2012, 05:17 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#4
RE: Help me

(10-10-2012, 05:17 PM)naseem142 Wrote:
(10-10-2012, 05:10 PM)Nemet Robert Wrote: I'm not seeing anything wrong. Double-check the names. In the editor too. Key and door names.
I don't think the names are the problem , they are right. :/
Make sure. Just in case.

Also, do you get a message like "This item cannot be used this way!" or something like that when you try to use the key on the door?

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-10-2012, 05:18 PM by Robby.)
10-10-2012, 05:18 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#5
RE: Help me

(10-10-2012, 05:18 PM)Nemet Robert Wrote:
(10-10-2012, 05:17 PM)naseem142 Wrote:
(10-10-2012, 05:10 PM)Nemet Robert Wrote: I'm not seeing anything wrong. Double-check the names. In the editor too. Key and door names.
I don't think the names are the problem , they are right. :/
Make sure. Just in case.

Also, do you get a message like "This item cannot be used this way!" or something like that when you try to use the key on the door?
Yeah , i get a "This item cannot be used this way" Message.
10-10-2012, 05:19 PM
Website Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#6
RE: Help me

(10-10-2012, 05:19 PM)naseem142 Wrote:
(10-10-2012, 05:18 PM)Nemet Robert Wrote:
(10-10-2012, 05:17 PM)naseem142 Wrote:
(10-10-2012, 05:10 PM)Nemet Robert Wrote: I'm not seeing anything wrong. Double-check the names. In the editor too. Key and door names.
I don't think the names are the problem , they are right. :/
Make sure. Just in case.

Also, do you get a message like "This item cannot be used this way!" or something like that when you try to use the key on the door?
Yeah , i get a "This item cannot be used this way" Message.



That means that there are no script or function connecting the two items/entities. So you most have entered a wrong name

CURRENT PROJECT:
A Fathers Secret == Just started
10-10-2012, 05:21 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#7
RE: Help me

(10-10-2012, 05:19 PM)naseem142 Wrote: Yeah , i get a "This item cannot be used this way" Message.
Re-check the names then. It only occurs that way if the names are incorrect.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-10-2012, 05:25 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#8
RE: Help me

(10-10-2012, 05:25 PM)Nemet Robert Wrote:
(10-10-2012, 05:19 PM)naseem142 Wrote: Yeah , i get a "This item cannot be used this way" Message.
Re-check the names then. It only occurs that way if the names are incorrect.
I have no idea. Huh
[Image: DeSWz.png]
10-10-2012, 05:31 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: Help me

Names are case-sensitive.

Tutorials: From Noob to Pro
10-10-2012, 05:36 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#10
Smile  RE: Help me

(10-10-2012, 05:36 PM)Your Computer Wrote: Names are case-sensitive.
Thanks , it worked now.

I need help with another thing , how can i change an item's name and description?
(This post was last modified: 10-10-2012, 06:33 PM by naseem142.)
10-10-2012, 06:15 PM
Website Find




Users browsing this thread: 1 Guest(s)