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
Scripting errors.
Redneb27 Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jul 2012
Reputation: 0
#1
Scripting errors.

I just started trying to create my own custom story, and I dont know hardly anything about scripting. All Im trying to do is make a key unlock a door right now. I get an unexpected token { error and a couple other errors. My scripting is probably full of errors, so can someone take a look at it and help me?


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
}

void (string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}

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

}
07-17-2012, 07:34 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#2
RE: Scripting errors.

Wrong section, moved to development support.
07-17-2012, 07:39 PM
Find
JMFStorm Offline
Member

Posts: 205
Threads: 8
Joined: Aug 2011
Reputation: 28
#3
RE: Scripting errors.

void KeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}

07-17-2012, 07:41 PM
Find
Redneb27 Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jul 2012
Reputation: 0
#4
RE: Scripting errors.

(07-17-2012, 07:41 PM)JMFStorm Wrote: void KeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
Okay I did that and it did remove one of the errors, but I still get an unexpected token { error. Is there something else wrong?
07-17-2012, 08:16 PM
Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#5
RE: Scripting errors.

Post the entire script again. You might have did something when most likely copying and pasting JMFStorm's script
07-17-2012, 10:00 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Scripting errors.

JMFStorm forgot to remove the semicolon in the function header that isn't supposed to be there.

Tutorials: From Noob to Pro
07-18-2012, 12:24 AM
Website Find
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#7
RE: Scripting errors.

Oh yeah

void KeyOnDoor(string &in asItem, string &in asEntity)
(This post was last modified: 07-18-2012, 12:41 AM by Kazakarumariou.)
07-18-2012, 12:41 AM
Find
Redneb27 Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jul 2012
Reputation: 0
#8
RE: Scripting errors.

Thanks guys. I got it working.
07-19-2012, 04:28 AM
Find




Users browsing this thread: 1 Guest(s)