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


Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script ERROR need help N00B
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#1
Script ERROR need help N00B

Here is my script can you see any errors because the game thinks there is:

void OnStart ()
{
AddUseItemCallback ("", "Corridor Key", "door_1", "UsedkeyOnDoor", true);
}
void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
playSoundAtEntity("", "unlock_door", "door_1", 0, false,);
RemoveItem("Corridor key");
}

I have done all the extra_english stuff :d

...
04-30-2011, 09:10 PM
Find
NylePudding Offline
Member

Posts: 77
Threads: 23
Joined: Apr 2011
Reputation: 0
#2
RE: Script ERROR need help N00B

If I understand correctly you have made an extremely easy mistake to correct.

playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

should be: playSoundAtEntity("", "unlock_door", "door_1", 0, false);

You had a comma at the end of "false".

C++ is annoying like that, hope it helps. Big Grin
04-30-2011, 09:22 PM
Find
Exostalker Offline
Member

Posts: 204
Threads: 10
Joined: Aug 2010
Reputation: 3
#3
RE: Script ERROR need help N00B

Did you add:

Spoiler below!

void OnEnter()
{

}

and
Spoiler below!

void OnLeave()
{

}


04-30-2011, 09:23 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#4
RE: Script ERROR need help N00B

Thnx guys Big Grin
Now its saying no matching signatures
Now its saying something about it cant find a signature Angry Angry Angry Angry

...
(This post was last modified: 04-30-2011, 09:47 PM by X4anco.)
04-30-2011, 09:27 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#5
RE: Script ERROR need help N00B

Please repeat your updated script file so I can see it.
(04-30-2011, 09:22 PM)NylePudding Wrote: If I understand correctly you have made an extremely easy mistake to correct.

playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

should be: playSoundAtEntity("", "unlock_door", "door_1", 0, false);

You had a comma at the end of "false".

C++ is annoying like that, hope it helps. Big Grin

I love C++ it always works nearly perfect for me. Big Grin
Nevermind, I found the problem.

You need to watch your capitalization and punctuation.

This: playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

Is supposed to be this:

PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);

(This post was last modified: 04-30-2011, 10:20 PM by Kyle.)
04-30-2011, 10:15 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#6
RE: Script ERROR need help N00B

Now my door doesn't unlock Huh Angry Huh Angry
it never did Sad

...
(This post was last modified: 04-30-2011, 11:14 PM by X4anco.)
04-30-2011, 11:00 PM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#7
RE: Script ERROR need help N00B

Yes, that's what Nylepudding already told him 1 hour before you did. Smile
04-30-2011, 11:34 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#8
RE: Script ERROR need help N00B

Try This;


void OnStart()
{
AddUseItemCallback ("", "Corridor_Key", "door_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("Corridor_key");
}


And also, go in your editor and rename "Corridor Key" to "Corridor_Key"

I am sure if you do exactly this it will work =)
04-30-2011, 11:49 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#9
RE: Script ERROR need help N00B

(04-30-2011, 11:34 PM)Tottel Wrote: Yes, that's what Nylepudding already told him 1 hour before you did. Smile

If you notice, sir, Nye forgot to capitalize the first letter.

04-30-2011, 11:56 PM
Find
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#10
RE: Script ERROR need help N00B

void OnStart()
{
    AddUseItemCallback("", "RoomKey", "RoomDoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string&in asEntity)
{
    SetSwingDoorLocked("RoomDoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
    RemoveItem("RoomKey");
}
This is my code of my test map. It has a UsedKeyOnDoor code. My code is working, so you can compare and see if there are any mistakes.

Smile

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-01-2011, 01:03 AM
Find




Users browsing this thread: 3 Guest(s)