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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone help me find the Script Error?
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#1
Rainbow  Can anyone help me find the Script Error?

Thank You For Reading this thread... Smile
My problem is that i can not find the error in this script... Tongue
I have a key named Key_Tomb_1 and a door named Doortodeath_1
When i use the key nothing happens...I wanted it to open the unlock the door... It is a level door by the way...NOT a swing door...Can you help me please Rolleyes ?
So here is my script----



////////////////////////////
//Run First Time Starting map
void OnStart()
{
AddUseItemCallback("", "key_Tomb_1", "Doortodeath_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Doortodeath_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Doortodeath_1", 0.0f, false);
RemoveItem("Key_Tomb_1");
AddDebugMessage("KeyOnDoor", false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
}

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

The one who solves it gets the place on the credits...
Hope you can help me...You will probably be on youtube...PS-Pewdiepie
Please help ---Il leave the custom story attached to this post if you want to try it and see it for your self---

The key is on the top of the "stove front"


Attached Files
.rar   Ghosthunting.rar (Size: 1.02 MB / Downloads: 161)
(This post was last modified: 09-13-2012, 05:17 AM by danimora2012.)
09-13-2012, 04:51 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Can anyone help me find the Script Error?

SetLevelDoorLocked doesn't have the same amount of arguments as a swing door, there is 1 less Boolean value. Also, the name of the key in the callback/function didn't match (capitalization issue.) Here's a revision:


void OnStart()
{
AddUseItemCallback("", "key_Tomb_1", "Doortodeath_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Doortodeath_1", false);
PlaySoundAtEntity("", "unlock_door", "Doortodeath_1", 0.0f, false);
RemoveItem("key_Tomb_1");
AddDebugMessage("Key On Door", false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}


Also, I wouldn't like to be in the credits if it means there's a chance my name will be associated with Pewdiepie. Thanks for understanding.

Hope that helped!

I rate it 3 memes.
09-13-2012, 04:57 AM
Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#3
RE: Can anyone help me find the Script Error?

(09-13-2012, 04:57 AM)andyrockin123 Wrote: That helped me bye removing the error i had when loading the custom story...Now i can load it and play it but the door still doesn't get unlocked... And i understand that you don't want to be in the credits...Helped me a LOT but can you fix it? i can't unlock the door with the key Blush
09-13-2012, 05:03 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: Can anyone help me find the Script Error?

Because of the previous issue with the names, I'm assuming that is the main cause at this point. Make sure you key is named "key_Tomb_1" and your door is named "Doortodeath_1". If that doesn't work, then take a quick look at this checklist:

-Make sure your .hps is an actual C++ script file, and that you didn't just rename the extension on a .txt file (if you're using notepad++ or geany, you can just use "Save as...").
-Make sure your .hps file is in the same folder as your .map file.
-Make sure your .hps and .map files have exactly the same name.

If none of that provides a solution to your problem, I'm afraid I don't know what it could be D:

I rate it 3 memes.
09-13-2012, 05:11 AM
Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#5
Big Grin  RE: Can anyone help me find the Script Error?

(09-13-2012, 05:11 AM)andyrockin123 Wrote: Because of the previous issue with the names, I'm assuming that is the main cause at this point. Make sure you key is named "key_Tomb_1" and your door is named "Doortodeath_1". If that doesn't work, then take a quick look at this checklist:

-Make sure your .hps is an actual C++ script file, and that you didn't just rename the extension on a .txt file (if you're using notepad++ or geany, you can just use "Save as...").
-Make sure your .hps file is in the same folder as your .map file.
-Make sure your .hps and .map files have exactly the same name.

If none of that provides a solution to your problem, I'm afraid I don't know what it could be D:
IT WORKED!! THANK YOU!!!!
The problem was with the Capital Letters!! i had the key named to key_tomb_1 and it should be key_Tomb_1 because on the scrip it was with capital letters!.... Big Grin Thank you very much... How can i repay you? Tongue
09-13-2012, 05:15 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: Can anyone help me find the Script Error?

(09-13-2012, 05:15 AM)danimora2012 Wrote: Thank you very much... How can i repay you? Tongue
I'll gladly accept a cookie; most varieties will do (except raisin, nobody likes raisin). I prefer traditional sugar. Delicious.

I rate it 3 memes.
09-13-2012, 05:20 AM
Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#7
RE: Can anyone help me find the Script Error?

(09-13-2012, 05:20 AM)andyrockin123 Wrote:
(09-13-2012, 05:15 AM)danimora2012 Wrote: Thank you very much... How can i repay you? Tongue
I'll gladly accept a cookie; most varieties will do (except raisin, nobody likes raisin). I prefer traditional sugar. Delicious.
Il send you a virtual cookie then!
(This post was last modified: 09-13-2012, 06:00 AM by danimora2012.)
09-13-2012, 05:57 AM
Find




Users browsing this thread: 3 Guest(s)